39. Rotate Marker
// double x, y the point before rotate;
// double dx, dy the base point rotate around;
// double angle roate angle in degree;
// double xO, yO the point after rotate;
void RotateMarker(double x, double y, double dx, double dy, double angle, double& xO, double& yO)
{
double dRad = angle*PI / 180.0;
double dCos = cos(dRad);
double dSin = sin(dRad);
xO = x*dCos - y*dSin + (1 - dCos)*dx + dSin*dy;
yO = x*dSin + y*dCos + (1 - dCos)*dy - dSin*dx;
}