Exemplo n.º 1
0
        public void AngleTestBelow()
        {
            TrackerMatrix target = new TrackerMatrix(); // TODO: Initialize to an appropriate value
            float         angle  = -10F;                // TODO: Initialize to an appropriate value

            target.rotate(angle);
            Assert.AreEqual(target.getAngle(), 350F);
        }
Exemplo n.º 2
0
        public void rotatedBoxTest()
        {
            TrackerMatrix target   = new TrackerMatrix(); // TODO: Initialize to an appropriate value
            float         angle    = 90F;                 // TODO: Initialize to an appropriate value
            float         distance = 100F;

            target.rotate(45F);
            target.goForward(distance);
            target.rotate(angle);
            target.goForward(distance);
            target.rotate(angle);
            Assert.IsTrue(withinTolerance(target.getX(), -(float)Math.Sqrt(Math.Pow(100, 2) * 2), .001F));
            Assert.IsTrue(withinTolerance(target.getY(), 0F, .001F));
            target.goForward(distance);
            target.rotate(angle);
            target.goForward(distance);
            target.rotate(angle);
            Assert.AreEqual(45, target.getAngle());
        }