Пример #1
0
        public void GivenAngle_WhenCreateRotateYRotationMatrix_ThenRotationsAreSet()
        {
            var angle  = fixture.Create <double>();
            var result = RotationMatrixFactory.CreateYAxisRotation(angle);

            Assert.That(result[0, 0], Is.EqualTo(1));
            Assert.That(result[0, 1], Is.EqualTo(0));
            Assert.That(result[0, 2], Is.EqualTo(0));
            Assert.That(result[0, 3], Is.EqualTo(0));
            Assert.That(result[1, 0], Is.EqualTo(0));
            Assert.That(result[1, 1], Is.EqualTo(Math.Cos(angle)));
            Assert.That(result[1, 2], Is.EqualTo(Math.Sin(angle)));
            Assert.That(result[1, 3], Is.EqualTo(0));
            Assert.That(result[2, 0], Is.EqualTo(0));
            Assert.That(result[2, 1], Is.EqualTo(-Math.Sin(angle)));
            Assert.That(result[2, 2], Is.EqualTo(Math.Cos(angle)));
            Assert.That(result[2, 3], Is.EqualTo(0));
            Assert.That(result[3, 0], Is.EqualTo(0));
            Assert.That(result[3, 1], Is.EqualTo(0));
            Assert.That(result[3, 2], Is.EqualTo(0));
            Assert.That(result[3, 3], Is.EqualTo(1));
        }
Пример #2
0
 public override double[,] CreateMatrix(double angle)
 {
     return(RotationMatrixFactory.CreateYAxisRotation(angle));
 }