one digit in hardcoded constant was off, change causes no actual difference when using single or double precision floats
}
else
{
- q = .19634954084936207740 * q;
- p = .19634954084936207740 * p - 1.57079632679489661922;
+ q = M_PI_16 * q;
+ p = M_PI_16 * p - M_PI_2;
out.x = cos(q) * cos(p);
out.y = sin(q) * cos(p);
out.z = -sin(p);
#define M_PI 3.14159265358979323846 /* pi */
const float M_PI_2 = 1.57079632679489661923; /* pi/2 */
const float M_PI_4 = 0.78539816339744830962; /* pi/4 */
+const float M_PI_16 = 0.19634954084936207740; /* pi/16 */
const float M_1_PI = 0.31830988618379067154; /* 1/pi */
const float M_2_PI = 0.63661977236758134308; /* 2/pi */
const float M_2_SQRTPI = 1.12837916709551257390; /* 2/sqrt(pi) */