Slope Calculation.
(defun c:slope (/ ang slp slple)
(or ris(setq
ris 1.0)) ;;Rise
Vertical
(setq rist
(getdist (strcat "\nEnter Rise : <"(rtos ris 2
2)">")))
(and rist
(setq ris rist))
(or run
(setq run 20.0)) ;;Run
Horizontal
(setq runt
(getdist (strcat "\nEnter Run : <"(rtos run 2
2)">")))
(and runt
(setq run runt))
(setq ang (/
(* (atan (/ ris run)) 180) pi)) ;;Angle
Degree
(setq angra
(* ang (/ pi 180))) ;;Angle
of Radial
(setq slp
(*(/ ris run) 100.0)) ;;Slope
%
(setq slple
(/ ris (sin angra))) ;;Slope
Length
(princ
(strcat "\nSlope = "(rtos slp 2 0) "%"))
(princ
(strcat "\nSlope Length = "(rtos slple 2 3) "m."))
(princ (strcat "\nAngle = "(rtos ang 2 3) "\U+00B0"))
(princ)
)
ไม่มีความคิดเห็น:
แสดงความคิดเห็น