From 1aadefa07713c1219998a7b509565409e29244a3 Mon Sep 17 00:00:00 2001 From: Danny Joyce Date: Sun, 11 Feb 2024 14:07:12 -0500 Subject: [PATCH] Compare squared distance against squared radius in Circle Contains point method. (#1936) --- src/Maths/Silk.NET.Maths/Circle.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Maths/Silk.NET.Maths/Circle.cs b/src/Maths/Silk.NET.Maths/Circle.cs index fafcc12f4d..7bf316343c 100644 --- a/src/Maths/Silk.NET.Maths/Circle.cs +++ b/src/Maths/Silk.NET.Maths/Circle.cs @@ -73,7 +73,7 @@ public Circle(T centerX, T centerY, T radius) /// This does consider a point on the edge contained. public bool Contains(Vector2D point) { - return Scalar.LessThanOrEqual(Vector2D.DistanceSquared(point, Center), Radius); + return Scalar.LessThanOrEqual(Vector2D.DistanceSquared(point, Center), SquaredRadius); } /// @@ -177,4 +177,4 @@ public Circle As() where TOther : unmanaged, IFormattable, IEqua return new(Center.As(), Scalar.As(Radius)); } } -} \ No newline at end of file +}