Least Square Coordinate Transformation in 2D

Cartesian Coordinate Transformation 2D Similarity,Affine,Projective
379 Downloads
Updated 3 Jun 2021

View License

Least Square Cartesian Coordinates Transformation between two Cartesian Coordinates
Systems in 2D ( Similarity,Affine,Projective)
function [Y2N,X2N]=CartCoord_Transformation2D(YX,YX_new,Type)
% Sample application data
% 5 control points+ 2 New point to be transformed
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Nr Y1 X1 Y2 X2
% YX=[248 9043.7400 5208.7900 4618.7200 4068.8300
% 257 9218.4200 4833.4900 5579.4100 1115.6000
% 253 9000.0000 5000.0000 4103.9800 2553.3800
% 124 9220.0200 5166.9100 5893.3800 3597.0300
% 125 9242.7000 5039.3800 5946.7000 2626.7000 ];
% Nr Y1 X 1
% YX_new=[ 251 9106.1700 5050.7100
% 289 9066.8600 4878.0900 ];
Nr=YX(:,1);Y1=YX(:,2);X1=YX(:,3);Y2=YX(:,4);X2=YX(:,5);
NrN=YX_new(:,1);Y1N=YX_new(:,2);X1N=YX_new(:,3);
%INPUT
%
% YX % Control points coordinates [Point Y1 X1 Y2 X2]
% YX_new % New points coordinates(to be transformed) [Point_new Y1_new X1_new ]
%
% Y1,X1 : I.system cartesian coordinates
% Y2,X2 : II.system cartesian coordinates
% Type:Type of trasformation methods
% Type=1 SIMILARITY trasformation; number of Control point must be(n)>=2
% Type=2 AFFINE trasformation ; number of Control point must be(n)>=3
% Type=3 PROJECTIVE trasformation; number of Control point must be(n)>=4
%
%OUTPUT
%
% Y2N(m),X2N(m) : Calculated coordinates on II.system
How to cite:
BEKTAS, S.(2005) "Dengeleme Hesabı", Ondokuz Mayis University Press,ISBN 975-
7636-54-1

Cite As

Sebahattin Bektas (2024). Least Square Coordinate Transformation in 2D (https://www.mathworks.com/matlabcentral/fileexchange/48996-least-square-coordinate-transformation-in-2d), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.3.1.1

tagg added

1.3.1.0

data entry corrected

1.3.0.0

update

1.2.0.0

explain

1.1.0.0

explain

1.0.0.0