(defun c:PEND (/ p1 p2 dX dY)

(and

(setq p1 (getpoint "\nEnter first point: "))

(setq p2 (getpoint p1 "\nEnter second point: "))

(setq dX (- (car p2) (car p1)))

(setq dY (- (cadr p2) (cadr p1)))

(princ

(strcat

"\nDistance = "

(rtos (distance p1 p2))

"\t Delta X = "

(rtos dX)

"\t Delta Y = "

(rtos dY)

(if (zerop dX)

"\t Vertical"

(strcat

"\t Slope = "

(rtos

(if ( dY 0) (abs (* 100 (/ dY dX)))

(* -100 (/ dY dX)))

(* 100 (/ dY dX))))

"%"

)

)

)

)

)

(princ)

)
(c:pend)

Advertisements