Function: math-from-hms

math-from-hms is an autoloaded and byte-compiled function defined in calc-forms.el.gz.

Signature

(math-from-hms A &optional ANG)

Source Code

;; Defined in /usr/src/emacs/lisp/calc/calc-forms.el.gz
;;; Convert A from HMS format to ANG or current angular mode.
(defun math-from-hms (a &optional ang)   ; [R X] [Public]
  (cond ((not (eq (car-safe a) 'hms))
	 (if (Math-numberp a)
	     a
	   (if (eq (car-safe a) 'sdev)
	       (math-make-sdev (math-from-hms (nth 1 a) ang)
			       (math-from-hms (nth 2 a) ang))
	     (if (eq (or ang
                         (and (not math-simplifying-units) calc-angle-mode))
                     'rad)
		 (list 'calcFunc-rad a)
	       (list 'calcFunc-deg a)))))
	((math-negp a)
	 (math-neg (math-from-hms (math-neg a) ang)))
	((eq (or ang
                 (and (not math-simplifying-units) calc-angle-mode))
             'rad)
	 (math-mul (math-from-hms a 'deg) (math-pi-over-180)))
	(t
	 (math-add (math-div (math-add (math-div (nth 3 a)
						 '(float 6 1))
				       (nth 2 a))
			     60)
		   (nth 1 a)))))