Skip to content

Commit

Permalink
Update Geometry.ipp
Browse files Browse the repository at this point in the history
コメントに合わせ「許容誤差以下」であれば円に含まれていると判定するように修正。
  • Loading branch information
Appbird committed Nov 17, 2024
1 parent 4ebe090 commit 2788a0c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Siv3D/include/Siv3D/detail/Geometry2D.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace s3d
/// @brief 点 p が円 c に含まれているかを判定します。
/// @param c 円
/// @param p 点
/// @param tolerance 許容誤差(相対誤差または絶対誤差のいずれかが許容誤差内であれば許容
/// @param tolerance 許容誤差(相対誤差または絶対誤差のいずれかが許容誤差以下であれば許容
/// @return 点 p が円 c に含まれている場合 true, それ以外の場合は false
[[nodiscard]]
inline bool Contains(const Circle& c, const Vec2& p, const double tolerance = 1e-8)
Expand All @@ -55,10 +55,10 @@ namespace s3d

if (rSquared == 0)
{
return (err < tolerance);
return (err <= tolerance);
}

return (((err / rSquared) < tolerance) || (err < tolerance));
return (((err / rSquared) <= tolerance) || (err <= tolerance));
}

//
Expand Down

0 comments on commit 2788a0c

Please sign in to comment.