Logo Search packages:      
Sourcecode: ktechlab version File versions

void PositionInfo::rotateAboutPoint ( double  x,
double  y,
double  angle 

Rotates the current position about the given point through the given angle in radians anticlockwise. This will change the position and orientation.

Definition at line 382 of file mechanicsitem.cpp.

Referenced by operator+().

      m_angle += angle;
      double newx = x + (m_x-x)*std::cos(angle) - (m_y-y)*std::sin(angle);
      double newy = y + (m_x-x)*std::sin(angle) + (m_y-y)*std::cos(angle);
      m_x = newx;
      m_y = newy;

Generated by  Doxygen 1.6.0   Back to index