-
Nerd_STF v3.0.0-beta3 Pre-Release
released this
2025-02-19 10:30:07 -05:00 | 4 commits to v3.0 since this releaseNerd_STF 3.0 is approaching a stable release, but I've still got some things that I still want to add and things that I feel like are unsatisfactory. So here's another beta release. There will probably only be one or two more before a final version is ready. This is easily the most ambitious project I've done in such a small amount of time, so I think you can bear with me as I bring this part of it to completition.
Here's what's new:
Fill<T>andFill2d<T>are back!I thought the
Fill<T>delegate was slightly redundant, since you could probably just pass anIEnumerableor something instead, but I've learned that it's really easy to pass a Fill delegate in places where an IEnumerable would be annoying. I might add support for Fill stuff in the future, such as an extension list, but for now I've just re-added the delegate and made most types support it in a constructor.Slight Matrix Constructor Change
I think I got the meaning of the
byRowsparameter mixed up in my head, so I have swapped its meaning to what it (I think) should be. The default value has also changed, so unless you've been explicitly using it you won't notice a difference.And Best of All: Colors!
I have had plenty of time to think about how I could have done colors better in the previous iteration of the library, and I've come up with this, which I think is slightly better.
First of all, colors derive from the
IColor<TSelf>interface similarly to how they did before, but no moreIColorFloat. Now, every color has double-precision channels by default. To handle specific bit sizes, theIColorFormatinterface has been created. It can of course be derived from, and I think it's pretty easy to use and understand, but hopefully there will be enough color formats already defined that you won't even need to touch it directly. At the moment, there's only one real color format created,R8G8B8A8, which is what it sounds like: 8 bits for each of the RGBA channels. There will be plenty more to come.I have been thinking about writing a stream class that is capable of having a bit-offset. I would use it in tandom with the color formats, as many of them span multiple bytes in ways that don't always align with 8-bit bytes. It seems somewhat out of place, but I think I'll go for it anyway.
There's also a color palette system now. You give it a certain number of colors and it allocates room to the nearest power of two. If you give it 6 colors, it allocates room for 8. This is to always keep the size of the palette identical to its bit depth. 6 colors needs 3 bits per color, so might as well do as much as you can with those 3 bits.
There is also an
IndexedColor"format," which does not store its color directly. Rather, it stores its index and a reference to the color palette it came from. I understand a true "indexed color" wouldn't store a reference to its palette to save memory, but this is mostly for ease of use. Colors are passed through methods with therefkeyword, so you can manipulate them directly.void MethodA() { ColorPalette<ColorRGB> palette = new(8); // palette[3] is currently set to black. MethodB(palette[3]); // palette[3] is now set to blue. } void MethodB(IndexedColor<ColorRGB> color) { color.Color() = ColorRGB.Blue; // You could also: ref ColorRGB val = ref color.Color(); val = ColorRGB.Blue; }Anyway, that's all I've got for now. I'm not sure what will be next up, but here's what's left to do:
- Complex numbers and quaternions.
- More color types and formats.
- Bit-offset compatible streams.
- Fix bugs/inconveniences I've noted.
I think the Image type will be completely reworked and might be what version 3.1 is.
Downloads
-
Nerd_STF v3.0.0-beta2 Pre-Release
released this
2024-11-25 10:20:20 -05:00 | 11 commits to v3.0 since this releaseNerd_STF v3.0-beta2
I've added a substantial number of things in this update, mostly matrix related.
List Tuples
In the previous beta, I introduced Combination Indexers for the double and int groups, however a problem was that they only returned
IEnumerables. So while some interesting things were supported, some things were not.Float4 wxyz = (1, 2, 3, 4); IEnumerable<double> vals1 = wxyz["xy"]; // Yields [2, 3] Float2 vals2 = wxyz["xy"]; // Not allowed!And that kind of sucked. So I created the
ListTuple<T>type. It's job is to act like a regular tuple, but be able to impliclty convert to either anIEnumerableor a regularValueTuple<T>, thus allowing conversions to the double and int groups indirectly. Now, all combination indexers return aListTupleinstead of anIEnumerable.Under the hood, the
ListTupleactually uses an array, but you get the idea.Float4 wxyz = (1, 2, 3, 4); ListTuple<double> vals1 = wxyz["xy"]; // Yields (2, 3) Float2 vals2 = vals1; // Yields (2, 3) IEnumerable<double> vals3 = vals1; // Yields [2, 3]Problem is, now the names have the potential to make much less sense.
Float4 wxyz = (1, 2, 3, 4); Float2 xy = wxyz["xy"]; // x <- x, y <- y Float2 wz = wxyz["wz"]; // x <- w, y <- zBut whatever. You can always stick to using
IEnumerables if you want.No More
*.AbstractI got rid of all the
Abstractnamespaces, since they don't really make much sense in the grand scheme of things. They've all been moved to the namespace that applies to them most (eg.INumberGroupwent toNerd_STF.Mathematics,ICombinationIndexerwent toNerd_STFsince it applies to more than just mathematics).The
FractionTypeThis type originally went under the name of
Rationalin Nerd_STF 2.x, but that name is actually incorrect, right? So in the rework, it changed names. But it also can do much more now thanks to theINumberinterface added in .NET 7.0. If you're using that framework or above, the fraction type is fully compatible with that type, and all the math functions inMathEand elsewhere that useINumberwill work with it.Can I just say that the
INumberinterface is really annoying to write a type for? There's so many weird casting functions and a whole lot of methods that even the .NET developers will hide in public declarations. Why have them at all?
And I want to change the name of the
MathEclass. I'm thinkingMath2, but I'm open to suggestions.And Best of All, Matrices
Oh yeah, we're adding those things again. I haven't completed (or even started) the dynamic
Matrixclass, that will arrive in beta3. But I have theMatrix2x2,Matrix3x3, andMatrix4x4fully implemented. TheToString()methods are much better with the new implementation than previously, and theGetHashCode()methods give different results even if the numbers have their positions swapped (which they originally didn't do).And it's much faster. Much, much faster. Don't get me wrong, multiplying a 4x4 matrix still requires 64 multiplications and 48 additions, which is quite a lot, but my original implementation was littered with many method calls, easily doubling the runtime. I have now super-inlined basically all of the static matrix code. And I mean, replacing all method calls with nothing but multiplication and addition for things like the determinants, the cofactors, the inverses, and more. Don't look at the source, it's really ugly.
That's all the major stuff in this update! I'll see you guys in beta3!
P.S. I know that the System library also includes
Vector2,Vector3, andVector4types. I'll add casting support for them soon.Downloads
-
Nerd_STF v3.0.0-beta1 Pre-Release
released this
2024-10-29 11:57:27 -04:00 | 16 commits to v3.0 since this releaseNerd_STF v3.0.0-beta1
Hi! Pretty much nothing has remained the same from version 2. There are plenty of breaking changes, and the betas will have plenty of missing features from 2.4.1. The betas will continue until every feature from 2.4.1 has been added to 3.0 or scrapped.
In the mean time, here's what's new.
More Compatibility
Nerd_STF now targets several versions of .NET and .NET Standard, making it basically run anywhere. You can use this website to see what different versions of .NET Standard support, but if your project uses a version of .NET that was released in the last 10 years, chances are Nerd_STF supports it.
In addition, Nerd_STF uses some of the new C# features while still retaining older compatibility. If you want to use Nerd_STF in your .NET 8.0 project, you will reference the version of Nerd_STF compiled for .NET 7.0 and retain those fancy new interface features (among others) found in C# 11. Nullability support has been added to all versions of .NET that use C# 8 and above. And if I decide to use more new C# features for Nerd_STF, I'll just target another version of .NET.
Committed to Doubles
Nerd_STF is a precision library, not one meant to be highly optimized at the sacrifice of precision. So I've decided to fully commit to doubles. The double groups are still called
Float2,Float3andFloat4, becauseDouble2doesn't have quite the same ring to it now, does it? Hope it doesn't get too confusing.But all math functions are now using doubles (with a few exceptions).
'w' Goes in Front Now
I think this is how it should have been. I was really breaking the rules of the alphabet before. Previously in a
Float4, thewcomponent was fourth. Now it is first. The order goes w, x, y, z. You know, how it should.This means though that casting a
Float3to aFloat4will put the extra zero at the start, not the end (becausex->xin the cast).Float3 xyz = (5, 6, 7); Float4 wxyz = xyz; // Gives (0, 5, 6, 7)This also means that truncating a
Float4removes the frontwfirst, giving some odd results.Float2 xy = (10, 9); Float4 wxyz = xy; // Gives (0, 10, 9, 0)Float4 wxyz = (9, 8, 7, 6); Float2 xy = (Float2)wxyz; // Must be explicitly stated. Yields (8, 7)But
xalways goes toxwhen casting between groups, same with the other variables. Hopefully that'll make more sense.Combination Indexers
One thing I've always been envious of was HLSL's ability to easily make a subset of a group.
float3 group = float3(1, 2, 3); float2 part = group.yz; // Like this.And I had a crude version of this in Nerd_STF before, with properties for
XY,YZW, and stuff like that. But you couldn't do things out of order (for example, you could never do.ZY). Also, the naming scheme would not make very much sense.xwas always the first item Now, you can do it with an indexer.Float4 wxyz = (1, 2, 3, 4); IEnumerable<double> zyx = wxyz["zyx"]; // Yields [ 4, 3, 2 ]I think you get it, it makes sense. It returns an IEnumerable though, so support has been added in the group constructors to read data from an IEnumerable. You can also set things this way.
Float4 wxyz = (1, 2, 3, 4); wxyz["xy"] = [ 9, 8 ]; // Yields (9, 8, 3, 4)You can also have duplicates. Why you would want duplicates is beyond me. And the order can be whatever you'd like.
Float4 wxyz = (1, 2, 3, 4); IEnumerable<double> nums = wxyz["wyyxzzwy"]; // Yields [ 1, 3, 3, 2, 4, 4, 1, 3 ]Better Equations
The previous equation system was just a delegate to a method. While it worked for unoptimized things, it won't automatically give precise results. So that system has been overhauled.
Now, every equation derives from the
IEquationinterface, which defines a few operators (most importantly theGet(double)method, which is intended to evaluate the equation at the given input). And there are multiple types. There's the baseEquationtype that replicates the method delegate it used to be, but there are also nowPolynomialequations which specialize in... uh... polynomials, includingQuadraticandLinearalong with the dynamicPolynomialtype.The indexer is equivalent to calling the
Get(double)method.Creating your own is easy, simply derive from the interface and implement the methods required. You should never throw an exception if the two equations you are adding (or multiplying or whatever) are not the same type. If they cannot be combined in a nice way, you should default to the delegate-based approach. Here is an example:
public IEquation Add(IEquation other) { if (other is YourEquation yourEqu) { // Properly add your two equations. } else { // Unknown other equation type, do a basic addition system. return new Equation(x => Get(x) + other.Get(x)); } }And in practice, you should avoid referring to a general equation by its type. Go by the interface operators instead.
double Fun(double x) => 0.5 * MathE.Sin(x); Equation a = (Equation)Fun; // The traditional delegate approach from previous versions. Polynomial b = new Polynomial(1, 5, 4); // x^2 + 5x + 4 IEquation c = a.Add(b).Multiply(2); // Result is technically an `Equation`, but we should not cast here.Renamed the
Mathfclass.I chose that name because I thought Unity did it well, but I also intend for this project to be compatible with Unity. So I've renamed it to
MathE. I'm still iffy on that name. I'll commit to one before this project goes out of beta, but it might change until then. Other ideas I'm considering areMatheandMath2. Feel free to give your input!Support for
System.Drawingtypes.I've tried to use this library when working with Windows Forms a few times. Problem is, it sucks having to manually set the variables from
PointandSize. So Nerd_STF 3.0 now does that for you, with implicit casts to and from both, along with their float variations.It's worth mentioning that
Float2is a double group, whilePointFis a float group. Data will be lost slightly when implicitly casting. Watch out!
Anyway, that's most of the big changes! I don't know if I'll do the full changelog like I have before. It takes a really long time to compile for large updates. We'll see. Thanks for checking out the update and I hope you use it well (or wait for the release version, that's fine too)!
Downloads
-
Nerd_STF v2.4.1 Stable
released this
2023-07-16 20:19:17 -04:00 | 0 commits to v2.4 since this releaseHey everyone! This is one of the larger small updates, and I'm pretty proud of what I got done in a week.
Along with adding setters to parts like
Float3.XYand fixing a few bugs, almost all improvements in this update are related to matricies. First of all, I've added a bunch of new items to theIMatrixinterface. Now, any deriving matrix has more requirements that fit the regularMatrixtype. I don't know why one would use theIMatrixinterface rather than a specific matrix type, but now the options are more sophisticated.I've added some new stuff to all the matrix types, including row operations. You can now scale a row, add a row to another, and swap two rows. If I become aware of any more commonly-used row operations, I'll add then in a
2.4.2update. But I think I've got all the good ones. There is also a mutable version of each operation which, rather than returning a new matrix with changes made, instead applies the changes to itself.Did you know I made two seperate blunders in the
Cofactor()method? For theMatrix2x2version of theCofactor()method, I had the diagonal elements swapped. Whoops. For theMatrixversion of theCofactor()method, matricies with even column count would break because of the alternating sign pattern I was using. Now, as far as I know, that bug is fixed.The last thing I did was add the ability to turn a matrix into its equivalent row-echelon form. This is applicable only to the
Matrixtype (the dynamic one), and works with some levels of success. It's a little weird and tends to give results with lots of negative zeroes, but overall it's fine, I think. As far as I know there aren't any obvious bugs. We'll see though.Anyway, that's everything in this update. Again, pretty small, but meaningful nonetheless. Unless I haven't screwed anything up, the next update I work on will be
2.5, so I'll see you then!Here's the full changelog:
* Nerd_STF * Mathematics * Abstract * IMatrix + AddRow(int, int, float) + AddRowMutable(int, int, float) + Cofactor() + GetColumn(int) + GetRow(int) + ScaleRow(int, float) + ScaleRowMutable(int, float) + SetColumn(int, float[]) + SetRow(int, float[]) + Size + SwapRows(int, int) + SwapRowsMutable(int, int) + this[int, int] + this[Index, Index] * Algebra * Matrix + AddRow(int, int, float) + AddRowMutable(int, int, float) + ScaleRow(int, float) + ScaleRowMutable(int, float) + SwapRows(int, int) + SwapRowsMutable(int, int) = Fixed a blunder in `SignGrid(Int2)` with signs being incorrectly placed on matrixes with even column count. * Matrix2x2 + AddRow(int, int, float) + AddRowMutable(int, int, float) + GetColumn(int) + GetRow(int) + ScaleRow(int, float) + ScaleRowMutable(int, float) + SetColumn(int, float[]) + SetRow(int, float[]) + Size + SwapRows(int, int) + SwapRowsMutable(int, int) = Fixed a blunder in `Cofactor()` with the position of elements. * Matrix3x3 + AddRow(int, int, float) + AddRowMutable(int, int, float) + GetColumn(int) + GetRow(int) + ScaleRow(int, float) + ScaleRowMutable(int, float) + SetColumn(int, float[]) + SetRow(int, float[]) + Size + SwapRows(int, int) + SwapRowsMutable(int, int) * Matrix4x4 + AddRow(int, int, float) + AddRowMutable(int, int, float) + GetColumn(int) + GetRow(int) + ScaleRow(int, float) + ScaleRowMutable(int, float) + SetColumn(int, float[]) + SetRow(int, float[]) + Size + SwapRows(int, int) + SwapRowsMutable(int, int) * NumberSystems * Complex + operator Complex(SystemComplex) + operator SystemComplex(Complex) * Quaternion + operator Quaternion(SystemQuaternion) + operator SystemQuaternion(Quaternion) * Float3 = Added a setter to `XY` = Added a setter to `XZ` = Added a setter to `YZ` * Float4 = Added a setter to `XW` = Added a setter to `XY` = Added a setter to `XZ` = Added a setter to `YW` = Added a setter to `YZ` = Added a setter to `ZW` = Added a setter to `XYW` = Added a setter to `XYZ` = Added a setter to `XZW` = Added a setter to `YZW` * Int3 = Added a setter to `XY` = Added a setter to `XZ` = Added a setter to `YZ` * Int4 = Added a setter to `XW` = Added a setter to `XY` = Added a setter to `XZ` = Added a setter to `YW` = Added a setter to `YZ` = Added a setter to `ZW` = Added a setter to `XYW` = Added a setter to `XYZ` = Added a setter to `XZW` = Added a setter to `YZW`Downloads
-
released this
2023-07-10 00:25:18 -04:00 | 12 commits to main since this releaseNerd_STF v2.4.0 (Equations and Numbers)
I've done a pretty good amount of stuff in this update, and I'm pretty proud of it. Good improvement.
First of all, I've gone and added all of the applicable
Mathffunctions as an extension to theEquationdelegate. That way if you want to say, calculate the square root of an entire equation, rather than going:Equation result = x => Mathf.Sqrt(equ(x)); // Where `equ` is an `Equation` that represents the function we want to take the square root of.you can shorten it down and remove some of the weirdness.
Equation result = equ.Sqrt(); // Where `equ` is an `Equation` that represents the function we want to take the square root of.It works for any common function you'd want to apply to an equation.
Speaking of math functions (I guess that's the whole update, given the name), I'm now utilizing an implementation of CORDIC I made to calculate all trigonometric functions, hyperbolic trig functions, exponents, and logs. It's quite a neat process, and I could also have it completely wrong, but whatever I have, CORDIC or something else, works wonders, and is considerably faster than some other methods I tried. Of course, it's still nowhere near as fast as the built-in math functions, but they will always be on a whole other level. Maybe in the optimization update I'll bother to improve them, but they work quite well as-is for most use cases.
I've also implemented taylor series into the
Calculusclass. It's not particularly useful is most cases, so I wouldn't bother. The only time it would be a good idea to use it is if you've got some incredibly slow to calculate equation and want to optimize it. The function will take a long time at first, as it will have to generate second-derivatives and beyond, but afterwards the output equation will just be a simple-to-calculate polynomial (though the approximation gets worse the further you are from the reference point). If you've got an equation that's already fast to calculate, using the taylor series approximation will only be a negative. So take it with a grain of salt.That's mostly it. I've fixed some issues/bugs here and there, renamed some small stuff (check the full changelog for more information), removed all the stuff marked obsolete and to be removed in this update, added some more math stuff like prime calculators, and other tiny changes. The next update will be focused on reworking the badly made geometry stuff I did a while back (Version 2.1). I know I say this all the time, but version 2.5 should be substantially bigger than this one. I'm going to be reworking the
Polygonobject entirely and will be improving quite a lot of other things in the wholeNerd_STF.Mathematics.Geometrynamespace. Stay tuned!Here's the full changelog:
* Nerd_STF * Exceptions + BadMethodException * Extensions * ConversionExtension - ToDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, TValue>>) * EquationExtension + ValidNumberTypes + Absolute(Equation) + AbsoluteMod(Equation, float) + ArcCos(Equation) + ArcCot(Equation) + ArcCsc(Equation) + ArcSec(Equation) + ArcSin(Equation) + ArcTan(Equation) + ArcCosh(Equation) + ArcCoth(Equation) + ArcCsch(Equation) + ArcSech(Equation) + ArcSinh(Equation) + ArcTanh(Equation) + Average(Equation, float, float, float) + Average(Equation, Equation, Equation, float) + Binomial(Equation, int, float) + Binomial(Equation, Equation, Equation) + Cbrt(Equation) + Ceiling(Equation) + Clamp(Equation, float, float) + Clamp(Equation, Equation, Equation) + Combinations(Equation, int) + Combinations(Equation, Equation) + Cos(Equation) + Cosh(Equation) + Cot(Equation) + Coth(Equation) + Csc(Equation) + Csch(Equation) + Divide(Equation, float[]) + Divide(Equation, Equation[]) + Factorial(Equation) + Floor(Equation) + GetDerivative(Equation, float) + GetDerivativeAtPoint(Equation, float, float) + GetIntegral(Equation, float, float, float) + GetDynamicIntegral(Equation, Equation, Equation, float) + GetTaylorSeries(Equation, float, int, float) + GetValues(Equation, float, float, float) + GradientDescent(Equation, float, float, int, float) + InverseSqrt(Equation) + Log(Equation, float) + Max(Equation, float, float, float) + Min(Equation, float, float, float) + Permutations(Equation, int) + Permutations(Equation, Equation) + Power(Equation, float) + Power(Equation, Equation) + Product(Equation, float[]) + Product(Equation, Equation[]) + Root(Equation, float) + Root(Equation, Equation) + Round(Equation) + Sec(Equation) + Sech(Equation) + Sin(Equation) + Sinh(Equation) + SolveBisection(Equation, float, float, float, float, int) + SolveEquation(Equation, float, float, float, int) + SolveNewton(Equation, float, float, float, int) + Sqrt(Equation) + Subtract(Equation, float[]) + Subtract(Equation, Equation[]) + Sum(Equation, float[]) + Sum(Equation, Equation[]) + Tan(Equation) + Tanh(Equation) + ZScore(Equation, float[]) + ZScore(Equation, Equation[]) + ZScore(Equation, float, float) + ZScore(Equation, Equation, Equation) + InvokeMethod(Equation, MethodInfo, object?[]?) + InvokeMathMethod(Equation, string, object?[]?) + StringExtension + Helpers + CordicHelper + MathfHelper + RationalHelper + UnsafeHelper * Mathematics * Abstract = Renamed `IPresets1D<T>` to `IPresets1d<T>` = Renamed `IPresets2D<T>` to `IPresets2d<T>` = Renamed `IPresets3D<T>` to `IPresets3d<T>` = Renamed `IPresets4D<T>` to `IPresets4d<T>` = Renamed `IShape2D<T>` to `IShape2d<T>` = Renamed `IShape3D<T>` to `IShape3d<T>` * NumberSystems * Complex - operator >(Complex, Complex) - operator <(Complex, Complex) - operator >=(Complex, Complex) - operator <=(Complex, Complex) * Quaternion - Far - Near - operator >(Complex, Complex) - operator <(Complex, Complex) - operator >=(Complex, Complex) - operator <=(Complex, Complex) * Samples + Fills * Equations + FlatLine + XLine = Simplified `CosWave` = Simplified `SinWave` = Replaced a `readonly` term with a generating field in `CosWave` = Replaced a `readonly` term with a generating field in `SinWave` = Replaced a `readonly` term with a generating field in `SawWave` = Replaced a `readonly` term with a generating field in `SquareWave` = Replaced a `readonly` term with a generating field in `SgnFill` = Moved `SgnFill` to `Fills` and renamed it to `SignFill` * Calculus + GetTaylorSeries(Equation, float, int, float) = Fixed a blunder in `GetDerivativeAtPoint(Equation, float, float)` = Renamed the `stepCount` parameter in `GradientDescent(Equation, float, float, float, float)` to "iterations" and changed its type from `float` to `int` * Float2 - Removed the `Obsolete` attribute from `CompareTo(Float2)` - operator >(Float2, Float2) - operator <(Float2, Float2) - operator >=(Float2, Float2) - operator <=(Float2, Float2) * Float3 - Removed the `Obsolete` attribute from `CompareTo(Float3)` - operator >(Float3, Float3) - operator <(Float3, Float3) - operator >=(Float3, Float3) - operator <=(Float3, Float3) * Float4 - Far - Near - Removed the `Obsolete` attribute from `CompareTo(Float4)` - operator >(Float4, Float4) - operator <(Float4, Float4) - operator >=(Float4, Float4) - operator <=(Float4, Float4) * Int2 - Removed the `Obsolete` attribute from `CompareTo(Int2)` - operator >(Int2, Int2) - operator <(Int2, Int2) - operator >=(Int2, Int2) - operator <=(Int2, Int2) * Int3 - Removed the `Obsolete` attribute from `CompareTo(Int3)` - operator >(Int3, Int3) - operator <(Int3, Int3) - operator >=(Int3, Int3) - operator <=(Int3, Int3) * Int4 - Far - Deep - Removed the `Obsolete` attribute from `CompareTo(Int4)` - operator >(Int4, Int4) - operator <(Int4, Int4) - operator >=(Int4, Int4) - operator <=(Int4, Int4) * Mathf + ArcCosh(float) + ArcCoth(float) + ArcCsch(float) + ArcSech(float) + ArcSinh(float) + ArcTanh(float) + ArcTanh2(float, float) + Cbrt(float) + Cosh(float) + Coth(float) + Csch(float) + IsPrime(int, PrimeCheckMethod) + Lerp(float, float, Equation, bool) + Lerp(Equation, Equation, float, bool) + Lerp(Equation, Equation, Equation, bool) + Log(float, float) + PrimeFactors(int) + PowerMod(long, long, long) + Sech(float) + Sinh(float) + SharedItems<T>(T[][]) + SolveBisection(Equation, float, float, float, float, int) + SolveEquation(Equation, float, float, float, int) + SolveNewton(Equation, float, float, float, int) + Tanh(float) = Improved the `Sqrt(float)` method by using a solution finder = The `ArcSin(float)` method now uses a solution finder rather than the base math library = The `Power(float, float)` method now utilizes a custom CORDIC implementation rather than the base math library + PrimeCheckMethod + Equation2d + Rational + SimplificationMethod * Miscellaneous * AssemblyConfig - using System.Reflection * GlobalUsings + global using Nerd_STF.Helpers + global using System.Reflection - Foreach(object) - Foreach<T>(T) = Moved `IEncapsulator<T, TE>` to `Nerd_STF.Mathematics.Abstract` and renamed it to `IEncapsulate<T, TE>` = Renamed `Fill2D<T>` to `Fill2d<T>` = Renamed `IGroup2D<T>` to `IGroup2d<T>` = Renamed `Modifier2D` to `IModifier2d` = Renamed `Modifier2D<T>` to `IModifier2d<T>` = Renamed `Modifier2D<IT, VT>` to `IModifier2d<IT, VT>` = Made `Nerd_STF` allow unsafe code blocksDownloads
-
released this
2023-03-09 16:44:23 -05:00 | 0 commits to v2.3 since this releaseNerd_STF v2.3.2
A bunch of stuff has changed, hasn't it?
This update was originally intended to be a support update. But among other problems, I don't want to maintain 3 slightly different versions of Nerd_STF at the same time. So I'm going to put the support update on hold for now. I won't delete my progress on it (I got about a quarter of the way done with support for .NET Standard 2.0. It's a big undertaking), I won't promise any completion date either.
Instead, this update ended up being a quality-of-life update. I already finished this part of the update before I decided to cancel the support update. This update now has lots of support for the new .NET 7 features. I'm now using a bunch of static abstract interfaces. I also added range indexing to almost all of the types available. The color byte types now have
intfields instead ofbytefields becauseints are much more common. The values are automatically clamped between 0 and 255 just in case. Basically all types are records now because records are really nice. Lastly, some stuff has been marked as deprecated and to be removed in a future release because they already, exist, are kind of useless, and/or are misleading. Most of the deprecated stuff will be removed in either2.4.0or2.5.0.Also, just want to note that despite the
Vertstruct not being marked as deprecated, it will still be removed in2.5.0. I didn't mark it because that would have created a bunch of warnings in my library. And I don't like warnings.One final note, I've changed the description of the library and I've changed a bunch of the assembly and compilation settings.
Anyway, that's it for this update. The longest delay was just getting this project to other versions of .NET. Stay tuned for v2.4.0, the Equations and Numbers update!
* Nerd_STF * Exceptions * InvalidSizeException = Swapped a `this` method call for a `base` method call in `InvalidSizeException()` * MathException = Made `MathException()` have a default message * Nerd_STFException + Nerd_STFException(Exception) = Made `Nerd_STFException()` have a default message = Made `Nerd_STFException()` invoke the base constructor * NoInverseException = Changed base parent from `Exception` to `Nerd_STFException` * UndefinedException = Gave a better default message in `UndefinedException()` * Extensions * ConversionExtension * ToFill<T>(T[,]) = Made the type parameter `size` nullable (if null, will be replaced with automatic size) = Marked `ToDictionary<TKey, TValue>(IEnumerable<KeyValuePair<TKey, Value>>)` as obsolete, as the `Dictionary` type already has a constructor for it. * Graphics + Abstract + IColor<T> + IColorByte<T> + IColorFloat<T> + IColorPresets<T> * CMYKA + Made `CMYKA` a record + : IAverage<CMYKA> + : IClamp<CMYKA> + : IColorFloat<CMYKA> + : IColorPresets<CMYKA> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<CMYKA, float> + : IMedian<CMYKA> + : ISplittable<CMYKA, (float[] Cs, float[] Ms, float[] Ys, float[] Ks, float[] As)> + float this[Index] + float[] this[Range] + Equals(IColor?) + PrintMembers(StringBuilder) - : IColorFloat - Ceiling(CMYKA) - Floor(CMYKA) - Max(CMYKA[]) - Min(CMYKA[]) - Round(CMYKA) - override Equals(object?) - Equals(IColorFloat?) - Equals(IColorByte?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(CMYKA, CMYKA) - operator !=(CMYKA, CMYKA) = Made `GetHashCode()` invoke the base method * CMYKAByte + Made `CMYKAByte` a record + : IAverage<CMYKAByte> + : IClamp<CMYKAByte> + : IColorByte<CMYKAByte> + : IColorPresets<CMYKAByte> + : IIndexAll<int> + : IIndexRangeAll<int> + : ILerp<CMYKAByte, float> + : IMedian<CMYKAByte> + : ISplittable<CMYKAByte, (byte[] Cs, byte[] Ms, byte[] Ys, byte[] Ks, byte[] As)> + p_c + p_m + p_y + p_k + p_a + int this[Index] + int[] this[Range] + Equals(IColor?) + PrintMembers(StringBuilder) + ToArrayInt() + ToFillInt() + ToListInt() - : IColorByte - Max(CMYKAByte[]) - Min(CMYKAByte[]) - override Equals(object?) - Equals(IColorFloat?) - Equals(IColorByte?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(CMYKAByte, CMYKAByte) - operator !=(CMYKAByte, CMYKAByte) = Changed the return type of `Black` from `CMYKA` to `CMYKAByte` = Changed the return type of `Blue` from `CMYKA` to `CMYKAByte` = Changed the return type of `Clear` from `CMYKA` to `CMYKAByte` = Changed the return type of `Cyan` from `CMYKA` to `CMYKAByte` = Changed the return type of `Gray` from `CMYKA` to `CMYKAByte` = Changed the return type of `Green` from `CMYKA` to `CMYKAByte` = Changed the return type of `Magenta` from `CMYKA` to `CMYKAByte` = Changed the return type of `Orange` from `CMYKA` to `CMYKAByte` = Changed the return type of `Purple` from `CMYKA` to `CMYKAByte` = Changed the return type of `Red` from `CMYKA` to `CMYKAByte` = Changed the return type of `White` from `CMYKA` to `CMYKAByte` = Changed the return type of `Yellow` from `CMYKA` to `CMYKAByte` = Made `C` a property that relates to `p_c` = Made `M` a property that relates to `p_m` = Made `Y` a property that relates to `p_y` = Made `K` a property that relates to `p_k` = Made `A` a property that relates to `p_a` = Made `this[int]` return an `int` instead of a `byte` = Made `SplitArray(CMYKAByte[])` use the private members of the type. = Made `ToArray()` use the private members of the type. = Made `ToList()` use the private members of the type. = Made `GetEnumerator()` use the private members of the type. = Made `GetHashCode()` invoke the base method * HSVA + Made `HSVA` a record + : IAverage<HSVA> + : IClamp<HSVA> + : IColorFloat<HSVA> + : IColorPresets<HSVA> + : IIndexAll<HSVA> + : IIndexRangeAll<HSVA> + : ILerp<HSVA, float> + : IMedian<HSVA> + : ISplittable<HSVA, (Angle[] Hs, float[] Ss, float[] Vs, float[] As)> + float this[Index] + float[] this[Range] + Equals(IColor?) + PrintMembers(StringBuilder) - : IColorFloat - Ceiling(HSVA) - Floor(HSVA) - Max(HSVA[]) - Min(HSVA[]) - Round(HSVA) - override Equals(object?) - Equals(IColorFloat?) - Equals(IColorByte?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(HSVA, HSVA) - operator !=(HSVA, HSVA) = Made `GetHashCode()` invoke the base method = Optimized some clamping in `this[int]` * HSVAByte + Made `HSVAByte` a record + : IAverage<HSVAByte> + : IClamp<HSVAByte> + : IColorByte<HSVAByte> + : IColorPresets<HSVAByte> + : IIndexAll<int> + : IIndexRangeAll<int> + : ILerp<HSVAByte, float> + : IMedian<HSVAByte> + : ISplittable<HSVAByte, (byte[] Hs, byte[] Ss, byte[] Vs, byte[] As)> + p_h + p_s + p_v + p_a + int this[Index] + int[] this[Range] + Equals(IColor?) + PrintMembers(StringBuilder) + ToArrayInt() + ToFillInt() + ToListInt() - : IColorByte - Max(HSVAByte[]) - Min(HSVAByte[]) - override Equals(object?) - Equals(IColorFloat?) - Equals(IColorByte?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(HSVAByte, HSVAByte) - operator !=(HSVAByte, HSVAByte) = Changed the return type of `Black` from `HSVA` to `HSVAByte` = Changed the return type of `Blue` from `HSVA` to `HSVAByte` = Changed the return type of `Clear` from `HSVA` to `HSVAByte` = Changed the return type of `Cyan` from `HSVA` to `HSVAByte` = Changed the return type of `Gray` from `HSVA` to `HSVAByte` = Changed the return type of `Green` from `HSVA` to `HSVAByte` = Changed the return type of `Magenta` from `HSVA` to `HSVAByte` = Changed the return type of `Orange` from `HSVA` to `HSVAByte` = Changed the return type of `Purple` from `HSVA` to `HSVAByte` = Changed the return type of `Red` from `HSVA` to `HSVAByte` = Changed the return type of `White` from `HSVA` to `HSVAByte` = Changed the return type of `Yellow` from `HSVA` to `HSVAByte` = Changed the type of the parameter `t` from a `byte` to a `float` in `Lerp(HSVAByte, HSVAByte, byte, bool)` = Made `H` a property that relates to `p_h` = Made `S` a property that relates to `p_s` = Made `V` a property that relates to `p_v` = Made `A` a property that relates to `p_a` = Made `this[int]` return an `int` instead of a `byte` = Made `SplitArray(HSVAByte[])` use the private members of the type. = Made `ToArray()` use the private members of the type. = Made `ToList()` use the private members of the type. = Made `GetEnumerator()` use the private members of the type. = Made `GetHashCode()` invoke the base method * Image + : IEnumerable<IColor> - : IEnumerable = Added a nullabilty modifier in `Equals(Image)` = Changed a modifier in `Pixels` from `init` to `private set` = Changed a modifier in `Size` from `init` to `private set` = Fixed some random bug in `ModifySaturation(float, bool)` where if `set` is set to `true`, the saturation is completely zeroed out. = Replaced a `this` assignment in `Scale(Float2)` with individual component assignments = Turned `Image` into a `class` (from a `struct`) * RGBA + Made `RGBA` a record + : IAverage<RGBA> + : IClamp<RGBA> + : IColorFloat<RGBA> + : IColorPresets<RGBA> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<RGBA, float> + : IMedian<RGBA> + : ISplittable<RGBA, (float[] Rs, float[] Gs, float[] Bs, float[] As)> + float this[Index] + float[] this[Range] + Equals(IColor?) + PrintMembers(StringBuilder) - : IColorFloat - Ceiling(RGBA) - Floor(RGBA) - Max(RGBA[]) - Min(RGBA[]) - Round(RGBA) - override Equals(object?) - Equals(IColorFloat?) - Equals(IColorByte?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(RGBA, RGBA) - operator !=(RGBA, RGBA) = Made `GetHashCode()` invoke the base method * RGBAByte + Made `RGBAByte` a record + : IAverage<RGBAByte> + : IClamp<RGBAByte> + : IColorByte<RGBAByte> + : IColorPresets<RGBAByte> + : IIndexAll<int> + : IIndexRangeAll<int> + : ILerp<RGBAByte, float> + : IMedian<RGBAByte> + : ISplittable<RGBAByte, (float[] Rs, float[] Gs, float[] Bs, float[] As)> + p_r + p_g + p_b + p_a + int this[Index] + int[] this[Range] + Equals(IColor?) + PrintMembers(StringBuilder) + ToArrayInt() + ToFillInt() + ToListInt() - : IColorByte - Max(RGBAByte[]) - Min(RGBAByte[]) - override Equals(object?) - Equals(IColorFloat?) - Equals(IColorByte?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(RGBAByte, RGBAByte) - operator !=(RGBAByte, RGBAByte) = Changed the type of the parameter `t` from a `byte` to a `float` in `Lerp(RGBAByte, RGBAByte, byte, bool)` = Made `R` a property that relates to `p_r` = Made `G` a property that relates to `p_g` = Made `B` a property that relates to `p_b` = Made `A` a property that relates to `p_a` = Made `this[int]` return an `int` instead of a `byte` = Made `SplitArray(RGBAByte[])` use the private members of the type. = Made `ToArray()` use the private members of the type. = Made `ToList()` use the private members of the type. = Made `GetEnumerator()` use the private members of the type. = Made `GetHashCode()` invoke the base method = Fixed a bug in `ToFill()` where it would return `HSVAByte` values instead = Moved `IColor` to `Nerd_STF.Graphics.Abstract` + : IEquatable<IColor> - : ICloneable - : IEquatable<IColorByte?> - : IEquatable<IColorFloat?> = Moved `IColorByte` to `Nerd_STF.Graphics.Abstract` + ToArrayInt() + ToFillInt() + ToListInt() = Moved `IColorFloat` to `Nerd_STF.Graphics.Abstract` * Mathematics + Abstract + IAbsolute<T> + IAverage<T> + ICeiling<TSelf> + ICeiling<TSelf, TRound> + IClamp<T> + IClampMagnitude<TSelf> + IClampMagnitude<TSelf, TNumber> + ICross<TSelf> + ICross<TSelf, TOut> + IDivide<T> + IDot<TSelf> + IDot<TSelf, TNumber> + IFloor<TSelf> + IFloor<TSelf, TRound> + IIndexAll<TSub> + IIndexGet<TSub> + IIndexRangeAll<TSub> + IIndexRangeGet<TSub> + IIndexRangeSet<TSub> + IIndexSet<TSub> + ILerp<TSelf> + ILerp<TSelf, TNumber> + IMagnitude<TNumber> + IMax<T> + IMatrixPresets<T> + IMedian<T> + IMin<T> + IPresets1D<T> + IPresets2D<T> + IPresets3D<T> + IPresets4D<T> + IProduct<T> + IRound<TSelf> + IRound<TSelf, TRound> + IShape2D<TNumber> + IShape3D<TNumber> + ISplittable<TSelf, TTuple> + IStaticMatrix<T> + ISubtract<T> + ISum<T> + IVector2<T> * Algebra * Matrix + this[Index, Index] + this[Range, Range] - ToString(string?) - ToString(IFormatProvider) = Added a better exception description in `Identity(Int2)` = Added a nullability attribute to the return type of `Inverse()` = Added a nullability attribute to the return type of `operator -(Matrix)` = Added a nullability check in `Equals(Matrix)` = Turned `Matrix` into a `class` (from a `struct`) = Changed the parameter `other` in `Equals(Matrix)` to a nullable equivalent and added a nullability check = Made `Inverse()` return `null` if there is no inverse instead of throwing an exception. = Made `operator /(Matrix, Matrix)` throw an exception if no inverse exists for matrix `b` = Marked `Equals(Matrix)` as virtual * Matrix2x2 + Made `Matrix2x2` into a record + : IStaticMatrix<Matrix2x2> + this[Index, Index] + this[Range, Range] - : IMatrix<Matrix2x2> - override Equals(object?) - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(Matrix2x2, Matrix2x2) - operator !=(Matrix2x2, Matrix2x2) = Added a nullability attribute to the return type of `Inverse()` = Turned `Matrix2x2` into a `class` (from a `struct`) = Marked `Equals(Matrix2x2)` as virtual = Made `GetHashCode()` invoke the base method = Made `Inverse()` return `null` if there is no inverse instead of throwing an exception. = Made `operator /(Matrix2x2, Matrix2x2)` throw an exception if no inverse exists for matrix `b` = Changed the parameter `other` in `Equals(Matrix2x2)` to a nullable equivalent and added a nullability check * Matrix3x3 + Made `Matrix3x3` into a record + : IStaticMatrix<Matrix2x2> + this[Index, Index] + this[Range, Range] - : IMatrix<Matrix2x2> - override Equals(object?) - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(Matrix3x3, Matrix3x3) - operator !=(Matrix3x3, Matrix3x3) = Turned `Matrix3x3` into a `class` (from a `struct`) = Added a nullability attribute to the return type of `Inverse()` = Added a nullability attribute to the return type of `operator -(Matrix3x3)` = Marked `Equals(Matrix3x3)` as virtual = Made `GetHashCode()` invoke the base method = Changed the parameter `other` in `Equals(Matrix3x3)` to a nullable equivalent and added a nullability check = Made `Cofactor()` use a preset rather than parameterless constructor = Made `operator /(Matrix3x3, Matrix3x3)` throw an exception if no inverse exists for matrix `b` * Matrix4x4 + Made `Matrix4x4` into a record + : IStaticMatrix<Matrix2x2> + this[Index, Index] + this[Range, Range] - : IMatrix<Matrix2x2> - override Equals(object?) - ToString(string?) - ToString(IFormatProvider) - Clone() - operator ==(Matrix4x4, Matrix4x4) - operator !=(Matrix4x4, Matrix4x4) = Added a nullability attribute to the return type of `Inverse()` = Added a nullability attribute to the return type of `operator -(Matrix4x4)` = Turned `Matrix4x4` into a `class` (from a `struct`) = Marked `Equals(Matrix4x4)` as virtual = Made `GetHashCode()` invoke the base method = Changed the parameter `other` in `Equals(Matrix4x4)` to a nullable equivalent and added a nullability check = Made `Cofactor()` use a preset rather than parameterless constructor = Made `operator /(Matrix4x4, Matrix4x4)` throw an exception if no inverse exists for matrix `b` * Vector2d + Made `Vector2d` into a record + : IAbsolute<Vector2d> + : IAverage<Vector2d> + : IClampMagnitude<Vector2d> + : ICross<Vector2d, Vector3d> + : IDot<Vector2d, float> + : IFromTuple<Vector2d, (Angle angle, float mag)> + : ILerp<Vector2d, float> + : IMax<Vector2d> + : IMagnitude<float> + : IMedian<Vector2d> + : IMin<Vector2d> + : IPresets2D<Vector2d> + : ISplittable<Vector2d, (Angle[] rots, float[] mags)> + : ISubtract<Vector2d> + : ISum<Vector2d> + float Magnitude + operator Vector2d((Angle angle, float mag)) - : ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?, Angle.Type) - ToString(IFormatProvider, Angle.Type) - operator ==(Vector2d, Vector2d) - operator !=(Vector2d, Vector2d) = Made the tuple variable names lowercase in `SplitArray(Vector2d[])` = Made `GetHashCode()` invoke the base method = Made `ToString(Angle.Type)` resemble a record string * Vector3d + Made `Vector3d` into a record + : IAbsolute<Vector3d> + : IAverage<Vector3d> + : IClampMagnitude<Vector3d> + : ICross<Vector3d> + : IDot<Vector3d, float> + : IFromTuple<Vector3d, (Angle yaw, Angle pitch, float mag)> + : IIndexAll<Angle> + : IIndexRangeAll<Angle> + : ILerp<Vector3d, float> + : IMax<Vector3d> + : IMagnitude<float> + : IMedian<Vector3d> + : IMin<Vector3d> + : IPresets3D<Vector3d> + : ISplittable<Vector3d, (Angle[] yaws, Angle[] pitches, float[] mags)> + : ISubtract<Vector3d> + : ISum<Vector3d> + float Magnitude + this[Index] + this[Range] + operator Vector3d((Angle yaw, Angle pitch, float mag)) - ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?, Angle.Type) - ToString(IFormatProvider, Angle.Type) - operator ==(Vector3d, Vector3d) - operator !=(Vector3d, Vector3d) = Renamed the tuple variable names in `SplitArray(Vector3d[])` = Made `GetHashCode()` invoke the base method = Made `ToString(Angle.Type)` resemble a record string = Moved `IMatrix<T>` to `Nerd_STF.Mathematics.Abstract` + : IAbsolute<T> + : ICeiling<T> + : IClamp<T> + : IDivide<T> + : IFloor<T> + : ILerp<T, float> + : IProduct<T> + : IRound<T> - : ICloneable - : IEnumerable = Added a nullability attribute to the return type of `Inverse()` * Geometry * Box2D + Made `Box2D` into a record + : IAbsolute<Box2D> + : IAverage<Box2D> + : ICeiling<Box2D> + : IClamp<Box2D> + : IFloor<Box2D> + : ILerp<Box2D, float> + : IMedian<Box2D> + : IRound<Box2D> + : IShape2D<float> + : ISplittable<Box2D, (Vert[] centers, Float2[] sizes)> + Round(Box2D) + PrintMembers(StringBuilder) - : ICloneable - Max(Box2D[]) - Min(Box2D[]) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Box2D, Box2D) - operator !=(Box2D, Box2D) = Turned `Box2D` into `class` (from a `struct`) = Marked `Equals(Box2D)` as virtual = Made `GetHashCode()` invoke the base method = Changed the parameter `other` in `Equals(Box2D)` to a nullable equivalent and added a nullability check * Box3D + Made `Box3D` into a record + : IAbsolute<Box3D> + : IAverage<Box3D> + : ICeiling<Box3D> + : IClamp<Box3D> + : IFloor<Box3D> + : ILerp<Box3D, float> + : IMedian<Box3D> + : IRound<Box3D> + : IShape3D<float> + : ISplittable<Box3D, (Vert[] centers, Float3[] sizes)> + Round(Box3D) + PrintMembers(StringBuilder) - : ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Box3D, Box3D) - operator !=(Box3D, Box3D) = Fixed an ambiguity in `Ceiling(Box3D)` = Fixed an ambiguity in `Floor(Box3D)` = Turned `Box3D` into `class` (from a `struct`) = Marked `Equals(Box3D)` as virtual = Made `GetHashCode()` invoke the base method = Changed the parameter `other` in `Equals(Box3D)` to a nullable equivalent and added a nullability check * Line + Made `Line` into a record + : IAbsolute<Line> + : IAverage<Line> + : ICeiling<Line> + : IClamp<Line> + : IFloor<Line> + : IFromTuple<Line, (Vert start, Vert end)> + : IIndexAll<Vert> + : IIndexRangeAll<Vert> + : ILerp<Line, float> + : IMedian<Line> + : IPresets3D<Line> + : IRound<Line> + : ISplittable<Line, (Vert[] starts, Vert[] ends)> + Round(Line) + PrintMembers(StringBuilder) + operator Line((Vert start, Vert end)) - : ICloneable - Clone() - Max(Line[]) - Min(Line[]) - override Equals(object?) - ToString(string?) - ToString(IFormatProvider) - operator ==(Line, Line) - operator !=(Line, Line) = Turned `Line` into `class` (from a `struct`) = Made `GetHashCode()` invoke the base method = Marked `CompareTo(Line)` as deprecated, as it's a bit confusing = Marked `operator >(Line, Line)` as deprecated, as it's a bit confusing = Marked `operator <(Line, Line)` as deprecated, as it's a bit confusing = Marked `operator >=(Line, Line)` as deprecated, as it's a bit confusing = Marked `operator <=(Line, Line)` as deprecated, as it's a bit confusing = Changed the parameter `other` in `Equals(Line)` to a nullable equivalent and added a nullability check = Changed the parameter `other` in `CompareTo(Line)` to a nullable equivalent and added a nullability check * Polygon * Triangulate = Replaced all `Exception`s thrown with `Nerd_STFException`s - Max(Polygon[]) - Min(Polygon[]) - ToString(string?) - ToString(IFormatProvider) = Changed the deprecation removal notice from version 2.4.0 to 2.5.0 * Quadrilateral + Made `Quadrilateral` a record + : IAbsolute<Quadrilateral> + : IAverage<Quadrilateral> + : ICeiling<Quadrilateral> + : IClamp<Quadrilateral> + : IFloor<Quadrilateral> + : IFromTuple<Quadrilateral, (Vert a, Vert b, Vert c, Vert d)> + : IIndexAll<Vert> + : IIndexRangeAll<Vert> + : ILerp<Quadrilateral, float> + : IRound<Quadrilateral> + : IShape2D<float> + Round(Quadrilateral) + PrintMembers(StringBuilder) + operator Quadrilateral((Vert a, Vert b, Vert c, Vert d)) - : ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Quadrilateral, Quadrilateral) - operator !=(Quadrilateral, Quadrilateral) = Turned `Quadrilateral` into a `class` (from a `struct`) = Made `GetHashCode()` invoke the base method = Marked `Equals(Quadrilateral)` as virtual = Changed the parameter `other` in `Equals(Quadrilateral)` to a nullable equivalent and added a nullability check * Sphere + Made `Sphere` a record + : IAverage<Sphere> + : ICeiling<Sphere> + : IClamp<Sphere> + : IFloor<Sphere> + : IFromTuple<Sphere, (Vert center, float radius)> + : ILerp<Sphere, float> + : IMax<Sphere> + : IMedian<Sphere> + : IMin<Sphere> + : IRound<Sphere> + : ISplittable<Sphere, (Vert[] centers, float[] radii)> + Round(Sphere) + PrintMembers(StringBuilder) + operator Sphere((Vert center, float radius)) - : ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Sphere, Sphere) - operator !=(Sphere, Sphere) = Made `GetHashCode()` invoke the base method = Marked `Equals(float)` as deprecated. It will be removed in 2.5.0 = Marked `CompareTo(float)` as deprecated. It will be removed in 2.5.0 = Marked `operator ==(Sphere, float)` as deprecated. It will be removed in 2.5.0 = Marked `operator !=(Sphere, float)` as deprecated. It will be removed in 2.5.0 = Marked `operator >(Sphere, Sphere)` as deprecated. It will be removed in 2.5.0 = Marked `operator <(Sphere, Sphere)` as deprecated. It will be removed in 2.5.0 = Marked `operator >(Sphere, float)` as deprecated. It will be removed in 2.5.0 = Marked `operator <(Sphere, float)` as deprecated. It will be removed in 2.5.0 = Marked `operator >=(Sphere, Sphere)` as deprecated. It will be removed in 2.5.0 = Marked `operator <=(Sphere, Sphere)` as deprecated. It will be removed in 2.5.0 = Marked `operator >=(Sphere, float)` as deprecated. It will be removed in 2.5.0 = Marked `operator <=(Sphere, float)` as deprecated. It will be removed in 2.5.0 = Marked `Equals(Sphere)` as virtual = Changed the parameter `other` in `Equals(Sphere)` to a nullable equivalent and added a nullability check = Changed the parameter `other` in `CompareTo(Sphere)` to a nullable equivalent and added a nullability check = Turned `Sphere` into a `class` (from a `struct`) * Triangle + Made `Triangle` a record + : IAbsolute<Triangle> + : IAverage<Triangle> + : ICeiling<Triangle> + : IClamp<Triangle> + : IFloor<Triangle> + : IFromTuple<Triangle, (Vert a, Vert b, Vert c)> + : IIndexAll<Vert> + : IIndexRangeAll<Vert> + : ILerp<Triangle, float> + : IRound<Triangle> + : IShape2D<float> + Round(Triangle) + PrintMembers(StringBuilder) + operator Triangle((Vert a, Vert b, Vert c)) - : ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Triangle, Triangle) - operator !=(Triangle, Triangle) = Turned `Triangle` into a `class` (from a `struct`) = Made `GetHashCode()` invoke the base method = Marked `Equals(Triangle)` as virtual = Changed the parameter `other` in `Equals(Triangle)` to a nullable equivalent and added a nullability check * Vert + Round(Vert) - ToString(string?) - ToString(IFormatProvider) = Moved `ISubdividable<T>` to `Nerd_STF.Mathematics.Abstract` and renamed it to `ISubdivide<T>` = Moved `ITriangulatable<T>` to `Nerd_STF.Mathematics.Abstract` and renamed it to `ITriangulate<T>` * NumberSystems * Complex + Marked `Complex` as a record + Added parameters `float`, `float` + : IAbsolute<Complex> + : IAverage<Complex> + : ICeiling<Complex> + : IClamp<Complex> + : IClampMagnitude<Complex, float> + : IDivide<Complex> + : IDot<Complex, float> + : IFloor<Complex> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<Complex, float> + : IMax<Complex> + : IMedian<Complex> + : IMin<Complex> + : IPresets2D<Complex> + : IProduct<Complex> + : IRound<Complex> + : ISplittable<Complex, (float[] Us, float[] Is)> + : ISum<Complex> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Complex((float, float)) - : ICloneable<Complex> - Complex(float, float) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Complex, Complex) - operator !=(Complex, Complex) = Added an assignment for `u` = Added an assignment for `i` = Marked `operator >(Complex, Complex)` as deprecated, as it's a bit confusing = Marked `operator <(Complex, Complex)` as deprecated, as it's a bit confusing = Marked `operator >=(Complex, Complex)` as deprecated, as it's a bit confusing = Marked `operator <=(Complex, Complex)` as deprecated, as it's a bit confusing * Quaternion + Marked `Quaternion` as a record + Added parameters `float`, `float`, `float`, `float` + : IAbsolute<Quaternion> + : IAverage<Quaternion> + : ICeiling<Quaternion> + : IClamp<Quaternion> + : IClampMagnitude<Quaternion, float> + : IDivide<Quaternion> + : IDot<Quaternion, float> + : IFloor<Quaternion> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<Quaternion, float> + : IMax<Quaternion> + : IMedian<Quaternion> + : IMin<Quaternion> + : IPresets4D<Quaternion> + : IProduct<Quaternion> + : IRound<Quaternion> + : ISplittable<Quaternion, (float[] Us, float[] Is, float[] Js, float[] Ks)> + : ISum<Quaternion> + HighW + LowW + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Quaternion((float, float, float, float)) - : ICloneable - Quaternion(float, float, float, float) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Quaternion, Quaternion) - operator !=(Quaternion, Quaternion) = Added an assignment for `u` = Added an assignment for `i` = Added an assignment for `j` = Added an assignment for `k` = Fixed a mistake in `operator -(Quaternion)` that would just return the clone of the current instance rather than the proper negative. = Made `GetHashCode()` invoke the base method = Marked `operator >(Quaternion, Quaternion)` as deprecated, as it's a bit confusing = Marked `operator <(Quaternion, Quaternion)` as deprecated, as it's a bit confusing = Marked `operator >=(Quaternion, Quaternion)` as deprecated, as it's a bit confusing = Marked `operator <=(Quaternion, Quaternion)` as deprecated, as it's a bit confusing = Marked `Near` as deprecated, as it's replaced with `LowW`. = Marked `Far` as deprecated, as it's replaced with `HighW`. * Samples * Constants = Fixed a typo and renamed `TwelthRoot2` to `TwelfthRoot2` = Made `EulerMascheroniConstant` reference `EulerConstant`, since they are the same = Made `LiebSquareIceConstant` more simplified = Renamed `UniversalHyperbolicConstant` to `UniversalParabolicConstant` (oops) = Renamed `RegularPaperfoldingSequence` to `RegularPaperfoldingConstant` = Simplified `SecondHermiteConstant` * Angle + : IAbsolute<Angle> + : IAverage<Angle> + : IClamp<Angle> + : ILerp<Angle, float> + : IMax<Angle> + : IMedian<Angle> + : IMin<Angle> + : IPresets2D<Angle> + operator Angle((float, Type)) - ToString(string?, Type) - ToString(IFormatProvider, Type) = Improved the `SplitArray(Type, Angle[])` to use another function for conversion. * Float2 + Marked `Float2` as a record + : IAbsolute<Float2> + : IAverage<Float2> + : ICeiling<Float2, Int2> + : IClamp<Float2> + : IClampMagnitude<Float2, float> + : ICross<Float2, Float3> + : IDivide<Float2> + : IDot<Float2, float> + : IFloor<Float2, Int2> + : IFromTuple<Float2, (float x, float y)> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<Float2, float> + : IMax<Float2> + : IMedian<Float2> + : IMin<Float2> + : IPresets2D<Float2> + : IProduct<Float2> + : IRound<Float2, Int2> + : ISplittable<Float2, (float[] Xs, float[] Ys)> + : ISubtract<Float2> + : ISum<Float2> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Float2((float, float)) - : ICloneable<Float2> - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Float2, Float2) - operator !=(Float2, Float2) = Made `Ceiling(Float2)` return an `Int2` instead of a `Float2` = Made `Floor(Float2)` return an `Int2` instead of a `Float2` = Made `Round(Float2)` return an `Int2` instead of a `Float2` = Made `Max(Float2[])` compare magnitudes directly = Made `Min(Float2[])` compare magnitudes directly = Marked `CompareTo(Float2)` as deprecated, as it's a bit confusing = Marked `operator >(Float2, Float2)` as deprecated, as it's a bit confusing = Marked `operator <(Float2, Float2)` as deprecated, as it's a bit confusing = Marked `operator >=(Float2, Float2)` as deprecated, as it's a bit confusing = Marked `operator <=(Float2, Float2)` as deprecated, as it's a bit confusing * Float3 + Marked `Float3` as a record + : IAbsolute<Float3> + : IAverage<Float3> + : ICeiling<Float3, Int3> + : IClamp<Float3> + : IClampMagnitude<Float3, float> + : ICross<Float3> + : IDivide<Float3> + : IDot<Float3, float> + : IFloor<Float3, Int3> + : IFromTuple<Float3, (float x, float y, float z)> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<Float3, float> + : IMathOperators<Float3> + : IMax<Float3> + : IMedian<Float3> + : IMin<Float3> + : IPresets3D<Float3> + : IProduct<Float3> + : IRound<Float3, Int3> + : ISplittable<Float3, (float[] Xs, float[] Ys, float[] Zs)> + : ISubtract<Float3> + : ISum<Float3> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Float3((float, float, float)) - : ICloneable - Float3(float, float, float) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Float3, Float3) - operator !=(Float3, Float3) = Made `Ceiling(Float3)` return an `Int3` instead of a `Float3` = Made `Floor(Float3)` return an `Int3` instead of a `Float3` = Made `Round(Float3)` return an `Int3` instead of a `Float3` = Made `Max(Float3[])` compare magnitudes directly = Made `Min(Float3[])` compare magnitudes directly = Made `GetHashCode()` invoke the base method = Marked `CompareTo(Float3)` as deprecated, as it's a bit confusing = Marked `operator >(Float3, Float3)` as deprecated, as it's a bit confusing = Marked `operator <(Float3, Float3)` as deprecated, as it's a bit confusing = Marked `operator >=(Float3, Float3)` as deprecated, as it's a bit confusing = Marked `operator <=(Float3, Float3)` as deprecated, as it's a bit confusing * Float4 + Marked `Float4` as a record + : IAbsolute<Float4> + : IAverage<Float4> + : ICeiling<Float4, Int4> + : IClamp<Float4> + : IClampMagnitude<Float4, float> + : IDivide<Float4> + : IDot<Float4, float> + : IFloor<Float4, Int4> + : IFromTuple<Float4, (float x, float y, float z, float w)> + : IIndexAll<float> + : IIndexRangeAll<float> + : ILerp<Float4, float> + : IMathOperators<Float4> + : IMax<Float4> + : IMedian<Float4> + : IMin<Float4> + : IPresets4D<Float4> + : IProduct<Float4> + : IRound<Float4, Int4> + : ISplittable<Float4, (float[] Xs, float[] Ys, float[] Zs, float[] Ws)> + : ISubtract<Float4> + : ISum<Float4> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Float4((float, float, float, float)) - : ICloneable - Float4(float, float, float, float) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Float4, Float4) - operator !=(Float4, Float4) = Made `Ceiling(Float4)` return an `Int4` instead of a `Float4` = Made `Floor(Float4)` return an `Int4` instead of a `Float4` = Made `Round(Float4)` return an `Int4` instead of a `Float4` = Made `Max(Float4[])` compare magnitudes directly = Made `Min(Float4[])` compare magnitudes directly = Made `GetHashCode()` invoke the base method = Marked `CompareTo(Float4)` as deprecated, as it's a bit confusing = Marked `operator >(Float4, Float4)` as deprecated, as it's a bit confusing = Marked `operator <(Float4, Float4)` as deprecated, as it's a bit confusing = Marked `operator >=(Float4, Float4)` as deprecated, as it's a bit confusing = Marked `operator <=(Float4, Float4)` as deprecated, as it's a bit confusing * Int2 + Marked `Int2` as a record + : IAbsolute<Int2> + : IAverage<Int2> + : IClamp<Int2> + : IClampMagnitude<Int2, int> + : ICross<Int2, Int3> + : IDivide<Int2> + : IDot<Int2, int> + : IFromTuple<Int2, (int x, int y)> + : IIndexAll<int> + : IIndexRangeAll<int> + : ILerp<Int2, float> + : IMathOperators<Int2> + : IMax<Int2> + : IMedian<Int2> + : IMin<Int2> + : IPresets2D<Int2> + : IProduct<Int2> + : ISplittable<Int2, (int[] Xs, int[] Ys)> + : ISubtract<Int2> + : ISum<Int2> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Int2((int, int)) - : ICloneable - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Int2, Int2) - operator !=(Int2, Int2) = Made `Max(Int2[])` compare magnitudes directly = Made `Min(Int2[])` compare magnitudes directly = Made `GetHashCode()` invoke the base method = Marked `CompareTo(Int2)` as deprecated, as it's a bit confusing = Marked `operator >(Int2, Int2)` as deprecated, as it's a bit confusing = Marked `operator <(Int2, Int2)` as deprecated, as it's a bit confusing = Marked `operator >=(Int2, Int2)` as deprecated, as it's a bit confusing = Marked `operator <=(Int2, Int2)` as deprecated, as it's a bit confusing * Int3 + Marked `Int3` as a record + : IAbsolute<Int3> + : IAverage<Int3> + : IClamp<Int3> + : IClampMagnitude<Int3, int>, + : ICross<Int3> + : IDivide<Int3> + : IDot<Int3, int> + : IFromTuple<Int3, (int x, int y, int z)> + : IIndexAll<int> + : IIndexRangeAll<int> + : ILerp<Int3, float> + : IMathOperators<Int3> + : IMax<Int3> + : IMedian<Int3> + : IMin<Int3> + : IProduct<Int3> + : ISplittable<Int3, (int[] Xs, int[] Ys, int[] Zs)> + : ISubtract<Int3> + : ISum<Int3> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Int3((int, int, int)) - : ICloneable() - Int3(int, int, int) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Int3, Int3) - operator !=(Int3, Int3) = Made `Max(Int3[])` compare magnitudes directly = Made `Min(Int3[])` compare magnitudes directly = Made `GetHashCode()` invoke the base method = Marked `CompareTo(Int3)` as deprecated, as it's a bit confusing = Marked `operator >(Int3, Int3)` as deprecated, as it's a bit confusing = Marked `operator <(Int3, Int3)` as deprecated, as it's a bit confusing = Marked `operator >=(Int3, Int3)` as deprecated, as it's a bit confusing = Marked `operator <=(Int3, Int3)` as deprecated, as it's a bit confusing * Int4 + Marked `Int4` as a record + : IAbsolute<Int4> + : IAverage<Int4> + : IClamp<Int4> + : IClampMagnitude<Int4, int> + : IDivide<Int4> + : IDot<Int4, int> + : IFromTuple<Int4, (int x, int y, int z, int w)> + : IIndexAll<int> + : IIndexRangeAll<int> + : ILerp<Int4, float> + : IMathOperators<Int4> + : IMax<Int4> + : IMedian<Int4> + : IMin<Int4> + : IProduct<Int4> + : ISplittable<Int4, (int[] Xs, int[] Ys, int[] Zs, int[] Ws)> + : ISubtract<Int4> + : ISum<Int4> + this[Index] + this[Range] + PrintMembers(StringBuilder) + operator Int4((int, int, int, int)) - : ICloneable - Int4(int, int, int, int) - Clone() - override Equals(object?) - override ToString() - ToString(string?) - ToString(IFormatProvider) - operator ==(Int4, Int4) - operator !=(Int4, Int4) = Marked `Deep` as deprecated = Made `Max(Int4[])` compare magnitudes directly = Made `Min(Int4[])` compare magnitudes directly = Made `GetHashCode()` invoke the base method = Marked `CompareTo(Int4)` as deprecated, as it's a bit confusing = Marked `operator >(Int4, Int4)` as deprecated, as it's a bit confusing = Marked `operator <(Int4, Int4)` as deprecated, as it's a bit confusing = Marked `operator >=(Int4, Int4)` as deprecated, as it's a bit confusing = Marked `operator <=(Int4, Int4)` as deprecated, as it's a bit confusing * Mathf = Forced `Max<T>(T[])` to not return a nullable object = Forced `Min<T>(T[])` to not return a nullable object = Renamed a parameter `value` in `Mathf.Lerp(int, int, float, bool)` to `t` = Replaced a `ContainsKey(float)` call with a `TryGetValue(float, out float)` call in `MakeEquation(Dictionary<float, float>)` = Removed a useless call to `Absolute(int)` in `PowerMod(int, int, int)` = Simplified a list initialization in `Factors(int)` * Miscellaneous + AssemblyConfig * GlobalUsings + global using Nerd_STF.Graphics.Abstract + global using Nerd_STF.Mathematics.Abstract + global using System.Text + global using System.Runtime.Serialization + Nerd_STF = Marked `Foreach(object)` as deprecated. Why would you even use this? = Marked `Foreach<T>(T)` as deprecated. Why would you even use this? = Moved `IClosest<T>` to `Nerd_STF.Mathematics.Abstract` and renamed it to `IClosestTo<T>` = Moved `IContainer<T>` to `Nerd_STF.Mathematics.Abstract` and renamed it to `IContains<T>`Downloads
-
released this
2022-11-12 11:24:34 -05:00 | 1 commits to v2.3 since this releaseNerd_STF v2.3.1
Everything has been tested and most things work!
WARNING:
All of the matrix classes have had all of their constructors' row and column variables swapped. You'll have to switch all your variables around.
Sorry for the inconvenience :(.The
v2.3.1.xupdates go through every single field and method in Nerd_STF to make sure it works correctly.
You see, up until now I haven't actually tested literally anything at all. Partly because I didn't have the tools to and partly because I was lazy. But now, it's guarenteed to work in most cases (unless I like don't pick up some bug, you know).Hi everyone! Everything has been checked now and most stuff works! Not everything, like the triangle and quadrilateral area stuff, but for the most part, it's all cool and good.
I've just now remembered how bad the Polygon struct was. It's getting remade. The v2.4.0 update will be mostly geometry focused, so that'll be the best time to figure out how to fix this stuff. The new Polygon struct will be much better, trust me.
But all the matrix structs work like charm now! I'm honestly suprised they worked as well as they did before (especially the dynamic matrix). They can now be relied on.
Next up is the documentation update. Stay tuned!
(This may be another update with beta parts, but I'm not sure yet. We'll see).* Nerd_STF * Exceptions * DifferingVertCountException = Marked as deprecated (uses deprecated struct `Polygon`) * Extensions * Container2DExtension + GetSize<T>(T[,]) + SwapDimensions<T>(T[,], Int2?) * Flatten<T>(T[,]) = Replaced a `size` parameter from an `Int2` to an `Int2?` * Mathematics * Algebra * IMatrix - ToDictionary() * Matrix + Cofactor() + IdentityIsh(Int2) + MinorOf(Int2) - ToDictionary() = Fixed `Determinant()` = Fixed `Minors()` = Fixed `Inverse()` = Made `Identity(Int2)` only work with square matricies (since that's only when an identity exists) = Marked the struct as `readonly` = Simplified `Transpose()` = Swapped row variables with column variables in all constructors (and methods that require those constructors). = Swapped code for `Adjugate()` with `Cofactor()` * Matrix2x2 + Cofactor() + operator *(Matrix2x2, Float2) + operator /(Matrix2x2, Float2) - ToDictionary() = Swapped code for `Adjugate()` with `Cofactor()` = Swapped row variables with column variables in all constructors (and methods that require those constructors). = Fixed `this[int, int]` to compensate for the swapped variables. = Fixed `operator -(Matrix2x2, Matrix2x2)` to not have an addition in one of the variables (fun). = Fixed `Inverse()` = Fixed `explicit operator Matrix2x2(Matrix)` * Matrix3x3 + Cofactor() + operator *(Matrix3x3, Float3) + operator /(Matrix3x3, Float3) - ToDictionary() = Swapped code for `Adjugate()` with `Cofactor()` = Swapped row variables with column variables in all constructors (and methods that require those constructors). = Fixed `this[int, int]` to compensate for the swapped variables. = Fixed `Determinant()` = Fixed `Inverse()` = Fixed `explicit operator Matrix3x3(Matrix)` * Matrix4x4 + Cofactor() + override string ToString() + operator *(Matrix4x4, Float4) + operator /(Matrix4x4, Float4) - ToDictionary() = Swapped code for `Adjugate()` with `Cofactor()` = Swapped row variables with column variables in all constructors (and methods that require those constructors). = Fixed `this[int, int]` to compensate for the swapped variables. = Fixed `Determinant()` = Fixed a typo in `Absolute(Matrix4x4)`, `Ceiling(Matrix4x4)`, `Floor(Matrix4x4)`, and `Round(Matrix4x4)` = Fixed a typo in `Row1`, `Row2`, `Row3`, and `Row4`. Oops. = Fixed some missing elements in `SplitArray(Matrix4x4[])` = Fixed `explicit operator Matrix4x4(Matrix)` * Geometry * Box2D = Simplified some code in `Perimeter` * Box3D + SurfaceArea = Renamed `Area` to `Volume` = Simplified some code in `Perimeter` * Polygon = Marked as deprecated (will be redone in v2.4.0) = Simplified collection initialization in `Triangulate()` * Quadrilateral - explicit operator Triangle(Polygon) = Marked `Area` as deprecated (uses deprecated `Triangle.Area` field) * Sphere = Fixed `ClosestTo(Vert)` * Triangle - explicit operator Triangle(Polygon) = Marked `Area` as deprecated (will be fixed in v2.4.0) * Vert = Marked as deprecated (will be removed in v2.4.0). = Optimized `Normalized` to not clone more than required.Downloads
-
released this
2022-10-31 11:50:49 -04:00 | 40 commits to main since this releaseNerd_STF v2.3.1.52
Read this to know what works and what doesn't!
The
v2.3.1.xupdates go through every single field and method in Nerd_STF to make sure it works correctly.
You see, up until now I haven't actually tested literally anything at all. Partly because I didn't have the tools to and partly because I was lazy. But now, it's guarenteed to work in most cases (unless I like don't pick up some bug, you know).The following types have been checked for the most part and can be safe to use:
Nerd_STF.FileTypeNerd_STF.FillNerd_STF.Fill2DNerd_STF.ForeachNerd_STF.IClosestNerd_STF.IContainerNerd_STF.IEncapsulatorNerd_STF.IGroupNerd_STF.IGroup2DNerd_STF.LoggerNerd_STF.LogMessageNerd_STF.LogSeverityNerd_STF.ModifierNerd_STF.Modifier2DNerd_STF.Exceptions.DifferingVertCountExceptionNerd_STF.Exceptions.DisconnectedLinesExceptionNerd_STF.Exceptions.InvalidSizeExceptionNerd_STF.Exceptions.Nerd_STFExceptionNerd_STF.Exceptions.NoInverseExceptionNerd_STF.Extensions.Container2DExtensionNerd_STF.Extensions.ConversionExtensionNerd_STF.Extensions.EquationExtensionNerd_STF.Extensions.ToFillExtensionNerd_STF.Graphics.CMYKANerd_STF.Graphics.CMYKAByteNerd_STF.Graphics.ColorChannelNerd_STF.Graphics.HSVANerd_STF.Graphics.HSVAByteNerd_STF.Graphics.IColorNerd_STF.Graphics.IColorByteNerd_STF.Graphics.IlluminationFlagsNerd_STF.Graphics.IlluminationModelNerd_STF.Graphics.ImageNerd_STF.Graphics.MaterialNerd_STF.Graphics.RGBANerd_STF.Graphics.RGBAByteNerd_STF.Graphics.TextureConfigNerd_STF.Mathematics.AngleNerd_STF.Mathematics.CalculusNerd_STF.Mathematics.EquationNerd_STF.Mathematics.Float2Nerd_STF.Mathematics.Float3Nerd_STF.Mathematics.Float4Nerd_STF.Mathematics.Int2Nerd_STF.Mathematics.Int3Nerd_STF.Mathematics.Int4Nerd_STF.Mathematics.MathfNerd_STF.Mathematics.Geometry.ISubdividableNerd_STF.Mathematics.NumberSystems.ComplexNerd_STF.Mathematics.NumberSystems.QuaternionNerd_STF.Mathematics.Samples.ConstantsNerd_STF.Mathematics.Samples.Equations
The following types haven't been checked yet, and should still be taken with a grain of salt:
Nerd_STF.Mathematics.Algebra.IMatrixNerd_STF.Mathematics.Algebra.MatrixNerd_STF.Mathematics.Algebra.Matrix2x2Nerd_STF.Mathematics.Algebra.Matrix3x3Nerd_STF.Mathematics.Algebra.Matrix4x4Nerd_STF.Mathematics.Algebra.Vector2dNerd_STF.Mathematics.Algebra.Vector3dNerd_STF.Mathematics.Geometry.Box2DNerd_STF.Mathematics.Geometry.Box3DNerd_STF.Mathematics.Geometry.ITriangulatableNerd_STF.Mathematics.Geometry.LineNerd_STF.Mathematics.Geometry.PolygonNerd_STF.Mathematics.Geometry.QuadrilateralNerd_STF.Mathematics.Geometry.SphereNerd_STF.Mathematics.Geometry.TriangleNerd_STF.Mathematics.Geometry.Vert
16 left to go.
Honestly, most of the time taken for this update was spent on Quaternions. Turns out my multiply function was subtley wrong. Who knew!
Just a relief to be done with it. The other stuff wasn't too much of a problem. Matrixes are probably going to be a huge pain if they don't work first try, though. That'll be in the next update, probably.I should also note that I just realized after way to long that the
.csprojfile isn't included in the Github. It's included in this new release, and sometime in the future I'll go back and add a correctly working.csprojfile to all the other releases as well (with the exception of the legacy Nerd_STF 2021 versions likely. We'll see). I'll now not include the/binbuild files. They'll be in the release and you can build it yourself if you need to now. Anyway, have fun.* Nerd_STF * Extensions * Container2DExtension = Fixed `Flatten<T>(T[,], Int2)` = `GetColumn<T>(T[,], int, int)` and `GetRow<T>(T[,], int, int)` have been fixed (They had swapped roles) * ConversionExtension + ToFill<T>(T[]) + ToFill<T>(T[,], Int2) + ToFill2D<T>(T[,]) * EquationExtension = Fixed `Scale(Equation, float, ScaleType)` by swapping all instances of `x` and `value` (oops) = Moved `ScaleType` out of parent class `EquationExtension` and into namespace `Nerd_STF` * Geometry * ITriangulatable + TriangulateAll<T>(T[]) where T : ITriangulatable * Graphics + Renamed `IColor` to `IColorFloat` = Made IColor an object both `IColorFloat` and `IColorByte` inherit from. * CMYKA = Made `ToRGBA()` include the alpha value of the color. * CMYKAByte = In `ToHSVA()` and `ToHSVAByte()`, swapped some conversions from `RGBA` to `CMYKA` * HSVA = Made `ToRGBA()` include the alpha value of the color. * Image - Removed some useless constructors = Fixed some broken constructors * Mathematics * Algebra * Vector2d = Removed a default parameter value in `ToString(Angle.Type)` to prevent confusion. * Vector3d + string ToString() + string ToString(Angle.Type) + string ToString(IFormatProvider, Angle.Type) = Fixed `ToXYZ()` * NumberSystems * Complex + operator ~(Complex) * Quaternion + Rotate(Float3) + Rotate(Vector3d) + operator ~(Quaternion) - ToVector() = Gave `IJK` proper get and set accessors. = Renamed some terms in `ToString()` = Fixed the `Quaternion.FromAngles(*)` methods to do the proper thing. = Fixed `Quaternion.Rotate(Quaternion)` = Fixed `Quaternion.Rotate(Float3)` = Fixed `operator *(Quaternion, Quaternion)` = Optimized `GetAxis()` = Simplified `ToXYZ()` = Swapped the order of `Rotate(Quaternion)` = Made `GetAxis()` not accidentally create an infinite vector. * Angle + Complimentary + Supplementary * Float2 + operator *(Float2, Quaternion) * Float3 + operator *(Float3, Quaternion) = Fixed `ToVector()`Downloads
-
released this
2022-09-30 17:09:00 -04:00 | 8 commits to v2.3 since this releaseNerd_STF v2.3.1.39
Read this to know what works and what doesn't!
The
v2.3.1.xupdates go through every single field and method in Nerd_STF to make sure it works correctly.
You see, up until now I haven't actually tested literally anything at all. Partly because I didn't have the tools to and partly because I was lazy. But now, it's guarenteed to work in most cases (unless I like don't pick up some bug, you know).The following types have been checked for the most part and can be safe to use:
Nerd_STF.FileTypeNerd_STF.FillNerd_STF.Fill2DNerd_STF.ForeachNerd_STF.IClosestNerd_STF.IContainerNerd_STF.IEncapsulatorNerd_STF.IGroupNerd_STF.IGroup2DNerd_STF.LoggerNerd_STF.LogMessageNerd_STF.LogSeverityNerd_STF.ModifierNerd_STF.Modifier2DNerd_STF.Exceptions.DifferingVertCountExceptionNerd_STF.Exceptions.DisconnectedLinesExceptionNerd_STF.Exceptions.InvalidSizeExceptionNerd_STF.Exceptions.Nerd_STFExceptionNerd_STF.Exceptions.NoInverseExceptionNerd_STF.Extensions.ToFillExtensionNerd_STF.Graphics.ColorChannelNerd_STF.Graphics.IlluminationFlagsNerd_STF.Graphics.IlluminationModelNerd_STF.Graphics.MaterialNerd_STF.Graphics.TextureConfigNerd_STF.Mathematics.AngleNerd_STF.Mathematics.CalculusNerd_STF.Mathematics.EquationNerd_STF.Mathematics.Float2Nerd_STF.Mathematics.Float3Nerd_STF.Mathematics.Float4Nerd_STF.Mathematics.Int2Nerd_STF.Mathematics.Int3Nerd_STF.Mathematics.Int4Nerd_STF.Mathematics.MathfNerd_STF.Mathematics.NumberSystems.ComplexNerd_STF.Mathematics.NumberSystems.Quaternion- With the exception of the following methods:
Quaternion.FromAngles(Angle, Angle, Angle?)Quaternion.FromAngles(Float3, Angle.Type)Quaternion.FromVector(Vector3d)GetAngle()GetAxis()ToAngles()ToVector()
- With the exception of the following methods:
Nerd_STF.Mathematics.Samples.ConstantsNerd_STF.Mathematics.Samples.Equations
The following types haven't been checked yet, and should still be taken with a grain of salt:
Nerd_STF.Extensions.Container2DExtensionNerd_STF.Extensions.ConversionExtensionNerd_STF.Extensions.EquationExtensionNerd_STF.Graphics.CMYKANerd_STF.Graphics.CMYKAByteNerd_STF.Graphics.HSVANerd_STF.Graphics.HSVAByteNerd_STF.Graphics.IColorNerd_STF.Graphics.IColorByteNerd_STF.Graphics.ImageNerd_STF.Graphics.RGBANerd_STF.Graphics.RGBAByteNerd_STF.Mathematics.Algebra.IMatrixNerd_STF.Mathematics.Algebra.MatrixNerd_STF.Mathematics.Algebra.Matrix2x2Nerd_STF.Mathematics.Algebra.Matrix3x3Nerd_STF.Mathematics.Algebra.Matrix4x4Nerd_STF.Mathematics.Algebra.Vector2dNerd_STF.Mathematics.Algebra.Vector3dNerd_STF.Mathematics.Geometry.Box2DNerd_STF.Mathematics.Geometry.Box3DNerd_STF.Mathematics.Geometry.ISubdividableNerd_STF.Mathematics.Geometry.ITriangulatableNerd_STF.Mathematics.Geometry.LineNerd_STF.Mathematics.Geometry.PolygonNerd_STF.Mathematics.Geometry.QuadrilateralNerd_STF.Mathematics.Geometry.SphereNerd_STF.Mathematics.Geometry.TriangleNerd_STF.Mathematics.Geometry.Vert
I've checked a total of 39 types, with 29 left to go. It sounds like I'm over halfway, but really I've saved all of the annoying ones that are likely wrong to be checked next. My 39 done includes a bunch of really simple types that never needed checking in the first place too. But there are some done, like any type in the Mathematics directory.
* Nerd_STF * Exceptions + MathException + UndefinedException * Extensions + EquationExtension * Mathematics * NumberSystems * Complex + Inverse + GetAngle() = Fixed `ToString()` and all overloads from adding a redundant negative sign sometimes in the imaginary component. = Replaced the `/` operator with a multiplication by its inverse. * Quaternion + Inverse = Fixed `ToString()` and all overloads from adding a redundant negative sign sometimes in the i, j, and k components. = Replaced the `/` operator with a multiplication by its inverse. * Algebra * Vector2d - static Product(params Vector2d[]) - static Divide(Vector2d, params Vector2d[]) - operator *(Vector2d, Angle) - operator *(Vector2d, Vector2d) - operator /(Vector2d, Angle) - operator /(Vector2d, Vector2d) = Made `ToXYZ()` actually work * Vector3d - static Product(params Vector3d[]) - static Divide(Vector3d, params Vector3d[]) - operator *(Vector3d, Angle) - operator *(Vector3d, Vector3d) - operator /(Vector3d, Angle) - operator /(Vector3d, Vector3d) * Calculus + GetDynamicIntegral(Equation, Equation, Equation, float) = Made `GetDerivative(Equation, float)` calculate specific values on the fly, and removed the min/max. * Graphics * HSVA - static LerpSquared(HSVA, HSVA, float, Angle.Type, bool = true) - operator *(HSVA, HSVA) - operator /(HSVA, HSVA) * HSVAByte - static LerpSquared(HSVAByte, HSVAByte, float, Angle.Type, bool = true) * Angle + Reflected + static Max(bool, params Angle[]) + static Min(bool, params Angle[]) - operator *(Angle, Angle) - operator /(Angle, Angle) = Made `Angle(float, Type)` use a lambda expression = Made `Bounded` use the `AbsoluteMod()` function instead of the default `%` expression = Replaced an accidental `Mathf.Floor()` call with a `Mathf.Round()` call in `Floor()` = Made `operator -(Angle)` actually give you the reverse angle (not the reflected angle) * Float2 = Made `Median(params Float2)` not use an unneccesary average = Made `ToVector()` not create an angle out of `ArcTan(float)`, as it already is one = Optimized `Divide(Float2, params Float2[])` to divide a product instead of individually dividing = Optimized `Subtract(Float2, params Float2[])` to subtract a sum instead of individually subtracting * Float3 = Made `Median(params Float3)` not use an unneccesary average = Made `ToVector()` not create an angle out of the arc trig functions, as they already are angles = Optimized `Divide(Float3, params Float3[])` to divide a product instead of individually dividing = Optimized `Subtract(Float3, params Float3[])` to subtract a sum instead of individually subtracting * Float4 = Marked `Far` and `Near` as obsolete/deprecated, as they have been replaced by `HighW` and `LowW` = Made `Median(params Float4)` not use an unneccesary average = Optimized `Divide(Float4, params Float4[])` to divide a product instead of individually dividing = Optimized `Subtract(Float4, params Float4[])` to subtract a sum instead of individually subtracting * Int2 = Made `Median(params Float4)` not use an unneccesary average = Optimized `Divide(Float4, params Float4[])` to divide a product instead of individually dividing = Optimized `Subtract(Float4, params Float4[])` to subtract a sum instead of individually subtracting * Int3 = Made `Median(params Float4)` not use an unneccesary average = Optimized `Divide(Float4, params Float4[])` to divide a product instead of individually dividing = Optimized `Subtract(Float4, params Float4[])` to subtract a sum instead of individually subtracting * Int4 + LowW = Marked `Far` as obsolete/deprecated, as it has been replaced by `HighW` = Made `Median(params Float4)` not use an unneccesary average = Optimized `Divide(Float4, params Float4[])` to divide a product instead of individually dividing = Optimized `Subtract(Float4, params Float4[])` to subtract a sum instead of individually subtracting * Mathf + AbsoluteMod(float) + Binomial(int, int, float) + Factors(int) + PowerMod(int, int, int) = Fixed `Ceiling(float)` from rounding up when it shouldn't = Made `Median(params float[])` actually calculate the right midpoint = Removed two unneeded `Average(float, float)` calls in `Median(params float[])` = Replaced the `Floor(float)` and `Ceiling(float)` calls in `Median(params float[])` with a better alternative = Replaced the mod in `Sin(float)` with an `AbsoluteMod(float, float)` call = Made `MadeEquation(Dictionary<float, float>)` actually work. = Added caching to Power(float, int) for the absolute max = Fixed an if statement and added another one to prevent extra computation in `Power(float, int)` = Added caching to Power(int, int) for the absolute max = Fixed an if statement and added another one to prevent extra computation in `Power(int, int)` = Made the `Lerp(int, int, float, bool)` function not call itself infinitely many times. = Replaced a multiplication with a division in `Root(float, float)` = Made the `Average(int[])` function give you the int average instead of the float average (unlike `Average(float[])`) = Replaced the float return statement with an Angle in `ArcCos(float)` = Replaced the float return statement with an Angle in `ArcCot(float)` = Replaced the float return statement with an Angle in `ArcCsc(float)` = Replaced the float return statement with an Angle in `ArcSec(float)` = Replaced the float return statement with an Angle in `ArcSin(float)` = Replaced the float return statement with an Angle in `ArcTan(float)` = Replaced the float return statement with an Angle in `ArcTan2(float, float)` = Optimized `ArcCos(float)` to use presets = Optimized `Divide(float, params float[])` to use other functions. = Optimized `Divide(int, params int[])` to use other functions. = Optimized `Subtract(float, params float[])` to subtract a sum instead of individually subtracting = Optimized `Subtract(int, params int[])` to subtract a sum instead of individually subtracting = Made `Clamp(int, int, int)` not remake code and use `Clamp(float, float, float)` = Made `Lerp(int, int, float, bool)` cast to an int instead of flooring = Made `Lerp(float, float, float, bool)` not break when clamping and A is greater than B = Made `Median<T>(params T[])` not use an unneccesary average = Made `Power(int, int)` not care about absolutes = Made `Variance(params float[])` correctly calculate variance. * Quaternion = Made `GetAngle()` not create an angle out of `ArcCos(float)`, as it already is one = Made `ToAngles()` not create angles out of arc trig functions, as they are already angles * Samples * Constants = Swapped `DegToRad` and `RadToDeg` * Equations = Moved `static Scale(Equation, float, ScaleType)` to `EquationExtension` = Moved `ScaleType` to `EquationExtension`Downloads
-
released this
2022-08-02 12:31:54 -04:00 | 10 commits to v2.3 since this releaseThis update adds lots of linear algebra tools, like matrixes and vectors, as well as new number systems, like complex numbers and quaternions.
* Nerd_STF + Extensions + ConversionExtension + Container2DExtension + ToFillExtension + Foreach + IGroup2D + Modifier + Modifier2D * IGroup<T> + ToFill() * Exceptions + InvalidSizeException + NoInverseException * Graphics * CMYKA + ToFill() + static Round(CMYKA) = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * CMYKAByte + ToFill() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * HSVA + ToFill() + static Round(HSVA, Angle.Type) = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * HSVAByte + ToFill() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Image = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Material = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` = Merged 2 if statements into 1 in `override bool Equals(object?)` * RGBA + ToFill() + ToVector() + static Round(RGBA) = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * RGBAByte + ToFill() + ToVector() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Mathematics + Algebra + IMatrix + Matrix2x2 + Matrix3x3 + Matrix4x4 + Vector2d + Vector3d + NumberSystems + Complex + Quaternion + Samples + Equations + ScaleType = Moved `Constants` file to Samples folder. * Geometry * Box2D = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Box3D = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Line + ToFill() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Polygon + ToFill() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Quadrilateral + ToFill() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Sphere = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Triangle + ToFill() = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Vert + ToFill() + ToVector() = Made `Vert(Float2)` not recreate a float group, and instead use itself. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Angle + static Down + static Left + static Right + static Up + static Round(Angle, Type) = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Float2 + ToFill() + ToVector() + static Round(Float2) + implicit operator Float2(Complex) + explicit operator Float2(Quaternion) + explicit operator Float2(Matrix) + operator *(Float2, Matrix) + operator /(Float2, Matrix) = Made `Normalized` multiply by the inverse square root instead of dividing by the square root. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Float3 + ToFill() + ToVector() + static Round(Float3) + implicit operator Float3(Complex) + explicit operator Float3(Quaternion) + explicit operator Float3(Matrix) + operator *(Float3, Matrix) + operator /(Float3, Matrix) = Made `Normalized` multiply by the inverse square root instead of dividing by the square root. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Float4 + ToFill() + static Round(Float4) + implicit operator Float4(Complex) + implicit operator Float4(Quaternion) + explicit operator Float4(Matrix) + operator *(Float4, Matrix) + operator /(Float4, Matrix) = Made `Normalized` multiply by the inverse square root instead of dividing by the square root. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` = Renamed `Float4.Deep` to `Float4.Near` * Int2 + ToFill() + explicit operator Int2(Complex) + explicit operator Int2(Quaternion) + explicit operator Int2(Matrix) + operator *(Int2, Matrix) + operator /(Int2, Matrix) = Made `Normalized` multiply by the inverse square root instead of dividing by the square root. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Int3 + ToFill() + explicit operator Int3(Complex) + explicit operator Int3(Quaternion) + explicit operator Int3(Matrix) + operator *(Int3, Matrix) + operator /(Int3, Matrix) = Made `Normalized` multiply by the inverse square root instead of dividing by the square root. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Int4 + explicit operator Int4(Complex) + explicit operator Int4(Quaternion) + explicit operator Int4(Matrix) + operator *(Int4, Matrix) + operator /(Int4, Matrix) = Made `Normalized` multiply by the inverse square root instead of dividing by the square root. = Replaced a false statement with `base.Equals(object?)` in `override bool Equals(object?)` * Mathf + Cos(Angle) + Cot(Angle) + Csc(Angle) + Dot(float[], float[]) + Dot(float[][]) + Max<T>(T[]) where T : IComparable<T> + Median<T>(T[]) + Min<T>(T[]) where T : IComparable<T> + Sec(Angle) + Sin(Angle) + Tan(Angle) * Miscellaneous * GlobalUsings.cs + global using Nerd_STF.Collections + global using Nerd_STF.Extensions + global using Nerd_STF.Mathematics.Algebra + global using Nerd_STF.Mathematics.NumberSystems + global using Nerd_STF.Mathematics.SamplesDownloads