I have developed a simple routine to apply the Graham's scan algorithm (LM:ConvexHull function by Lee-Mac), for testing if a point is inside or on a polygon.
(defun c:test_pi ( / p l)
(if (setq p (getpoint "\nPick 1st point: "))
(progn (setq p (trans p 1 0)
l (list p))
(while (setq p (getpoint "\nPick next point <Exit>: "))
(setq p (trans p 1 0)
l (cons p l)))))
(setq p (getpoint "\nPick point to verify: "))
(cond ((equal (LM:ConvexHull l) (LM:ConvexHull (cons p l))) (print "Point inside or collinear"))))
Well, if I draw a polygon and place the point to verify
along an horizontal side of the polygon that lay on the lowest y-coordinate (with object snap's "near"), the result is nil!!
I don't know why, and I'll appreciate every help.