コード例 #1
0
        public void Vector2DistanceTest2()
        {
            var a = new Vector2Fix16((Fix16)1.05, (Fix16)2.05);
            var b = new Vector2Fix16((Fix16)1.05, (Fix16)2.05);

            var actual = Vector2Fix16.Distance(a, b);

            Assert.That(actual, Is.EqualTo(Fix16.Zero));
        }
コード例 #2
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.");
        }