mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-12 23:55:41 +00:00
Add Circumference and Diameter properties to Sphere
This commit is contained in:
parent
221ee70f0c
commit
08d84ed6a2
@ -1,4 +1,4 @@
|
|||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
|
|
||||||
namespace X10D.Drawing;
|
namespace X10D.Drawing;
|
||||||
|
|
||||||
@ -46,6 +46,24 @@ public readonly struct Sphere : IEquatable<Sphere>, IComparable<Sphere>, ICompar
|
|||||||
/// <value>The center point.</value>
|
/// <value>The center point.</value>
|
||||||
public Vector3 Center { get; }
|
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>
|
/// <summary>
|
||||||
/// Gets the radius of the sphere.
|
/// Gets the radius of the sphere.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user