Function isPointOnLine