public void GivenAngle_WhenCreateRotateZRotationMatrix_ThenRotationsAreSet() { var angle = fixture.Create <double>(); var result = RotationMatrixFactory.CreateZAxisRotation(angle); Assert.That(result[0, 0], Is.EqualTo(Math.Cos(angle))); Assert.That(result[0, 1], Is.EqualTo(Math.Sin(angle))); Assert.That(result[0, 2], Is.EqualTo(0)); Assert.That(result[0, 3], Is.EqualTo(0)); Assert.That(result[1, 0], Is.EqualTo(-Math.Sin(angle))); Assert.That(result[1, 1], Is.EqualTo(Math.Cos(angle))); Assert.That(result[1, 2], Is.EqualTo(0)); Assert.That(result[1, 3], Is.EqualTo(0)); Assert.That(result[2, 0], Is.EqualTo(0)); Assert.That(result[2, 1], Is.EqualTo(0)); Assert.That(result[2, 2], Is.EqualTo(1)); 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)); }
public override double[,] CreateMatrix(double angle) { return(RotationMatrixFactory.CreateZAxisRotation(angle)); }