Convertitore di velocità
Converti tra km/h, mph, m/s, nodi e altre unità di velocità.
Il convertitore di velocità traduce la velocità tra le unità più comuni nella vita quotidiana, nei trasporti e nella scienza: chilometri all'ora (km/h), miglia all'ora (mph), metri al secondo (m/s), piedi al secondo (ft/s) e nodi.
Inserisci un valore di velocità in qualsiasi campo e lo strumento compila istantaneamente tutte le altre unità. Utile per confrontare le velocità di veicoli, aeromobili o fenomeni naturali descritti in diversi sistemi di unità.
Riferimento utile: un tipico limite di velocità autostradale di 100 km/h equivale a circa 62 mph, 27,8 m/s o 54 nodi. La velocità del suono al livello del mare è di circa 340 m/s o 1225 km/h.
Domande Frequenti
Implementazione del Codice
# Speed conversion functions
def ms_to_kmh(ms: float) -> float:
"""Meters per second to kilometers per hour"""
return ms * 3.6
def kmh_to_ms(kmh: float) -> float:
"""Kilometers per hour to meters per second"""
return kmh / 3.6
def kmh_to_mph(kmh: float) -> float:
"""Kilometers per hour to miles per hour"""
return kmh * 0.621371
def mph_to_kmh(mph: float) -> float:
"""Miles per hour to kilometers per hour"""
return mph / 0.621371
def knots_to_kmh(knots: float) -> float:
"""Knots (nautical miles/hour) to km/h"""
return knots * 1.852
def kmh_to_knots(kmh: float) -> float:
return kmh / 1.852
def ms_to_mach(ms: float, altitude_sea_level: bool = True) -> float:
"""Approximate Mach number (sea level: 340 m/s, high altitude: 295 m/s)"""
speed_of_sound = 340 if altitude_sea_level else 295
return ms / speed_of_sound
# Examples
print(ms_to_kmh(30)) # 108.0 km/h (fast car)
print(kmh_to_mph(100)) # 62.14 mph
print(knots_to_kmh(1)) # 1.852 km/hComments & Feedback
Comments are powered by Giscus. Sign in with GitHub to leave a comment.