1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-12-30 11:09:23 +00:00

* lisp/calculator.el (calculator-funcall):

* lisp/textmodes/artist.el (artist-spray-random-points):
Use standard degree/radian conversion utilities.
This commit is contained in:
Glenn Morris 2015-05-18 20:54:24 -04:00
parent d13f887448
commit d464818ca2
2 changed files with 3 additions and 3 deletions

View 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))

View 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))))))