Example #1
0
        public void Calculate_SetsCartesianCoordinates_CaseTwoCounterClockwise()
        {
            // Arrange
            IEnumerable <CartesianCoordinates> expected = CreateCoordinatesCaseTwoCounterClockwise();

            var coordinatesZeroZeroOne = new CartesianCoordinates
            {
                X = 0.0,
                Y = 0.0,
                Z = -1.0
            };

            var coordinatesOneZeroZero = new CartesianCoordinates
            {
                X = 0.0,
                Y = 0.0,
                Z = 1.0
            };

            m_Sut.FromCoordinates = coordinatesZeroZeroOne;
            m_Sut.ToCoordinates   = coordinatesOneZeroZero;
            m_Sut.TurnDirection   = Constants.TurnDirection.Counterclockwise;
            m_Sut.Steps           = 3;

            // Act
            m_Sut.Calculate();

            // Assert
            CartesianCoordinatesHelper.AssertSphericalCoordinates(expected,
                                                                  m_Sut.CartesianCoordinates);
        }
Example #2
0
        public void Calculate_SetsCartesianCoordinates_CaseFourCounterCounterClockwise()
        {
            // Arrange
            IEnumerable <CartesianCoordinates> expected = CreateCoordinatesCaseFourCounterClockwise();

            var circle = new Circle(0.0,
                                    0.0,
                                    1.0);
            Point from = circle.PointOnCircle(Angle.For315Degrees);
            Point to   = circle.PointOnCircle(Angle.For45Degrees);

            var coordinatesZeroZeroOne = new CartesianCoordinates
            {
                X = from.X,
                Y = from.Y,
                Z = 0.0
            };

            var coordinatesOneZeroZero = new CartesianCoordinates
            {
                X = to.X,
                Y = to.Y,
                Z = 0.0
            };

            m_Sut.FromCoordinates = coordinatesZeroZeroOne;
            m_Sut.ToCoordinates   = coordinatesOneZeroZero;
            m_Sut.TurnDirection   = Constants.TurnDirection.Counterclockwise;
            m_Sut.Steps           = 3;

            // Act
            m_Sut.Calculate();

            // Assert
            CartesianCoordinatesHelper.AssertSphericalCoordinates(expected,
                                                                  m_Sut.CartesianCoordinates);
        }