mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Somehow this constant was wrong so all of our foot-to-meter conversions were coming out ~7% too large. We're still introducing some error because we're rounding early rather than only when we need an integer, but it's much more accurate now.
15 lines
348 B
Python
15 lines
348 B
Python
def meter_to_feet(value_in_meter: float) -> int:
|
|
return int(3.28084 * value_in_meter)
|
|
|
|
|
|
def feet_to_meter(value_in_feet: float) -> int:
|
|
return int(value_in_feet / 3.28084)
|
|
|
|
|
|
def meter_to_nm(value_in_meter: float) -> int:
|
|
return int(value_in_meter / 1852)
|
|
|
|
|
|
def nm_to_meter(value_in_nm: float) -> int:
|
|
return int(value_in_nm * 1852)
|