Initial commit of units.py

This commit is contained in:
XANTRONIX 2025-03-17 22:09:01 -04:00
parent 060d48e0cc
commit 35c8ee27b1

16
lib/xmet/units.py Normal file
View file

@ -0,0 +1,16 @@
import math
def deg(rad: float) -> float:
return (rad * (180.0 / math.pi)) - 90
def rad(deg: float) -> float:
return (deg + 90) * (math.pi / 180.0)
def knots(ms: float) -> float:
return ms * 1.944
def kelvin(c: float) -> float:
return 273.15 + c
def celsius(k: float) -> float:
return k - 273.15