Monday, 9 September 2019

trigonometry - Does atan2(mean sine, mean cosine) approximate the mean angle?



I need to find an approximation for the sine and cosine of a rotation angle ˉθ such that:



ˉθ=1nni=1θi



I know each si=sin(θi) and ci=cos(θi)




But I want to do it without using arcsin(θi) or arccos(θi)






My current approach is to get the mean sines and cosines; and normalize them:



sin(˜θ)=1αnsi



cos(˜θ)=1αnci




choose α such that



sin(˜θ)2+cos(˜θ)2=1






If I am not mistaken, what I get from this is



˜θ=atan2(1nsi,1nci)




I want to know if this actually approximates ˉθ for any set of values θi






What I have tried



For the particular case where i;θi]π2,π2[



i;cos(θi)>0




tan(˜θ)=AB;B>0



By adding a new θk we have



tan(˜θ)=A+1nskB+1nck=nA+sknB+ck



skck=ABskck=tan(˜θ)=AB



skck>ABskck>tan(˜θ)>AB




skck<ABskck<tan(˜θ)<AB



So if every angle is between 90o and 90o my approximation give a consistent result. (I think it works as well for angles between 90o and 270o)



But how about the general case? When we can not assume the signs of sin(θi) and cos(θi)? And when the tangent function is not monotonic?


Answer



I think you got it. To get an average angle, do not do 1nniθi but use the atan2() function with the average sine and cosine.



This is equivalent to take a scatter plot of points, finding their "center of mass" (or barycenter) and drawing an angle from the origin to the COM.




pic



˜θ=atan2(niyi,nixi)



In the extreme case that ˜x0 and ˜y0 that average angle is going to have lots of uncertainty associated with it. This is because the scatter of points is near the origin and the location angle isn't well defined.


No comments:

Post a Comment

real analysis - How to find limhrightarrow0fracsin(ha)h

How to find lim without lhopital rule? I know when I use lhopital I easy get $$ \lim_{h\rightarrow 0}...