(defun rad-to-decimal-deg (alpha-rad)
(/ (* alpha-rad 180) pi))
(rad-to-decimal-deg 0.0116) => 0.664631042351755
(rad-to-decimal-deg 0.0233) => 1.3349916626548182
(defun decimal-deg-to-dms (n)
(setq d (round n))
(setq m (* (- n d) 60))
(setq s (- (* 3600 (- n d)) (* 60 m)))
(format "%d° %d' %d''" d m s))
(decimal-deg-to-dms 0.664631042351755) => "1° -20' 0''"
(decimal-deg-to-dms 1.3349916626548182) => "1° 20' 0''"
Где ошибка не вижу.
Проверял вот так
(defun dms-to-rad (d m s)
(+ (* d (/ pi 180))
(* m (/ pi (* 180 60)))
(* s (/ pi (* 180 60 60)))
))
0˚8’0’’
(dms-to-rad 0 8 0) => 0.0023271056693257726
(rad-to-decimal-deg 0.0023271056693257726) => 0.13333333333333333
(decimal-deg-to-dms 0.13333333333333333) => "0° 8' 0''"