From: <jpi...@us...> - 2011-10-09 17:01:57
|
Revision: 8718 http://octave.svn.sourceforge.net/octave/?rev=8718&view=rev Author: jpicarbajal Date: 2011-10-09 17:01:50 +0000 (Sun, 09 Oct 2011) Log Message: ----------- geometry. Transforms finshed Modified Paths: -------------- trunk/octave-forge/main/geometry/doc/NEWS Added Paths: ----------- trunk/octave-forge/main/geometry/geom2d/inst/fitAffineTransform2d.m trunk/octave-forge/main/geometry/geom2d/inst/transformEdge.m trunk/octave-forge/main/geometry/geom2d/inst/transformLine.m Removed Paths: ------------- trunk/octave-forge/main/geometry/matGeom_raw/geom2d/fitAffineTransform2d.m trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformEdge.m trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformLine.m Modified: trunk/octave-forge/main/geometry/doc/NEWS =================================================================== --- trunk/octave-forge/main/geometry/doc/NEWS 2011-10-09 16:20:45 UTC (rev 8717) +++ trunk/octave-forge/main/geometry/doc/NEWS 2011-10-09 17:01:50 UTC (rev 8718) @@ -70,3 +70,17 @@ vectors2d.m =============================================================================== +geometry-1.1.3 Release Date: 2011-10-10 Release Manager: Juan Pablo Carbajal +=============================================================================== + +* Continue to add geom2d from matGeom (transforms) + createBasisTransform.m + createHomothecy.m + createLineReflection.m + createRotation.m + createScaling.m + createTranslation.m + transformPoint.m + transforms2d.m + +=============================================================================== Copied: trunk/octave-forge/main/geometry/geom2d/inst/fitAffineTransform2d.m (from rev 8716, trunk/octave-forge/main/geometry/matGeom_raw/geom2d/fitAffineTransform2d.m) =================================================================== --- trunk/octave-forge/main/geometry/geom2d/inst/fitAffineTransform2d.m (rev 0) +++ trunk/octave-forge/main/geometry/geom2d/inst/fitAffineTransform2d.m 2011-10-09 17:01:50 UTC (rev 8718) @@ -0,0 +1,73 @@ +%% Copyright (c) 2011, INRA +%% 2009-2011, David Legland <dav...@gr...> +%% 2011 Adapted to Octave by Juan Pablo Carbajal <car...@if...> +%% +%% All rights reserved. +%% (simplified BSD License) +%% +%% Redistribution and use in source and binary forms, with or without +%% modification, are permitted provided that the following conditions are met: +%% +%% 1. Redistributions of source code must retain the above copyright notice, this +%% list of conditions and the following disclaimer. +%% +%% 2. Redistributions in binary form must reproduce the above copyright notice, +%% this list of conditions and the following disclaimer in the documentation +%% and/or other materials provided with the distribution. +%% +%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +%% POSSIBILITY OF SUCH DAMAGE. +%% +%% The views and conclusions contained in the software and documentation are +%% those of the authors and should not be interpreted as representing official +%% policies, either expressed or implied, of copyright holder. + +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{T} = } fitAffineTransform2d (@var{pts1}, @var{pts2}) +%% Fit an affine transform using two point sets. +%% +%% Example +%% +%% @example +%% N = 10; +%% pts = rand(N, 2)*10; +%% trans = createRotation(3, 4, pi/4); +%% pts2 = transformPoint(pts, trans); +%% pts3 = pts2 + randn(N, 2)*2; +%% fitted = fitAffineTransform2d(pts, pts2) +%%@end example +%% +%% @seealso{transforms2d} +%% @end deftypefn + +function trans = fitAffineTransform2d(pts1, pts2) + + % number of points + N = size(pts1, 1); + + % main matrix of the problem + A = [... + pts1(:,1) pts1(:,2) ones(N,1) zeros(N, 3) ; ... + zeros(N, 3) pts1(:,1) pts1(:,2) ones(N,1) ]; + + % conditions initialisations + B = [pts2(:,1) ; pts2(:,2)]; + + % compute coefficients using least square + coefs = A\B; + + % format to a matrix + trans = [coefs(1:3)' ; coefs(4:6)'; 0 0 1]; + +endfunction + + Copied: trunk/octave-forge/main/geometry/geom2d/inst/transformEdge.m (from rev 8716, trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformEdge.m) =================================================================== --- trunk/octave-forge/main/geometry/geom2d/inst/transformEdge.m (rev 0) +++ trunk/octave-forge/main/geometry/geom2d/inst/transformEdge.m 2011-10-09 17:01:50 UTC (rev 8718) @@ -0,0 +1,71 @@ +%% Copyright (c) 2011, INRA +%% 2004-2011, David Legland <dav...@gr...> +%% 2011 Adapted to Octave by Juan Pablo Carbajal <car...@if...> +%% +%% All rights reserved. +%% (simplified BSD License) +%% +%% Redistribution and use in source and binary forms, with or without +%% modification, are permitted provided that the following conditions are met: +%% +%% 1. Redistributions of source code must retain the above copyright notice, this +%% list of conditions and the following disclaimer. +%% +%% 2. Redistributions in binary form must reproduce the above copyright notice, +%% this list of conditions and the following disclaimer in the documentation +%% and/or other materials provided with the distribution. +%% +%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +%% POSSIBILITY OF SUCH DAMAGE. +%% +%% The views and conclusions contained in the software and documentation are +%% those of the authors and should not be interpreted as representing official +%% policies, either expressed or implied, of copyright holder. + +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{edge2} = } transformEdge (@var{edge1}, @var{T}) +%% Transform an edge with an affine transform. +%% +%% Where @var{edge1} has the form [x1 y1 x2 y1], and @var{T} is a transformation +%% matrix, return the edge transformed with affine transform @var{T}. +%% +%% Format of TRANS can be one of : +%% [a b] , [a b c] , or [a b c] +%% [d e] [d e f] [d e f] +%% [0 0 1] +%% +%% Also works when @var{edge1} is a [Nx4] array of double. In this case, @var{edge2} +%% has the same size as @var{edge1}. +%% +%% @seealso{edges2d, transforms2d, transformPoint, translation, rotation} +%% @end deftypefn + +function dest = transformEdge(edge, trans) + + dest = zeros(size(edge)); + + % compute position + dest(:,1) = edge(:,1)*trans(1,1) + edge(:,2)*trans(1,2); + dest(:,2) = edge(:,1)*trans(2,1) + edge(:,2)*trans(2,2); + dest(:,3) = edge(:,3)*trans(1,1) + edge(:,3)*trans(1,2); + dest(:,4) = edge(:,4)*trans(2,1) + edge(:,4)*trans(2,2); + + % add translation vector, if exist + if size(trans, 2)>2 + dest(:,1) = dest(:,1)+trans(1,3); + dest(:,2) = dest(:,2)+trans(2,3); + dest(:,3) = dest(:,3)+trans(1,3); + dest(:,4) = dest(:,4)+trans(2,3); + end + +endfunction + Copied: trunk/octave-forge/main/geometry/geom2d/inst/transformLine.m (from rev 8716, trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformLine.m) =================================================================== --- trunk/octave-forge/main/geometry/geom2d/inst/transformLine.m (rev 0) +++ trunk/octave-forge/main/geometry/geom2d/inst/transformLine.m 2011-10-09 17:01:50 UTC (rev 8718) @@ -0,0 +1,66 @@ +%% Copyright (c) 2011, INRA +%% 2004-2011, David Legland <dav...@gr...> +%% 2011 Adapted to Octave by Juan Pablo Carbajal <car...@if...> +%% +%% All rights reserved. +%% (simplified BSD License) +%% +%% Redistribution and use in source and binary forms, with or without +%% modification, are permitted provided that the following conditions are met: +%% +%% 1. Redistributions of source code must retain the above copyright notice, this +%% list of conditions and the following disclaimer. +%% +%% 2. Redistributions in binary form must reproduce the above copyright notice, +%% this list of conditions and the following disclaimer in the documentation +%% and/or other materials provided with the distribution. +%% +%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +%% POSSIBILITY OF SUCH DAMAGE. +%% +%% The views and conclusions contained in the software and documentation are +%% those of the authors and should not be interpreted as representing official +%% policies, either expressed or implied, of copyright holder. + +%% -*- texinfo -*- +%% @deftypefn {Function File} {@var{line2} = } transformLine (@var{line1}, @var{T}) +%% Transform a line with an affine transform. +%% +%% Returns the line @var{line1} transformed with affine transform @var{T}. +%% @var{line1} has the form [x0 y0 dx dy], and @var{T} is a transformation +%% matrix. +%% +%% Format of @var{T} can be one of : +%% [a b] , [a b c] , or [a b c] +%% [d e] [d e f] [d e f] +%% [0 0 1] +%% +%% Also works when @var{line1} is a [Nx4] array of double. In this case, @var{line2} +%% has the same size as @var{line1}. +%% +%% @seealso{lines2d, transforms2d, transformPoint} +%% @end deftypefn + +function dest = transformLine(line, trans) + + % isolate points + points1 = line(:, 1:2); + points2 = line(:, 1:2) + line(:, 3:4); + + % transform points + points1 = transformPoint(points1, trans); + points2 = transformPoint(points2, trans); + + dest = createLine(points1, points2); + +endfunction + Deleted: trunk/octave-forge/main/geometry/matGeom_raw/geom2d/fitAffineTransform2d.m =================================================================== --- trunk/octave-forge/main/geometry/matGeom_raw/geom2d/fitAffineTransform2d.m 2011-10-09 16:20:45 UTC (rev 8717) +++ trunk/octave-forge/main/geometry/matGeom_raw/geom2d/fitAffineTransform2d.m 2011-10-09 17:01:50 UTC (rev 8718) @@ -1,73 +0,0 @@ -%% Copyright (c) 2011, INRA -%% 2007-2011, David Legland <dav...@gr...> -%% 2011 Adapted to Octave by Juan Pablo Carbajal <car...@if...> -%% -%% All rights reserved. -%% (simplified BSD License) -%% -%% Redistribution and use in source and binary forms, with or without -%% modification, are permitted provided that the following conditions are met: -%% -%% 1. Redistributions of source code must retain the above copyright notice, this -%% list of conditions and the following disclaimer. -%% -%% 2. Redistributions in binary form must reproduce the above copyright notice, -%% this list of conditions and the following disclaimer in the documentation -%% and/or other materials provided with the distribution. -%% -%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -%% POSSIBILITY OF SUCH DAMAGE. -%% -%% The views and conclusions contained in the software and documentation are -%% those of the authors and should not be interpreted as representing official -%% policies, either expressed or implied, of copyright holder. - - -function trans = fitAffineTransform2d(pts1, pts2) -%FITAFFINETRANSFORM2D Fit an affine transform using two point sets -% TRANS = fitAffineTransform2d(PTS1, PTS2) -% -% Example -% N = 10; -% pts = rand(N, 2)*10; -% trans = createRotation(3, 4, pi/4); -% pts2 = transformPoint(pts, trans); -% pts3 = pts2 + randn(N, 2)*2; -% fitted = fitAffineTransform2d(pts, pts2); -% -% -% See also -% -% -% ------ -% Author: David Legland -% e-mail: dav...@gr... -% Created: 2009-07-31, using Matlab 7.7.0.471 (R2008b) -% Copyright 2009 INRA - Cepia Software Platform. - - -% number of points -N = size(pts1, 1); - -% main matrix of the problem -A = [... - pts1(:,1) pts1(:,2) ones(N,1) zeros(N, 3) ; ... - zeros(N, 3) pts1(:,1) pts1(:,2) ones(N,1) ]; - -% conditions initialisations -B = [pts2(:,1) ; pts2(:,2)]; - -% compute coefficients using least square -coefs = A\B; - -% format to a matrix -trans = [coefs(1:3)' ; coefs(4:6)'; 0 0 1]; Deleted: trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformEdge.m =================================================================== --- trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformEdge.m 2011-10-09 16:20:45 UTC (rev 8717) +++ trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformEdge.m 2011-10-09 17:01:50 UTC (rev 8718) @@ -1,75 +0,0 @@ -%% Copyright (c) 2011, INRA -%% 2007-2011, David Legland <dav...@gr...> -%% 2011 Adapted to Octave by Juan Pablo Carbajal <car...@if...> -%% -%% All rights reserved. -%% (simplified BSD License) -%% -%% Redistribution and use in source and binary forms, with or without -%% modification, are permitted provided that the following conditions are met: -%% -%% 1. Redistributions of source code must retain the above copyright notice, this -%% list of conditions and the following disclaimer. -%% -%% 2. Redistributions in binary form must reproduce the above copyright notice, -%% this list of conditions and the following disclaimer in the documentation -%% and/or other materials provided with the distribution. -%% -%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -%% POSSIBILITY OF SUCH DAMAGE. -%% -%% The views and conclusions contained in the software and documentation are -%% those of the authors and should not be interpreted as representing official -%% policies, either expressed or implied, of copyright holder. - - -function dest = transformEdge(edge, trans) -%TRANSFORMEDGE Transform an edge with an affine transform -% -% EDGE2 = transformEdge(EDGE1, TRANS); -% where EDGE1 has the form [x1 y1 x2 y1], and TRANS is a transformation -% matrix, return the edge transformed with affine transform TRANS. -% -% Format of TRANS can be one of : -% [a b] , [a b c] , or [a b c] -% [d e] [d e f] [d e f] -% [0 0 1] -% -% EDGE2 = transformEdge(EDGES, TRANS); -% Also wotk when EDGES is a [N*4] array of double. In this case, EDGE2 -% has the same size as EDGE. -% -% See also: -% edges2d, transforms2d, transformPoint, translation, rotation -% -% --------- -% author : David Legland -% INRA - TPV URPOI - BIA IMASTE -% created the 06/04/2004. -% - -% allocate memory -dest = zeros(size(edge)); - -% compute position -dest(:,1) = edge(:,1)*trans(1,1) + edge(:,2)*trans(1,2); -dest(:,2) = edge(:,1)*trans(2,1) + edge(:,2)*trans(2,2); -dest(:,3) = edge(:,3)*trans(1,1) + edge(:,3)*trans(1,2); -dest(:,4) = edge(:,4)*trans(2,1) + edge(:,4)*trans(2,2); - -% add translation vector, if exist -if size(trans, 2)>2 - dest(:,1) = dest(:,1)+trans(1,3); - dest(:,2) = dest(:,2)+trans(2,3); - dest(:,3) = dest(:,3)+trans(1,3); - dest(:,4) = dest(:,4)+trans(2,3); -end Deleted: trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformLine.m =================================================================== --- trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformLine.m 2011-10-09 16:20:45 UTC (rev 8717) +++ trunk/octave-forge/main/geometry/matGeom_raw/geom2d/transformLine.m 2011-10-09 17:01:50 UTC (rev 8718) @@ -1,73 +0,0 @@ -%% Copyright (c) 2011, INRA -%% 2007-2011, David Legland <dav...@gr...> -%% 2011 Adapted to Octave by Juan Pablo Carbajal <car...@if...> -%% -%% All rights reserved. -%% (simplified BSD License) -%% -%% Redistribution and use in source and binary forms, with or without -%% modification, are permitted provided that the following conditions are met: -%% -%% 1. Redistributions of source code must retain the above copyright notice, this -%% list of conditions and the following disclaimer. -%% -%% 2. Redistributions in binary form must reproduce the above copyright notice, -%% this list of conditions and the following disclaimer in the documentation -%% and/or other materials provided with the distribution. -%% -%% THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -%% AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -%% IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -%% ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -%% LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -%% CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -%% SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -%% INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -%% CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -%% ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -%% POSSIBILITY OF SUCH DAMAGE. -%% -%% The views and conclusions contained in the software and documentation are -%% those of the authors and should not be interpreted as representing official -%% policies, either expressed or implied, of copyright holder. - - -function dest = transformLine(line, trans) -%TRANSFORMLINE Transform a line with an affine transform -% -% LINE2 = transformLine(LINE1, TRANS); -% returns the line LINE1 transformed with affine transform TRANS. -% LINE1 has the form [x0 y0 dx dy], and TRANS is a transformation -% matrix. -% -% Format of TRANS can be one of : -% [a b] , [a b c] , or [a b c] -% [d e] [d e f] [d e f] -% [0 0 1] -% -% LINE2 = transformLine(LINES, TRANS); -% Also work when LINES is a [N*4] array of double. In this case, LINE2 -% has the same size as LINE. -% -% See also: -% lines2d, transforms2d, transformPoint -% -% --------- -% author : David Legland -% INRA - TPV URPOI - BIA IMASTE -% created the 06/04/2004. -% - -% HISTORY -% 02/03/2007: rewrite function - - -% isolate points -points1 = line(:, 1:2); -points2 = line(:, 1:2) + line(:, 3:4); - -% transform points -points1 = transformPoint(points1, trans); -points2 = transformPoint(points2, trans); - -dest = createLine(points1, points2); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |