]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/calculator.el (calculator-funcall):
authorGlenn Morris <rgm@gnu.org>
Tue, 19 May 2015 00:54:24 +0000 (20:54 -0400)
committerGlenn Morris <rgm@gnu.org>
Tue, 19 May 2015 00:54:24 +0000 (20:54 -0400)
* lisp/textmodes/artist.el (artist-spray-random-points):
Use standard degree/radian conversion utilities.

lisp/calculator.el
lisp/textmodes/artist.el

index 0aef07b1750160a680f94f1f23a167af025d27b4..4027887fb0789f599e1de13ab349cb5640d5cbf5 100644 (file)
@@ -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))
index 930c39c82ccc905938fa25167215df943ddf9671..73521605436767982d3cddaf7348ff01fbd8e2d8 100644 (file)
@@ -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))))))