1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:38:47 +00:00

Add predefined Cuboid and Sphere values

This commit is contained in:
Oliver Booth 2022-06-01 19:42:11 +01:00
parent 88dcbdc3c6
commit 165cdf16d0
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
2 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
using System.Numerics;
using System.Numerics;
using X10D.Numerics;
namespace X10D.Drawing;
@ -8,6 +8,17 @@ namespace X10D.Drawing;
/// </summary>
public readonly struct Cuboid : IEquatable<Cuboid>
{
/// <summary>
/// The empty cuboid. That is, a cuboid whose size is zero.
/// </summary>
public static readonly Cuboid Empty = new();
/// <summary>
/// A cube. That is, a cuboid whose size is the same in all three dimensions.
/// </summary>
/// <value>A cube with the size (1, 1, 1).</value>
public static readonly Cuboid Cube = new(0, 0, 0, 1, 1, 1);
/// <summary>
/// Initializes a new instance of the <see cref="Cuboid" /> struct.
/// </summary>

View File

@ -7,6 +7,16 @@ namespace X10D.Drawing;
/// </summary>
public readonly struct Sphere : IEquatable<Sphere>, IComparable<Sphere>, IComparable
{
/// <summary>
/// The empty sphere. That is, a sphere with a radius of zero.
/// </summary>
public static readonly Sphere Empty = new();
/// <summary>
/// The unit sphere. That is, a sphere with a radius of 1.
/// </summary>
public static readonly Sphere Unit = new(0, 0, 0, 1f);
/// <summary>
/// Initializes a new instance of the <see cref="Sphere" /> struct.
/// </summary>