Example #1
0
        public void ReflectVelTest()
        {
            var segm = new BorderSegment(1, 1, 2, 2);
            var vel  = new Vector2D(10, 5);

            var reflectVel      = segm.ReflectVel(vel);
            var rightReflectVel = new Vector2D(5, 10);

            Assert.IsTrue(Vector2D.ApproxEqual(rightReflectVel, reflectVel, 0.0000001));
        }
Example #2
0
        public void ReflectPosTest1()
        {
            var segm = new BorderSegment(1, 1, 2, 2);
            var pos  = new Vector2D(10, 0);

            var reflectpos      = segm.ReflectPos(pos);
            var rightReflectPOs = new Vector2D(0, 10);

            Assert.IsTrue(Vector2D.ApproxEqual(rightReflectPOs, reflectpos, 0.0000001));
        }