% Get angle between two 2D lines angle = sugr_angle_Line_2D(l,m) * l, m 2D line, struct {l.h,l.Crr} * angle.a = angle between lines, from l to m in [0,2*pi)% .sa = standard deviation angle negativ if one line is infinte% .dof = degrees of freedom = 1 Wolfgang Förstner 2/2011 wfoerstn@uni-bonn.de See also sugr_Line_2D
0001 %% Get angle between two 2D lines 0002 % 0003 % angle = sugr_angle_Line_2D(l,m) 0004 % 0005 % * l, m 2D line, struct {l.h,l.Crr} 0006 % 0007 % * angle.a = angle between lines, from l to m in [0,2*pi)% 0008 % .sa = standard deviation angle negativ if one line is infinte% 0009 % .dof = degrees of freedom = 1 0010 % 0011 % Wolfgang Förstner 2/2011 0012 % wfoerstn@uni-bonn.de 0013 % 0014 % See also sugr_Line_2D 0015 0016 function angle = sugr_angle_Line_2D(l,m) 0017 0018 0019 if sugr_get_isfinite_Line_2D(l) && sugr_get_isfinite_Line_2D(m) 0020 0021 % Hessean parameters of l and m 0022 [le, Clee] = sugr_get_Euclidean_Line_2D(l); 0023 [me, Cmee] = sugr_get_Euclidean_Line_2D(m); 0024 0025 % angle and standard deviation 0026 angle.a = mod(me(1) - le(1),2*pi); 0027 angle.sa = sqrt(Clee(1,1) + Cmee(1,1)); 0028 0029 else % one line at infinity 0030 angle.a = 0; 0031 angle.sa = -1; 0032 end 0033 angle.dof = 1; 0034 0035 0036 0037 0038 0039 0040