REVERSELINE Return same line but with opposite orientation. INVLINE = reverseLine(LINE); Returns the opposite line of LINE. LINE has the format [x0 y0 dx dy], then INVLINE will have following parameters: [x0 y0 -dx -dy]. See also: lines2d, createLine --------- author : David Legland INRA - TPV URPOI - BIA IMASTE created the 20/01/2004.
0001 function line = reverseLine(line) 0002 %REVERSELINE Return same line but with opposite orientation. 0003 % 0004 % INVLINE = reverseLine(LINE); 0005 % Returns the opposite line of LINE. 0006 % LINE has the format [x0 y0 dx dy], then INVLINE will have following 0007 % parameters: [x0 y0 -dx -dy]. 0008 % 0009 % See also: 0010 % lines2d, createLine 0011 % 0012 % --------- 0013 % author : David Legland 0014 % INRA - TPV URPOI - BIA IMASTE 0015 % created the 20/01/2004. 0016 % 0017 0018 % HISTORY 0019 % 30/06/2009 rename as reverseLine 0020 % 15/03/2011 simplify code 0021 0022 line(:, 3:4) = -line(:, 3:4); 0023 0024