summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2020-04-08 17:01:16 -0400
committerDavid Thompson <dthompson2@worcester.edu>2020-04-08 17:03:43 -0400
commitc68106172e7115ec1f69538d757144df8ca70b7b (patch)
treed15443734ad194da452c913d6b9d216c66ae54ce
parent8cab4876cd9b76a9a012c5c98dad288816a8b6fc (diff)
math: Add 2pi variable.
* chickadee/math.scm (2pi): New variable.
-rw-r--r--chickadee/math.scm2
-rw-r--r--doc/api.texi4
2 files changed, 6 insertions, 0 deletions
diff --git a/chickadee/math.scm b/chickadee/math.scm
index 050dac1..b970526 100644
--- a/chickadee/math.scm
+++ b/chickadee/math.scm
@@ -18,6 +18,7 @@
(define-module (chickadee math)
#:export (pi
pi/2
+ 2pi
cotan
square
clamp
@@ -30,6 +31,7 @@
(define pi 3.14159265358979323846)
(define pi/2 (/ pi 2.0))
+(define 2pi (* pi 2.0))
(define-inlinable (cotan z)
"Return the cotangent of Z."
diff --git a/doc/api.texi b/doc/api.texi
index f553f25..3992c06 100644
--- a/doc/api.texi
+++ b/doc/api.texi
@@ -571,6 +571,10 @@ approximation that is ``good enough.''
Half of @var{pi}.
@end defvar
+@defvar 2pi
+Twice @var{pi}.
+@end defvar
+
@deffn {Procedure} cotan z
Return the cotangent of @var{z}.
@end deffn