From 4093fd65382c9e9e96d00c17a746f41b70656c18 Mon Sep 17 00:00:00 2001 From: That-One-Nerd Date: Mon, 24 Jul 2023 18:35:25 -0400 Subject: [PATCH] Made the 'd' lowercase in Box2D and Box3D --- Nerd_STF/Mathematics/Geometry/Box2D.cs | 56 ++++++++++++------------- Nerd_STF/Mathematics/Geometry/Box3D.cs | 58 +++++++++++++------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/Nerd_STF/Mathematics/Geometry/Box2D.cs b/Nerd_STF/Mathematics/Geometry/Box2D.cs index e2c02c4..7a0ba67 100644 --- a/Nerd_STF/Mathematics/Geometry/Box2D.cs +++ b/Nerd_STF/Mathematics/Geometry/Box2D.cs @@ -1,10 +1,10 @@ namespace Nerd_STF.Mathematics.Geometry; -public record class Box2D : IAbsolute, IAverage, ICeiling, IClamp, IContains, - IEquatable, IFloor, ILerp, IMedian, IRound, IShape2d, - ISplittable +public record class Box2d : IAbsolute, IAverage, ICeiling, IClamp, IContains, + IEquatable, IFloor, ILerp, IMedian, IRound, IShape2d, + ISplittable { - public static Box2D Unit => new(Vert.Zero, Float2.One); + public static Box2d Unit => new(Vert.Zero, Float2.One); public Vert MaxVert { @@ -31,13 +31,13 @@ public record class Box2D : IAbsolute, IAverage, ICeiling, public Vert center; public Float2 size; - public Box2D(Vert min, Vert max) : this(Vert.Average(min, max), (Float2)(min - max)) { } - public Box2D(Vert center, Float2 size) + public Box2d(Vert min, Vert max) : this(Vert.Average(min, max), (Float2)(min - max)) { } + public Box2d(Vert center, Float2 size) { this.center = center; this.size = size; } - public Box2D(Fill fill) : this(fill, new Float2(fill(3), fill(4))) { } + public Box2d(Fill fill) : this(fill, new Float2(fill(3), fill(4))) { } public float this[int index] { @@ -45,26 +45,26 @@ public record class Box2D : IAbsolute, IAverage, ICeiling, set => size[index] = value; } - public static Box2D Absolute(Box2D val) => new(Vert.Absolute(val.MinVert), Vert.Absolute(val.MaxVert)); - public static Box2D Average(params Box2D[] vals) + public static Box2d Absolute(Box2d val) => new(Vert.Absolute(val.MinVert), Vert.Absolute(val.MaxVert)); + public static Box2d Average(params Box2d[] vals) { (Vert[] centers, Float2[] sizes) = SplitArray(vals); return new(Vert.Average(centers), Float2.Average(sizes)); } - public static Box2D Ceiling(Box2D val) => new(Vert.Ceiling(val.center), Float2.Ceiling(val.size)); - public static Box2D Clamp(Box2D val, Box2D min, Box2D max) => + public static Box2d Ceiling(Box2d val) => new(Vert.Ceiling(val.center), Float2.Ceiling(val.size)); + public static Box2d Clamp(Box2d val, Box2d min, Box2d max) => new(Vert.Clamp(val.center, min.center, max.center), Float2.Clamp(val.size, min.size, max.size)); - public static Box2D Floor(Box2D val) => new(Vert.Floor(val.center), Float2.Floor(val.size)); - public static Box2D Lerp(Box2D a, Box2D b, float t, bool clamp = true) => + public static Box2d Floor(Box2d val) => new(Vert.Floor(val.center), Float2.Floor(val.size)); + public static Box2d Lerp(Box2d a, Box2d b, float t, bool clamp = true) => new(Vert.Lerp(a.center, b.center, t, clamp), Float2.Lerp(a.size, b.size, t, clamp)); - public static Box2D Median(params Box2D[] vals) + public static Box2d Median(params Box2d[] vals) { (Vert[] verts, Float2[] sizes) = SplitArray(vals); return new(Vert.Median(verts), Float2.Median(sizes)); } - public static Box2D Round(Box2D val) => new(Vert.Round(val.center), Float2.Round(val.size)); + public static Box2d Round(Box2d val) => new(Vert.Round(val.center), Float2.Round(val.size)); - public static (Vert[] centers, Float2[] sizes) SplitArray(params Box2D[] vals) + public static (Vert[] centers, Float2[] sizes) SplitArray(params Box2d[] vals) { Vert[] centers = new Vert[vals.Length]; Float2[] sizes = new Float2[vals.Length]; @@ -78,7 +78,7 @@ public record class Box2D : IAbsolute, IAverage, ICeiling, return (centers, sizes); } - public virtual bool Equals(Box2D? other) + public virtual bool Equals(Box2d? other) { if (other is null) return false; return center == other.center && size == other.size; @@ -100,16 +100,16 @@ public record class Box2D : IAbsolute, IAverage, ICeiling, return true; } - public static Box2D operator +(Box2D a, Vert b) => new(a.center + b, a.size); - public static Box2D operator +(Box2D a, Float2 b) => new(a.center, a.size + b); - public static Box2D operator -(Box2D b) => new(-b.MaxVert, -b.MinVert); - public static Box2D operator -(Box2D a, Vert b) => new(a.center - b, a.size); - public static Box2D operator -(Box2D a, Float2 b) => new(a.center, a.size - b); - public static Box2D operator *(Box2D a, float b) => new(a.center * b, a.size * b); - public static Box2D operator *(Box2D a, Float2 b) => new(a.center, a.size * b); - public static Box2D operator /(Box2D a, float b) => new(a.center / b, a.size / b); - public static Box2D operator /(Box2D a, Float2 b) => new(a.center, a.size / b); + public static Box2d operator +(Box2d a, Vert b) => new(a.center + b, a.size); + public static Box2d operator +(Box2d a, Float2 b) => new(a.center, a.size + b); + public static Box2d operator -(Box2d b) => new(-b.MaxVert, -b.MinVert); + public static Box2d operator -(Box2d a, Vert b) => new(a.center - b, a.size); + public static Box2d operator -(Box2d a, Float2 b) => new(a.center, a.size - b); + public static Box2d operator *(Box2d a, float b) => new(a.center * b, a.size * b); + public static Box2d operator *(Box2d a, Float2 b) => new(a.center, a.size * b); + public static Box2d operator /(Box2d a, float b) => new(a.center / b, a.size / b); + public static Box2d operator /(Box2d a, Float2 b) => new(a.center, a.size / b); - public static implicit operator Box2D(Fill fill) => new(fill); - public static explicit operator Box2D(Box3D box) => new(box.center, (Float2)box.size); + public static implicit operator Box2d(Fill fill) => new(fill); + public static explicit operator Box2d(Box3d box) => new(box.center, (Float2)box.size); } diff --git a/Nerd_STF/Mathematics/Geometry/Box3D.cs b/Nerd_STF/Mathematics/Geometry/Box3D.cs index 77a0559..0937d57 100644 --- a/Nerd_STF/Mathematics/Geometry/Box3D.cs +++ b/Nerd_STF/Mathematics/Geometry/Box3D.cs @@ -1,10 +1,10 @@ namespace Nerd_STF.Mathematics.Geometry; -public record class Box3D : IAbsolute, IAverage, ICeiling, IClamp, - IContains, IEquatable, IFloor, ILerp, IMedian, - IRound, IShape3d, ISplittable +public record class Box3d : IAbsolute, IAverage, ICeiling, IClamp, + IContains, IEquatable, IFloor, ILerp, IMedian, + IRound, IShape3d, ISplittable { - public static Box3D Unit => new(Vert.Zero, Float3.One); + public static Box3d Unit => new(Vert.Zero, Float3.One); public Vert MaxVert { @@ -32,14 +32,14 @@ public record class Box3D : IAbsolute, IAverage, ICeiling, public Vert center; public Float3 size; - public Box3D(Box2D box) : this(box.center, (Float3)box.size) { } - public Box3D(Vert min, Vert max) : this(Vert.Average(min, max), (Float3)(min - max)) { } - public Box3D(Vert center, Float3 size) + public Box3d(Box2d box) : this(box.center, (Float3)box.size) { } + public Box3d(Vert min, Vert max) : this(Vert.Average(min, max), (Float3)(min - max)) { } + public Box3d(Vert center, Float3 size) { this.center = center; this.size = size; } - public Box3D(Fill fill) : this(fill, new Float3(fill(3), fill(4), fill(5))) { } + public Box3d(Fill fill) : this(fill, new Float3(fill(3), fill(4), fill(5))) { } public float this[int index] { @@ -47,28 +47,28 @@ public record class Box3D : IAbsolute, IAverage, ICeiling, set => size[index] = value; } - public static Box3D Absolute(Box3D val) => new(Vert.Absolute(val.MinVert), Vert.Absolute(val.MaxVert)); - public static Box3D Average(params Box3D[] vals) + public static Box3d Absolute(Box3d val) => new(Vert.Absolute(val.MinVert), Vert.Absolute(val.MaxVert)); + public static Box3d Average(params Box3d[] vals) { (Vert[] centers, Float3[] sizes) = SplitArray(vals); return new(Vert.Average(centers), Float3.Average(sizes)); } - public static Box3D Ceiling(Box3D val) => + public static Box3d Ceiling(Box3d val) => new(Vert.Ceiling(val.center), (Float3)Float3.Ceiling(val.size)); - public static Box3D Clamp(Box3D val, Box3D min, Box3D max) => + public static Box3d Clamp(Box3d val, Box3d min, Box3d max) => new(Vert.Clamp(val.center, min.center, max.center), Float3.Clamp(val.size, min.size, max.size)); - public static Box3D Floor(Box3D val) => + public static Box3d Floor(Box3d val) => new(Vert.Floor(val.center), (Float3)Float3.Floor(val.size)); - public static Box3D Lerp(Box3D a, Box3D b, float t, bool clamp = true) => + public static Box3d Lerp(Box3d a, Box3d b, float t, bool clamp = true) => new(Vert.Lerp(a.center, b.center, t, clamp), Float3.Lerp(a.size, b.size, t, clamp)); - public static Box3D Median(params Box3D[] vals) + public static Box3d Median(params Box3d[] vals) { (Vert[] verts, Float3[] sizes) = SplitArray(vals); return new(Vert.Median(verts), Float3.Median(sizes)); } - public static Box3D Round(Box3D val) => new(Vert.Ceiling(val.center), (Float3)Float3.Ceiling(val.size)); + public static Box3d Round(Box3d val) => new(Vert.Ceiling(val.center), (Float3)Float3.Ceiling(val.size)); - public static (Vert[] centers, Float3[] sizes) SplitArray(params Box3D[] vals) + public static (Vert[] centers, Float3[] sizes) SplitArray(params Box3d[] vals) { Vert[] centers = new Vert[vals.Length]; Float3[] sizes = new Float3[vals.Length]; @@ -82,7 +82,7 @@ public record class Box3D : IAbsolute, IAverage, ICeiling, return (centers, sizes); } - public virtual bool Equals(Box3D? other) + public virtual bool Equals(Box3d? other) { if (other is null) return false; return center == other.center && size == other.size; @@ -104,16 +104,16 @@ public record class Box3D : IAbsolute, IAverage, ICeiling, return true; } - public static Box3D operator +(Box3D a, Vert b) => new(a.center + b, a.size); - public static Box3D operator +(Box3D a, Float3 b) => new(a.center, a.size + b); - public static Box3D operator -(Box3D b) => new(-b.MaxVert, -b.MinVert); - public static Box3D operator -(Box3D a, Vert b) => new(a.center - b, a.size); - public static Box3D operator -(Box3D a, Float3 b) => new(a.center, a.size - b); - public static Box3D operator *(Box3D a, float b) => new(a.center * b, a.size * b); - public static Box3D operator *(Box3D a, Float3 b) => new(a.center, a.size * b); - public static Box3D operator /(Box3D a, float b) => new(a.center / b, a.size / b); - public static Box3D operator /(Box3D a, Float3 b) => new(a.center, a.size / b); + public static Box3d operator +(Box3d a, Vert b) => new(a.center + b, a.size); + public static Box3d operator +(Box3d a, Float3 b) => new(a.center, a.size + b); + public static Box3d operator -(Box3d b) => new(-b.MaxVert, -b.MinVert); + public static Box3d operator -(Box3d a, Vert b) => new(a.center - b, a.size); + public static Box3d operator -(Box3d a, Float3 b) => new(a.center, a.size - b); + public static Box3d operator *(Box3d a, float b) => new(a.center * b, a.size * b); + public static Box3d operator *(Box3d a, Float3 b) => new(a.center, a.size * b); + public static Box3d operator /(Box3d a, float b) => new(a.center / b, a.size / b); + public static Box3d operator /(Box3d a, Float3 b) => new(a.center, a.size / b); - public static implicit operator Box3D(Fill fill) => new(fill); - public static implicit operator Box3D(Box2D box) => new(box); + public static implicit operator Box3d(Fill fill) => new(fill); + public static implicit operator Box3d(Box2d box) => new(box); }