public Vec3f ToEuler() { float phi = FMath.Atan2(2.0f * (x * y + z * w), 1.0f - 2.0f * (y * y + z * z)); float theta = FMath.Asin(2.0f * (x * z - w * y)); float psi = FMath.Atan2(2.0f * (x * w + y * z), 1.0f - 2.0f * (z * z + w * w)); return(new Vec3f(phi, theta, psi)); }
public void TestAsin() { var a = Fixed.FromFloat(0.54646f); var r = Fixed.FromFloat(0.578131f); AssertApproximately(r, FMath.Asin(a)); a = Fixed.FromFloat(-0.154787f); r = Fixed.FromFloat(-0.155411851f); AssertApproximately(r, FMath.Asin(a)); }