Skip to content

Commit

Permalink
Replace non-portable M_PI with constants::pi()
Browse files Browse the repository at this point in the history
  • Loading branch information
traversaro authored Nov 13, 2021
1 parent df2702c commit e3f8707
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/geometry/shape/test_convex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,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 @@ -790,7 +790,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

0 comments on commit e3f8707

Please sign in to comment.