dxflibライブラリを使用して DXF パーサーを開発しています。楕円の解析に問題があります。
楕円を解析すると、次のデータを受け取ります。
struct DL_EllipseData
{
/*! X Coordinate of center point. */
double cx;
/*! Y Coordinate of center point. */
double cy;
/*! X coordinate of the endpoint of the major axis. */
double mx;
/*! Y coordinate of the endpoint of the major axis. */
double my;
/*! Ratio of minor axis to major axis. */
double ratio;
};
次の式を使用して角度を計算しようとしています。
auto angle = std::atan2(ellipse.my, ellipse.mx);
しかし、それは間違った結果をもたらします (たとえば、角度が 16 度の場合、約 74 度になります)。
回転角度を正しく計算するにはどうすればよいですか?