% Construct midline of two 2D points x and y Line_2D = sugr_construct_midline_Line_2D(x,y)
0001 %% Construct midline of two 2D points x and y 0002 % 0003 % Line_2D = sugr_construct_midline_Line_2D(x,y) 0004 0005 % * x,y = 2D points, struct {x.h,x.Crr} 0006 % * Line_2D = 2D line, struct {l.h,l.Crr} 0007 % 0008 % Wolfgang Förstner 1/2011 0009 % wfoerstn@uni-bonn.de 0010 % 0011 % See also sugr_Line_2D, sugr_construct_parallel_lx_Line_2D, 0012 % sugr_construct_parallel_lO_Line_2D, sugr_construct_footpoint_Ol_Point_2D, 0013 % sugr_construct_footpoint_xl_Point_2D, sugr_construct_join_Line_2D, 0014 % sugr_construct_join_Line_3D 0015 0016 function Line_2D = sugr_construct_midline_Line_2D(x,y) 0017 0018 G3 = diag([1,1,0]); 0019 z = calc_CentralMatrix(x.h)*y.h; 0020 l = calc_S(x.h)*y.h; 0021 A = -calc_S(G3 * l) * calc_CentralMatrix(y.h) ... 0022 -calc_S(z) * G3 * calc_S(y.h); 0023 B = -calc_S(G3 * l) * calc_CentralMatrix(x.h) ... 0024 +calc_S(z) * G3 * calc_S(x.h); 0025 h = +calc_S(z) * G3 * calc_S(x.h) * y.h; 0026 Cxhh = sugr_get_CovM_homogeneous_Vector(x); 0027 Cyhh = sugr_get_CovM_homogeneous_Vector(y); 0028 Chh = A * Cxhh * A' + B * Cyhh * B'; 0029 0030 0031 % generate line 0032 Line_2D = sugr_Line_2D(h,Chh);