Merge pull request #475 from jam3sward/issue-474

M_PI was not defined by <cmath>
This commit is contained in:
Syoyo Fujita 2024-03-20 21:11:56 +09:00 committed by GitHub
commit b132612307
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -788,8 +788,10 @@ static void QuatToAngleAxis(const std::vector<double> quaternion,
return;
}
constexpr double pi = 3.14159265358979323846;
double denom = sqrt(1-qw*qw);
outAngleDegrees = angleRadians * 180.0 / M_PI;
outAngleDegrees = angleRadians * 180.0 / pi;
axis[0] = qx / denom;
axis[1] = qy / denom;
axis[2] = qz / denom;