emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master d464818: * lisp/calculator.el (calculator-funcall):


From: Glenn Morris
Subject: [Emacs-diffs] master d464818: * lisp/calculator.el (calculator-funcall):
Date: Tue, 19 May 2015 00:54:28 +0000

branch: master
commit d464818ca2fdae2655a312c0f3fa8b66481c6522
Author: Glenn Morris <address@hidden>
Commit: Glenn Morris <address@hidden>

    * lisp/calculator.el (calculator-funcall):
    
    * lisp/textmodes/artist.el (artist-spray-random-points):
    Use standard degree/radian conversion utilities.
---
 lisp/calculator.el       |    4 ++--
 lisp/textmodes/artist.el |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/calculator.el b/lisp/calculator.el
index 0aef07b..4027887 100644
--- a/lisp/calculator.el
+++ b/lisp/calculator.el
@@ -1203,10 +1203,10 @@ arguments."
     ;; f is an expression
     (let ((TX (and X (calculator-truncate X)))
           (TY (and Y (calculator-truncate Y)))
-          (DX (if (and X calculator-deg) (/ (* X pi) 180) X))
+          (DX (if (and X calculator-deg) (degrees-to-radians X) X))
           (L  calculator-saved-list)
           (fF `(calculator-funcall ',f x y))
-          (fD `(if calculator-deg (/ (* x 180) float-pi) x)))
+          (fD `(if calculator-deg (* radians-to-degrees x) x)))
       (eval `(cl-flet ((F (&optional x y) ,fF) (D (x) ,fD))
                (let ((X ,X) (Y ,Y) (DX ,DX) (TX ,TX) (TY ,TY) (L ',L))
                  ,f))
diff --git a/lisp/textmodes/artist.el b/lisp/textmodes/artist.el
index 930c39c..7352160 100644
--- a/lisp/textmodes/artist.el
+++ b/lisp/textmodes/artist.el
@@ -2958,7 +2958,7 @@ Blanks in the rendered text overwrite any text in the 
buffer."
 Returns a list of points.  Each point is on the form (X1 . Y1)."
   (let ((points))
     (while (> n 0)
-      (let* ((angle (* (random 359) (/ float-pi 180)))
+      (let* ((angle (degrees-to-radians (random 359)))
             (dist  (random radius))
             (point (cons (round (* dist (cos angle)))
                          (round (* dist (sin angle))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]