fix angle conversion problem
This commit is contained in:
parent
3f3e6e4cb4
commit
83abd94dd0
|
@ -349,8 +349,10 @@
|
|||
(equal? arg +nan.0)))))
|
||||
|
||||
(define (angle->proper-range α)
|
||||
(define whole-part (modulo (round α) 360))
|
||||
(define decimal-part (- α (round α)))
|
||||
(define eα (inexact->exact α))
|
||||
(define rα (round eα))
|
||||
(define whole-part (modulo rα 360))
|
||||
(define decimal-part (- eα rα))
|
||||
(if (and (zero? whole-part)
|
||||
(negative? decimal-part))
|
||||
(+ 360 decimal-part)
|
||||
|
|
|
@ -996,6 +996,11 @@
|
|||
=>
|
||||
(rectangle 100 10 'solid (color 0 255 0)))
|
||||
|
||||
;; make sure that rotation with a very small negative number doesn't crash
|
||||
(test (image? (rotate -0.0000000000000001 (rectangle 10 10 'solid 'blue)))
|
||||
=>
|
||||
#t)
|
||||
|
||||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;;
|
||||
;; regular polygon
|
||||
|
|
Loading…
Reference in New Issue
Block a user