Skip to content
Open
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
7 changes: 3 additions & 4 deletions olcUTIL_Geometry2D.h
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@
#include <optional>
#include <cassert>
#include <array>
#include <numbers>

#ifndef OLC_V2D_TYPE
#define OLC_V2D_TYPE
Expand Down Expand Up @@ -507,8 +508,6 @@ namespace olc

namespace olc::utils::geom2d
{
// Lemon Meringue
inline const double pi = 3.141592653589793238462643383279502884;

// Floating point error margin
inline const double epsilon = 0.001;
Expand Down Expand Up @@ -718,13 +717,13 @@ namespace olc::utils::geom2d
// Get area of circle
inline constexpr T area() const
{
return T(pi) * radius * radius;
return std::numbers::pi_v<T> * radius * radius;
}

// Get circumference of circle
inline constexpr T perimeter() const
{
return T(2.0 * pi) * radius;
return T(2.0) * std::numbers::pi_v<T> * radius;
}

// Get circumference of circle
Expand Down