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