예제 #1
0
        // Gives the orientation
        public double orientation(double d)
        {
            AngleWrapper angle = new AngleWrapper(startAngle());

            // Calculates the absolute angle
            angle += (m_driveRight == m_reverse)
                ? d / m_radius
                : -d / m_radius;
            // If in a left curve the orientation is perpencicular to the left and the other way around
            if (m_reverse)
            {
                return(angle.perpendicularRight().radian());
            }
            else
            {
                return(angle.perpendicularLeft().radian());
            }
        }
예제 #2
0
 // Gives the orientation
 public double orientation(double d)
 {
     AngleWrapper angle = new AngleWrapper(startAngle());
     // Calculates the absolute angle
     angle += (m_driveRight == m_reverse)
         ? d / m_radius
         : -d / m_radius;
     // If in a left curve the orientation is perpencicular to the left and the other way around
     if (m_reverse)
         return angle.perpendicularRight().radian();
     else
         return angle.perpendicularLeft().radian();
 }