summary refs log tree commit diff stats
path: root/tests/manyloc/keineschweine/lib/math_helpers.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manyloc/keineschweine/lib/math_helpers.nim')
-rw-r--r--tests/manyloc/keineschweine/lib/math_helpers.nim10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/manyloc/keineschweine/lib/math_helpers.nim b/tests/manyloc/keineschweine/lib/math_helpers.nim
new file mode 100644
index 000000000..5427dd80e
--- /dev/null
+++ b/tests/manyloc/keineschweine/lib/math_helpers.nim
@@ -0,0 +1,10 @@
+import strutils, math
+
+proc degrees*(rad: float): float =
+  return rad * 180.0 / PI
+proc radians*(deg: float): float =
+  return deg * PI / 180.0
+
+## V not math, sue me
+proc ff*(f: float, precision = 2): string {.inline.} =
+  return formatFloat(f, ffDecimal, precision)