=" < CoordRO <
<<"Fi =" < CoordFi <
<<"~ Point." <
}
} Point :: RotatePoint (Point & Second, double Angle, int j)
{, CrdY, X, Y;, CoordY; (& CoordX, & CoordY);. ConvertToXY (& X, & Y); = X + (CoordX - X) * cos (Angle) - (CoordY - Y) * sin (Angle); = Y + (CoordX - X) * sin (Angle) + (CoordY - Y) * cos (Angle); (CrdX, CrdY);
} Point :: ConvertToXY (double * CoordX, double * CoordY)
{
* CoordX = CoordRO * cos (CoordFi);
* CoordY = CoordRO * sin (CoordFi);
} Point :: ConvertToRF (double CoordX, double CoordY)
{= sqrt (pow (CoordX, 2) + pow (CoordY, 2)); (CoordX> 0)
{(CoordY> = 0) = atan (CoordY/CoordX); = atan (CoordY/CoordX) + 2 * M_PI;
} (CoordX <0) = atan (CoordY/CoordX) + M_PI; (CoordY> 0) = M_PI/2; (CoordY <0) = 3 * M_PI/2; = 0;
} Point :: GetCoordRO () const
{<<"The radial coordinate of the point - RO:" <
} Point :: GetCoordFi () const
{<<"The angular coordinate of a point in radians - Fi:" <
} Point :: SetCoord (char ch)
{
charstr [2];// Вводитимемо макс. один символ для перевірки наявності зайвого
double work = NULL; (ch)
{'P':
{= NULL, CoordY = NULL; (; ;)
{<
{(" n>> Only digits and only one number allowed! << n"); (); (num == 0) ("% * [^ n] ");
};// З for (; ;)
} (; ;)
{<
{(" n>> Only digits and only one number allowed! << n"); (); (num == 0) ("% * [^ n] ");
};
}> ConvertToRF (CoordX, CoordY); 0;
} 'F':
{(; ;)
{(); <<"Enter the angular coordinate of a point" <<
"(in radians) - Fi:"; = scanf ("% lf" "% 1 [^ n]" "% * [^ n]" , & work, str); (num! = 1)
{(" n>> Only digits and only one number allowed! << n"); (); (num == 0) ("% * [^ n] ");
} (work <0 | | work> 2 * M_PI)
{<> Radial coordinate of the point must be" <<
"be greate...