;Roof pitch utility by Mike Grisez ;*********************************** RTD ********************************* ;Converts radians to degrees (defun rtd (r) (* 180 (/ r pi)) ) ;******************************** DTR ************************************ ;Converts degrees to radians (defun dtr (a) (* pi (/ a 180.0)) ) ;****************************** TAN **************************************** ;Tangent function (defun tan (an) (/ (sin an) (cos an)) ) ;******************************* PITCH *********************************** ;Gives roof angle in degrees from roof pitch (defun c:pitch (/ rp ang) (setq rp (getdist " What is the Roof Pitch? (? in 12): ")) (terpri) (setq ang (rtd (atan (/ rp 12.0)))) (prompt "The Roof Slope is: ") (princ ang) (prompt " degrees") (princ) ) ;**************************** COMMAND GETPITCH ****************************** (defun C:getpitch () (setq ang (getdist "The Angle in Decimal Degrees? ")) (terpri) (setq dd (* (tan (dtr ang)) 12.0)) (prompt "The Roof Pitch is: ") (princ (rtos dd 3 2 )) (prompt " in 12") (terpri) (princ) ) (prompt "Command Pitch = ?/12 to Degrees, Command Getpitch = Degrees to ?/12") (princ)