public void QuaternionNormalizeTest1() { Quaternion a = new Quaternion(0.0f, 0.0f, -0.0f, 0.0f); Quaternion actual = Quaternion.Normalize(a); Assert.True(Single.IsNaN(actual.X) && Single.IsNaN(actual.Y) && Single.IsNaN(actual.Z) && Single.IsNaN(actual.W) , $"Quaternion.Normalize did not return the expected value: expected {new Quaternion(Single.NaN, Single.NaN, Single.NaN, Single.NaN)} actual {actual}"); }
public void QuaternionNormalizeTest() { Quaternion a = new Quaternion(1.0f, 2.0f, 3.0f, 4.0f); Quaternion expected = new Quaternion(0.182574168f, 0.365148336f, 0.5477225f, 0.7302967f); Quaternion actual; actual = Quaternion.Normalize(a); Assert.True(MathHelper.Equal(expected, actual), $"Quaternion.Normalize did not return the expected value: expected {expected} actual {actual}"); }