Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace non-portable M_PI with constants::pi() #553

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
## FCL 0

### FCL 0.y.z (YYYY-MM-DD)

* Math

* Replace M_PI instance with constants::pi():
[#553](https://github.com/flexible-collision-library/fcl/pull/553)


### FCL 0.7.0 (2021-09-09)

* Breaking changes
Expand Down
4 changes: 2 additions & 2 deletions test/geometry/shape/test_convex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ class TessellatedSphere final : public Polytope<double> {
public:
TessellatedSphere() : Polytope<double>(1.0) {
// The angle between the latitude lines measured along the prime meridian.
const double dphi = M_PI / 8;
const double dphi = constants<double>::pi() / 8;
auto slice_height = [dphi](int slice_index) {
// Assumes 1 <= slice_index < 8.
return std::cos(slice_index * dphi);
Expand All @@ -791,7 +791,7 @@ class TessellatedSphere final : public Polytope<double> {
vertices_->push_back({0, 0, 1});
// Now create the bands of vertices between slices 1 & 2, 2 & 3, etc.
// The angle between the longitude lines measured along the equator.
const double dtheta = 2 * M_PI / 8;
const double dtheta = 2 * constants<double>::pi() / 8;
for (int slice = 1; slice < 8; ++slice) {
double z = slice_height(slice);
double r = slice_radius(slice);
Expand Down
Loading