Home > General-Functions > SUGR > Point_2D > sugr_construct_mean_Point_2D.m

sugr_construct_mean_Point_2D

PURPOSE ^

sugr_construct_mean_Point_2D: mid point of two 2D points

SYNOPSIS ^

function Point_2D = sugr_construct_mean_Point_2D(x,y)

DESCRIPTION ^

 sugr_construct_mean_Point_2D: mid point of two 2D points

 m = sugr_construct_mean_Point_2D(x,y)

 Wolfgang Förstner 7/2014
 wfoerstn@uni-bonn.de

 See also sugr_Point_2D, sugr_get_isfinite_Point_2D, sugr_Line_2D,
 sugr_construct_midpoint_Point_2D, sugr_construct_intersection_Point_2D,
 sugr_construct_footpoint_Ol_Point_2D, sugr_construct_footpoint_xl_Point_2D

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 % sugr_construct_mean_Point_2D: mid point of two 2D points
0002 %
0003 % m = sugr_construct_mean_Point_2D(x,y)
0004 %
0005 % Wolfgang Förstner 7/2014
0006 % wfoerstn@uni-bonn.de
0007 %
0008 % See also sugr_Point_2D, sugr_get_isfinite_Point_2D, sugr_Line_2D,
0009 % sugr_construct_midpoint_Point_2D, sugr_construct_intersection_Point_2D,
0010 % sugr_construct_footpoint_Ol_Point_2D, sugr_construct_footpoint_xl_Point_2D
0011 
0012 function Point_2D = sugr_construct_mean_Point_2D(x,y)
0013 
0014 % use mid point as approximate value
0015 xa = sugr_construct_midpoint_Point_2D(x,y);
0016 
0017 % use tangent space
0018 J = null(xa.h');
0019 
0020 % reduced coordinates
0021 xr = J'*x.h;
0022 yr = J'*y.h;
0023 Jx = J'*calc_Rot_ab(x.h,xa.h)*null(x.h');
0024 Jy = J'*calc_Rot_ab(y.h,xa.h)*null(y.h');
0025 Wxx = inv(Jx*x.Crr*Jx');
0026 Wyy = inv(Jy*y.Crr*Jy');
0027 
0028 % mean in tangent space
0029 Cmrmr = inv(Wxx+Wyy);
0030 xmr   = Cmrmr*(Wxx*xr+Wyy*yr);                                             %#ok<*MINV>
0031 
0032 % go to homogeneous coordinates
0033 Cmm = J * Cmrmr * J';                            
0034 xm = xa.h + J*xmr;
0035 xm = xm/norm(xm); 
0036 
0037 % generate reduced parameters
0038 Point_2D = sugr_Point_2D(xm,Cmm);

Generated on Sat 21-Jul-2018 20:56:10 by m2html © 2005