Skip to content

Commit

Permalink
Pi とするべき部分が TwoPi になっていたのを修正
Browse files Browse the repository at this point in the history
  • Loading branch information
sashi0034 committed Nov 10, 2024
1 parent 23bc0b4 commit 71f5819
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Siv3D/include/Siv3D/detail/Math.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -1362,22 +1362,22 @@ namespace s3d

inline float ClampAngle(const float angle, const float min, float max) noexcept
{
const auto start = (min + max) * 0.5f - TwoPiF;
const auto start = (min + max) * 0.5f - PiF;
const auto floor = Floor((angle - start) / TwoPiF) * TwoPiF;
return Clamp(angle, min + floor, max + floor);
}

inline double ClampAngle(const double angle, const double min, double max) noexcept
{
const auto start = (min + max) * 0.5 - TwoPi;
const auto start = (min + max) * 0.5 - Pi;
const auto floor = Floor((angle - start) / TwoPi) * TwoPi;
return Clamp(angle, min + floor, max + floor);
}

SIV3D_CONCEPT_ARITHMETIC_
inline double ClampAngle(Arithmetic angle, Arithmetic min, Arithmetic max) noexcept
{
const auto start = (min + max) * 0.5 - TwoPi;
const auto start = (min + max) * 0.5 - Pi;
const auto floor = Floor((angle - start) / TwoPi) * TwoPi;
return Clamp(angle, min + floor, max + floor);
}
Expand Down

0 comments on commit 71f5819

Please sign in to comment.