feat(physics): added area & inertia calculations for the shape and circles

This commit is contained in:
2026-04-04 18:49:27 +03:00
parent 6db427f39b
commit af2eed2200
6 changed files with 107 additions and 2 deletions

View File

@@ -34,6 +34,16 @@ public readonly struct Circle(Vector2D center, float radius) : IEquatable<Circle
/// </summary>
public readonly float Diameter => 2f * Radius;
/// <summary>
/// Gets the area of the <see cref="Circle"/>.
/// </summary>
public readonly float Area => Math.Pi * RadiusSquared;
/// <summary>
/// Gets the geometric interia of the <see cref="Circle"/>.
/// </summary>
public readonly float GeometricInertia => .5f * RadiusSquared;
/// <summary>
/// A predefined unit <see cref="Circle"/> with a center at the origin and a radius of 1.
/// </summary>