1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-09 23:25:43 +00:00

Add Circumference and Diameter properties to Sphere

This commit is contained in:
Oliver Booth 2022-06-01 19:43:06 +01:00
parent 221ee70f0c
commit 08d84ed6a2
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634

View File

@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
namespace X10D.Drawing;
@ -46,6 +46,24 @@ public readonly struct Sphere : IEquatable<Sphere>, IComparable<Sphere>, ICompar
/// <value>The center point.</value>
public Vector3 Center { get; }
/// <summary>
/// Gets the circumference of the sphere.
/// </summary>
/// <value>The circumference of the sphere, calculated as <c>2πr</c>.</value>
public float Circumference
{
get => 2 * MathF.PI * Radius;
}
/// <summary>
/// Gets the diameter of the sphere.
/// </summary>
/// <value>The diameter.</value>
public float Diameter
{
get => Radius * 2;
}
/// <summary>
/// Gets the radius of the sphere.
/// </summary>