From 5e5c0ac2c3f80f14428c19293773245a8477aaaf Mon Sep 17 00:00:00 2001 From: David Thompson Date: Sun, 13 Aug 2017 13:32:18 -0400 Subject: math: Add cotangent function. * chickadee/math.scm (cotan): New procedure. --- chickadee/math.scm | 5 +++++ doc/api.texi | 4 ++++ 2 files changed, 9 insertions(+) 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)) diff --git a/doc/api.texi b/doc/api.texi index f5a2400..32a797b 100644 --- a/doc/api.texi +++ b/doc/api.texi @@ -429,6 +429,10 @@ approximation that is ``good enough.'' Half of @var{pi}. @end defvar +@deffn {Procedure} cotan @var{z} +Return the cotangent of @var{z}. +@end deffn + @node Vectors @subsection Vectors -- cgit v1.2.3