예제 #1
0
        public void Vector2DistanceTest()
        {
            var a = new Vector2Fix16(Fix16.One, (Fix16)2);
            var b = new Vector2Fix16((Fix16)3, (Fix16)4);

            var expected = Fix16.Sqrt((Fix16)8);
            var actual   = Vector2Fix16.Distance(a, b);

            Assert.That(actual, Is.EqualTo(expected), "Vector2Fix16.Distance did not return the expected value.");
        }
예제 #2
0
 public Fix16 Length() =>
 Fix16.Sqrt(Dot(this, this));
예제 #3
0
 public static Vector3Fix16 SquareRoot(Vector3Fix16 value) =>
 new Vector3Fix16(Fix16.Sqrt(value.X), Fix16.Sqrt(value.Y), Fix16.Sqrt(value.Z));