LINEPOSITION Position of a point on a line. POS = linePosition(POINT, LINE); Computes position of point POINT on the line LINE, relative to origin point and direction vector of the line. LINE has the form [x0 y0 dx dy], POINT has the form [x y], and is assumed to belong to line. POS = linePosition(POINT, LINES); If LINES is an array of NL lines, return NL positions, corresponding to each line. POS = linePosition(POINTS, LINE); If POINTS is an array of NP points, return NP positions, corresponding to each point. POS = linePosition(POINTS, LINES); If POINTS is an array of NP points and LINES is an array of NL lines, return an array of [NP NL] position, corresponding to each couple point-line. POS = linePosition(POINTS, LINES, 'diag'); When POINTS and LINES have the same number of rows, computes positions only for couples POINTS(i,:) and LINES(i,:). The result POS is a column vector with as many rows as the number of points/lines. Example line = createLine([10 30], [30 90]); linePosition([20 60], line) ans = .5 See also: lines2d, createLine, projPointOnLine, isPointOnLine --------- author : David Legland INRA - TPV URPOI - BIA IMASTE created the 25/05/2004.
Package: matgeom