Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[VECTORS] Rotation without trigonometry

Name: Anonymous 2010-07-03 9:31

How is it done?
Normally, rotating a vector A(x1, y1) through t radians in order to get vector B(x2, y2) is done with
x2 = x1*cos(t) - y1*sin(t),
y2 = x1*sin(t) + y1*cos(t).

But trigonometry is expensive, especially without an FPU, so there must be another way.
I was thinking of something similar to Bresenham's circle algorithm, or perhaps reflecting the vector about the origin or something.

So, uh, how would you do it?

Name: Anonymous 2010-07-05 5:07

>>34
And yet he didn't mention what platform he's working on.

Given the context of the question, the only thing I can guess is that he's working on Android. He knows some devices don't have FPUs, and he thinks his game will be so awesome that softfloats won't cut it for him.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List