Out of interest, why the percentage hate?
If something goes up by 10% one day and by 10% the next day, what percentage did it go up in total? The formula is 100 * ((1 + 10/100) * (1 + 10/100) - 1) = 21. See all those multiplications and divisions by 100? They are an indication that you are not using the natural units.
Now let's encode "goes up by 10%" as "is multiplied by 1.1" instead. If something is multiplied by 1.1 one day and by 1.1 the next day, what was it multiplied by in total? The formula is 1.1 * 1.1 = 1.21.
Or the counting from 1.
I'll let Dijkstra answer:
http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.htmlWouldn't complex numbers just hinder performance?
Au contraire! Complex numbers do take twice as much memory as a single angle, but when was the last time you were filling up your memory with angles? When it comes to applying a rotation to a vector, the angle-centric code goes like this:
Vector2 apply_rotation(Vector2 v, float alpha) {
float s = sin(alpha), c = cos(alpha);
return Vector2(c * v.x - s * v.y, s * v.x + c * v.y);
}
With complex numbers it looks like this:
Complex apply_rotation(Complex v, Complex rotation) {
return v * rotation; // This is actually four multiplications, a subtraction and an addition. Look ma, no trig!
}
If you store your rotations as complex numbers, the cosine and sine are already computed. You can write all sorts of things without ever calling a trigonometric function, and those are at least an order of magnitude more expensive than multiplications and additions.