Updated atan to support two arguments as in CL.
authorTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 22:43:45 +0000 (22:43 +0000)
committerTravis Cross <tc@traviscross.com>
Mon, 31 Mar 2008 22:43:45 +0000 (22:43 +0000)
ATAN with two arguments translates into atan2 in JS.

src/lib/ps-macro-lib.lisp

index 6a87323..81c56e3 100644 (file)
@@ -21,7 +21,7 @@
     (tan (n) `(*math.tan ,n))
     (acos (n) `(*math.acos ,n))
     (asin (n) `(*math.asin ,n))
-    (atan (n) `(*math.atan ,n))
+    (atan (y &optional x) (if x `(*math.atan2 ,y ,x) `(*math.atan ,y)))
     (exp (n) `(*math.exp ,n))
     (floor (n &optional divisor) `(*math.floor ,(if divisor `(/ ,n ,divisor) n)))
     (expt (base power) `(*math.pow ,base ,power))