Angle vs vector formulation of position on a unit circle

63 Views Asked by At

I've worked on program/code with rotation and angles a bit and inevitably someone goes "oh the algorithm is spitting out 367 degrees, so wrap it to 7 degrees", and then a bunch of if statements have to be invoked to bring the answer to $[0, 2\pi)$.

An idea to avoid this is to not use angles and just use vectors with norm 1, and operate on them with the 2D rotation matrices. This formulation is more expensive and prone to numerical error because of trig functions though.

Given the above, I have the following questions:

1) Are the [0,2pi) and vector formulation identical? If so, why does one need a "wrap to 2pi" function and the other does not. Are there some properties in the world of group theory that one posses but the other doesn't?

2) I get the feeling that the $[0,2\pi)$ formulation has a "discontinuity" at $2\pi$ but the vector formulation does not. In other words, one feels more "smooth" than the other. Is there a formal definition of this difference (if there actually is one).

3) Is [0,2pi) even a group? From the definitions, it seems that it is if the operation "+" is defined with several conditions depending on $a\in [0,2\pi)$ and $b\in[0,2\pi)$ so that $c=a+b$ stays in the set $[0,2\pi)$.

1

There are 1 best solutions below

0
On BEST ANSWER

The two formulations are related by Euler's formula $e^{i\theta}=\cos \theta +i\sin \theta$ and the correspondence between complex numbers and $2 \times 2$ matrices $a+bi \leftrightarrow \begin {pmatrix} a&-b\\b&a \end {pmatrix}$. Since $e^{2\pi i}=1$ the wrapping is accomplished naturally. The angle version does not have a discontinuity at $2\pi$ if you define angle addition properly, which means $\bmod 2\pi .$ Unfortunately your computer probably doesn't have an operation of addition $\bmod 2\pi $ so you have to do the $\bmod 2\pi$ yourself. Yes, the reals $[0,2\pi )$ form a group with this operation.