Almost certainly is a done deal, but I could not find it, I need to test if two lines are collinear (simple 2D test), I have found theese functions:
;; List Collinear-p - Lee Mac
;; Returns T if all points in a list are collinear
(defun LM:ListCollinear-p ( lst )
(or (null (cddr lst))
(and (LM:Collinear-p (car lst) (cadr lst) (caddr lst))
(LM:ListCollinear-p (cdr lst))
)
)
)
;; Collinear-p - Lee Mac
;; Returns T if p1,p2,p3 are collinear
(defun LM:Collinear-p ( p1 p2 p3 )
(
(lambda ( a b c )
(or
(equal (+ a b) c 1e-4)
(equal (+ b c) a 1e-4)
(equal (+ c a) b 1e-4)
)
)
(distance p1 p2) (distance p2 p3) (distance p1 p3)
)
)
Is there an easier way passing directly the objects without extracting the start and end points?