예제 #1
0
        public void Should_DegreeToRadian_Success_Result(int degree)
        {
            // Act
            double radianResult = DegreeToRadian.Get(degree);

            //Assert
            Assert.Equal(1.5707963267948966, radianResult);
        }
예제 #2
0
        /// <summary>
        /// This method calculates new position that is calculated with rover’s direction degree.
        /// The sin(y) and cos(x) methods operate in radians.
        ///
        /// Cos(x)-->x Type: Radian
        /// Sin(y)-->y Type: Radian
        /// </summary>
        private void Move()
        {
            var radian = DegreeToRadian.Get((int)RoverDirection);

            RoverPosition.XCoordinate += (int)Math.Round(Math.Cos(radian));
            RoverPosition.YCoordinate += (int)Math.Round(Math.Sin(radian));

            RoverPlateau.IsHasWithinBounds(RoverPosition);
        }