18 lines
566 B
C#
18 lines
566 B
C#
using Syntriax.Engine.Core;
|
|
|
|
namespace Syntriax.Engine.Physics2D.Primitives;
|
|
|
|
public record Circle(Vector2D Center, float Radius)
|
|
{
|
|
public float RadiusSquared => Radius * Radius;
|
|
public float Diameter => 2f * Radius;
|
|
|
|
public static bool ApproximatelyEquals(Circle left, Circle right)
|
|
=> left.Center.ApproximatelyEquals(right.Center) && left.Radius.ApproximatelyEquals(right.Radius);
|
|
}
|
|
|
|
public static class CircleExtensions
|
|
{
|
|
public static bool ApproximatelyEquals(this Circle left, Circle right) => Circle.ApproximatelyEquals(left, right);
|
|
}
|