math_helpers.nim 269 B

1234567891011
  1. import strutils, math
  2. proc degrees*(rad: float): float =
  3. return rad * 180.0 / PI
  4. proc radians*(deg: float): float =
  5. return deg * PI / 180.0
  6. ## V not math, sue me
  7. proc ff*(f: float, precision = 2): string {.inline.} =
  8. return formatFloat(f, ffDecimal, precision)