ISPOINTONRAY Test if a point belongs to a ray. B = isPointOnRay(PT, RAY); Returns 1 if point PT belongs to the ray RAY. PT is given by [x y] and RAY by [x0 y0 dx dy]. If PT is a N-by-2 array, and RAY is a M-by-4 array, then the result is a N-by-M array containing the result of each pair-wise test. B = isPointOnRay(PT, RAY, TOL); Specifies the tolerance to use for testing if point is on the ray. Example ray = [10 20 3 4]; % test for a point on the ray p1 = [16 28]; isPointOnRay(p1, ray) ans = logical 0 % test for a point on the supporting line but "before" the origin p2 = [7 16]; isPointOnRay(p1, ray) ans = logical 0 See also: rays2d, points2d, isPointOnLine, isPointOnEdge
Package: matgeom