;------------- POČETAK - PODNAPUTBINA ZA IZRAČUN UDALJENOSTI TOČKE DO PRAVCA
KOJI JE ZADAN S DVIE TOČKE----------------------------------------------
;Računa udaljenost točke od crte u 2 protežnom sustavu
(defun toc-crto-duz (Pt1 Line1StartPt Line1EndPt / Line1StartX Line1StartY
Line1EndX Line1EndY Pt1X Pt1Y Ang1 PerpDist)
(setq Line1StartX (car
Line1StartPt))
(setq Line1StartY (cadr
Line1StartPt))
(setq Line1EndX (car Line1EndPt))
(setq Line1EndY (cadr Line1EndPt))
(setq Pt1X (car Pt1))
(setq Pt1Y (cadr Pt1))
(if (/= (- Line1EndY Line1StartY)
0)
(setq Ang1 (atan (/ (- Line1EndX
Line1StartX) (- Line1EndY Line1StartY))))
(setq Ang1 (/ pi 2))
)
(setq PerpDist (abs (- (* (cos
Ang1) (- Pt1X Line1StartX)) (* (sin Ang1) (-
Pt1Y Line1StartY)))))
)
;------------- KRAJ - PODNAPUTBINA ZA IZRAČUN UDALJENOSTI TOČKE DO PRAVCA
KOJI JE ZADAN S DVIE TOČKE----------------------------------------------