summaryrefslogtreecommitdiff
path: root/chickadee/math.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2017-08-13 13:32:18 -0400
committerDavid Thompson <dthompson2@worcester.edu>2017-09-13 21:16:30 -0400
commit5e5c0ac2c3f80f14428c19293773245a8477aaaf (patch)
tree9a473e52a032081af343a2461eb3bdd8f68ed498 /chickadee/math.scm
parent49565d13e9da2d68ef66dcf1573611725ef24935 (diff)
math: Add cotangent function.
* chickadee/math.scm (cotan): New procedure.
Diffstat (limited to 'chickadee/math.scm')
-rw-r--r--chickadee/math.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/chickadee/math.scm b/chickadee/math.scm
index e9ebc6d..b695e92 100644
--- a/chickadee/math.scm
+++ b/chickadee/math.scm
@@ -18,6 +18,7 @@
(define-module (chickadee math)
#:export (pi
pi/2
+ cotan
square
clamp
min
@@ -28,6 +29,10 @@
(define pi 3.14159265358979323846)
(define pi/2 (/ pi 2.0))
+(define-inlinable (cotan z)
+ "Return the cotangent of Z."
+ (/ 1.0 (tan z)))
+
(define-inlinable (square x)
(* x x))