feat(physics): added area & inertia calculations for the shape and circles
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user