|
|
|
|
|
by jacobolus
1359 days ago
|
|
At a high level you should be expressing something like one of "turn this by the angle between vector (1,0) and vector (1, 1)"; "point this in the direction of vector (1, 1)"; or "turn this by the square root of the rotation i" (i = a quarter turn). If you use angle measures (of whatever units), when you say "rotate by an eighth of a turn" you are instead going to end up with something internally like: multiply some vector by the matrix [cos ¼π, –sin ¼π ; sin ¼π, cos ¼π] which is ultimately the same arithmetic, except you had to compute more intermediate transcendental functions to get there. If you just have to do this a few times, angle measures (in degrees or whatever) are a convenient human interface because most people are very familiar with it from high school. You can have your code ingest the occasional angle measure and turn it into a vector-relevant internal representation immediately. P.S. If you write 1/√2 in your code compilers are smart enough to turn that into a floating point number at compile time. :-) |
|