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-03 16:39

>>19
See >>4.

>>18
Hm, what I meant was that I'm quite interested in what lattice points are and how you'd do arithmetic using continued fractions; however, I'm not interested enough to research myself (as I'm quite busy at the moment) and it would be absolutely terrific if I could read a post written by a fellow /prog/rider on this matter. My reaction in >>17 was due to my disappointment that you would refuse my polite request (>>14); however you do have the right to do so and what I said in >>17 was quite ungentlemanly, for which I'm sorry.

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