Re: [Algorithms] SQRT vs. SIN and COS
Brought to you by:
vexxed72
|
From: Alex M. <Am...@Bw...> - 2000-12-20 17:02:00
|
P.S. I realize that y/d and x/d is an identity for cos and sin, I am =
more interested in whether or not this is used in hand optimizing matrix =
routines rather than the infamous FCOS and FSIN
----- Original Message -----=20
From: Alex Morano=20
To: gda...@li...=20
Sent: Wednesday, December 20, 2000 11:48 AM
Subject: [Algorithms] SQRT vs. SIN and COS
I was wondering if anyone has run across this method of dealing =
with affine transformations, just found it, in of all things, a VB WIN =
API graphics programming book (don't ask), they use the following idea:
Instead of the regular=20
=20
C S 0 0
-S C 0 0
0 0 1 0
0 0 0 1
for rotation about the Z axis, they make it a 2-dimensional =
transformation:
Distance of X and Y (d) =3D Sqrt(X ^ 2 + Y ^ 2)
x/d -y/d 0 0
y/d x/d 0 0
0 0 1 0
0 0 0 1
Now, I tried some quick benchmarks, changed the divs into =
multiplies (1/d) and sure enough, I get a 16% increase on my =
transformations. And the accuracy is exactly the same. Is this =
something I have missed that is a known trick, or is it an accepted algo =
to use the cos/sin, or even lookup tables? My only gripe about lookups =
is that they can never be accurate enough without the sarifice of a huge =
swat of memory.
So I am curious if this is a used standard?
=20
|