public void Exp4() { float θ = 0.0f; Vector3F v = new Vector3F(1.0f, 2.0f, 3.0f); v.Normalize(); QuaternionF q = new QuaternionF(0.0f, θ * v); q.Exp(); Assert.IsTrue(Numeric.AreEqual(1, q.W)); Assert.IsTrue(Vector3F.AreNumericallyEqual(Vector3F.Zero, q.V)); }
public void Exp2() { float θ = -0.3f; Vector3F v = new Vector3F(1.0f, 2.0f, 3.0f); v.Normalize(); QuaternionF q = new QuaternionF(0.0f, θ * v); q.Exp(); Assert.IsTrue(Numeric.AreEqual((float)Math.Cos(θ), q.W)); Assert.IsTrue(Vector3F.AreNumericallyEqual((float)Math.Sin(θ) * v, q.V)); }