http://bugs.freedesktop.org/show_bug.cgi?id=10783
------- Comment #2 from [EMAIL PROTECTED] 2007-04-30 16:05 PST -------
I did a bit of research on the net, and I think asin, acos, and atan can be
approcimated pretty easilly. This should make the GLSL to
GL_ARB_{fragment,vertex}_program conversion pretty simple:
asin(x) = pi/2 - sqrt(1 - x)(a0 + a1*x + a2*x^2 + a3*x^3)
acos(x) = sqrt(1 - x)(a0 + a1*x + a2*x^2 + a3*x^3)
where
a0 = 1.5707288
a1 = -0.2121144
a2 = 0.0742610
a3 = -0.0187293
atan(y, x) = s * ( pi/4 - (pi / 4) * ((x - |y|) / (x + |y|))) for x >= 0
s * (3pi/4 - (pi / 4) * ((x + |y|) / (|y| - x))) for x < 0
where
s = -1 for y < 0
s = 1 otherwise
References:
http://mathforum.org/library/drmath/view/54137.html
http://dspguru.com/comp.dsp/tricks/alg/fxdatan2.htm
http://en.wikipedia.org/wiki/Arcsin#Recommended_method_of_calculation
--
Configure bugmail: http://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Mesa3d-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev