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

            //Assert
            Assert.Equal(1.5707963267948966, radianResult);
        }
Example #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);
        }
Example #3
0
 canvas.DrawingSession.Transform = Matrix3x2.CreateRotation(DegreeToRadian(rotation), new Point(rect.X + rect.Width / 2, rect.Y + rect.Height / 2).ToVector2());