summaryrefslogtreecommitdiff
path: root/sly/math.scm
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2014-08-03 20:34:33 -0400
committerDavid Thompson <dthompson2@worcester.edu>2014-08-25 19:33:07 -0400
commite8f5b8cca92c41cd4a9a62c297ec01a38c786063 (patch)
treea975592f1397965a4bcb6ab6ff14aba200704db5 /sly/math.scm
parent1963e911026046f528a2923a924a39b55947558e (diff)
Simplify perspective-projection implementation.
* sly/math.scm (cotan): New procedure. * sly/transform.scm (perspective-projection): Simplify.
Diffstat (limited to 'sly/math.scm')
-rw-r--r--sly/math.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/sly/math.scm b/sly/math.scm
index 1a5f2c6..8dc5cbf 100644
--- a/sly/math.scm
+++ b/sly/math.scm
@@ -30,6 +30,7 @@
cos-degrees
tan-degrees
atan-degrees
+ cotan
clamp
linear-scale))
@@ -85,6 +86,10 @@
"Compute the arctangent in degrees of the coordinates Y and X."
(radians->degrees (atan y x)))
+(define (cotan z)
+ "Return the cotangent of Z."
+ (/ 1 (tan z)))
+
(define (clamp min max x)
"Restrict X to the range defined by MIN and MAX. Assumes that MIN is
actually less than MAX."