(MakeReadable (* -1 pi)) => 0.0
(MakeReadable (* -3 pi)) => -3.14159
(LM:READABLE (* -1 pi)) => 0.0
(LM:READABLE (* -3 pi)) -3.14159
Similar: http://www.theswamp.org/index.php?topic=47220.0
Small issue: both functions proposed here do not work properly if the input is smaller than -2*pi.Code: [Select](MakeReadable (* -1 pi)) => 0.0
(MakeReadable (* -3 pi)) => -3.14159
(LM:READABLE (* -1 pi)) => 0.0
(LM:READABLE (* -3 pi)) -3.14159
(defun MakeReadable (a)
(if (minusp (setq a (rem a (+ pi pi)))) (setq a (+ a pi pi)))
(rem (if (< (* pi 0.5) a (* pi 1.5))(+ a pi) a) (+ pi pi))
)
Similar: http://www.theswamp.org/index.php?topic=47220.0
Small issue: both functions proposed here do not work properly if the input is smaller than -2*pi.Code: [Select](MakeReadable (* -1 pi)) => 0.0
(MakeReadable (* -3 pi)) => -3.14159
(LM:READABLE (* -1 pi)) => 0.0
(LM:READABLE (* -3 pi)) -3.14159
Thanks roy - a possible correction:Code - Auto/Visual Lisp: [Select]
Hi Lee
I tested its corrected function.
She worked well with the angles that I informed:
(LM: readable (angle p1 p2)) or (LM: readable (angle p2 p1)) -> Returns the correct angle
Thanks