diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/AbsBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/AbsBenchmark.cs deleted file mode 100644 index afdf43e36f..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/AbsBenchmark.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [SimpleJob(RunStrategy.Throughput)] - public class AbsBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Abs(X); -#else - return (float)Math.Abs(X); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Abs(X); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Abs(XInt); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } -} diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/ExpBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/ExpBenchmark.cs deleted file mode 100644 index 772762ebeb..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/ExpBenchmark.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class ExpSmallBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Exp(X); -#else - return (float)Math.Exp(X); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Exp(X); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class ExpBigBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Exp(X); -#else - return (float)Math.Exp(X); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Exp(X); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) (_random.NextDouble() * 10) + 10f; - } - } -} \ No newline at end of file diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/FloorBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/FloorBenchmark.cs deleted file mode 100644 index bbd1dfd989..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/FloorBenchmark.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [SimpleJob(RunStrategy.Throughput)] - public class FloorBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Floor(X); -#else - return (float)Math.Floor(X); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Floor(X); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Floor(XInt); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } -} diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/LogBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/LogBenchmark.cs deleted file mode 100644 index 6838db77af..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/LogBenchmark.cs +++ /dev/null @@ -1,74 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class LogSmallBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Log(X); -#else - return (float)Math.Log(X); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Log(X); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class LogBigBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Log(X); -#else - return (float)Math.Log(X); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Log(X); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) (_random.NextDouble() * 1000); - } - } -} \ No newline at end of file diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/PowBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/PowBenchmark.cs deleted file mode 100644 index eb1453ce82..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/PowBenchmark.cs +++ /dev/null @@ -1,115 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class PowSmallBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - [ParamsSource("GenerateNumber")] public float Y; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Pow(X, Y); -#else - return (float)Math.Pow(X, Y); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Pow(X, Y); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class PowBigBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - [ParamsSource("GenerateNumber")] public float Y; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Pow(X, Y); -#else - return (float)Math.Pow(X, Y); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Pow(X, Y); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) (_random.NextDouble() * 10) + 10f; - } - } - - [MemoryDiagnoser] - [SimpleJob(RunStrategy.Throughput)] - public class PowIntBenchmark - { - [ParamsSource("GenerateNumber")] public int X; - [ParamsSource("GenerateNumber")] public int Y; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Pow(X, Y); -#else - return (float)Math.Pow(X, Y); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Pow(X, Y); - } - - [Benchmark] - public float SilkInt() - { - return Scalar.Pow(X, Y); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return _random.Next(-1000, 1000); - } - } -} \ No newline at end of file diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/RoundBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/RoundBenchmark.cs deleted file mode 100644 index e245e977b1..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/RoundBenchmark.cs +++ /dev/null @@ -1,271 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [SimpleJob(RunStrategy.Throughput)] - public class RoundAllBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - [ParamsAllValues] public MidpointRounding Mode; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Round(X, Mode); -#else - return (float)Math.Round(X, Mode); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Round(X, Mode); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Round(XInt, Mode); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - -#if !NET48 - [SimpleJob(RunStrategy.Throughput)] - public class RoundToPositiveInfinityBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Round(X, MidpointRounding.ToPositiveInfinity); -#else - return (float)Math.Round(X, MidpointRounding.ToPositiveInfinity); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Round(X, MidpointRounding.ToPositiveInfinity); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Round(XInt, MidpointRounding.ToPositiveInfinity); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - - [SimpleJob(RunStrategy.Throughput)] - public class RoundToNegativeInfinityBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Round(X, MidpointRounding.ToNegativeInfinity); -#else - return (float)Math.Round(X, MidpointRounding.ToNegativeInfinity); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Round(X, MidpointRounding.ToNegativeInfinity); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Round(XInt, MidpointRounding.ToNegativeInfinity); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - - [SimpleJob(RunStrategy.Throughput)] - public class RoundToZeroBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Round(X, MidpointRounding.ToZero); -#else - return (float)Math.Round(X, MidpointRounding.ToZero); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Round(X, MidpointRounding.ToZero); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Round(XInt, MidpointRounding.ToZero); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } -#endif - - [SimpleJob(RunStrategy.Throughput)] - public class RoundAwayFromZeroBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int) X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Round(X, MidpointRounding.AwayFromZero); -#else - return (float) Math.Round(X, MidpointRounding.AwayFromZero); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Round(X, MidpointRounding.AwayFromZero); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Round(XInt, MidpointRounding.AwayFromZero); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } - - [SimpleJob(RunStrategy.Throughput)] - public class RoundToEvenBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Round(X, MidpointRounding.ToEven); -#else - return (float)Math.Round(X, MidpointRounding.ToEven); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Round(X, MidpointRounding.ToEven); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Round(XInt, MidpointRounding.ToEven); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } -} diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/SinBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/SinBenchmark.cs deleted file mode 100644 index f1b4924856..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/SinBenchmark.cs +++ /dev/null @@ -1,38 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; - -namespace Silk.NET.Maths.Benchmark -{ - public class SinBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Sin(X); -#else - return (float)Math.Sin(X); -#endif - } - - [Benchmark] - public float Silk() - { - return Scalar.Sin(X); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) _random.NextDouble(); - } - } -} diff --git a/eng/benchmarks/Silk.NET.Maths.Benchmarks/SqrtBenchmark.cs b/eng/benchmarks/Silk.NET.Maths.Benchmarks/SqrtBenchmark.cs deleted file mode 100644 index e91ae90f4f..0000000000 --- a/eng/benchmarks/Silk.NET.Maths.Benchmarks/SqrtBenchmark.cs +++ /dev/null @@ -1,53 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Collections.Generic; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -namespace Silk.NET.Maths.Benchmark -{ - [SimpleJob(RunStrategy.Throughput)] - public class SqrtBenchmark - { - [ParamsSource("GenerateNumber")] public float X; - public int XInt; - - [GlobalSetup] - public void GlobalSetup() - { - XInt = (int)X; - } - - [Benchmark(Baseline = true)] - public float Sys() - { -#if MATHF - return MathF.Sqrt(X); -#else - return (float)Math.Sqrt(X); -#endif - } - - [Benchmark] - public float SilkFloat() - { - return Scalar.Sqrt(X); - } - - [Benchmark] - public int SilkInt() - { - return Scalar.Sqrt(XInt); - } - - private const int NumbersTested = 1; - private static Random _random = new Random(); - public IEnumerable GenerateNumber() - { - for (int i = 0; i < NumbersTested; i++) - yield return (float) (_random.NextDouble() + 5) * 100; - } - } -} diff --git a/sources/Maths/Maths/Box2D.cs b/sources/Maths/Maths/Box2D.cs index c9b4945be4..7d377738c5 100644 --- a/sources/Maths/Maths/Box2D.cs +++ b/sources/Maths/Maths/Box2D.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Serialization; @@ -14,13 +15,14 @@ namespace Silk.NET.Maths [DataContract] public struct Box2D : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { /// /// The min. /// [DataMember] public Vector2D Min; + /// /// The max. /// @@ -76,7 +78,7 @@ public Box2D(T minX, T minY, T maxX, T maxY) /// The center of this box. /// [IgnoreDataMember] - public Vector2D Center => (Min + Max) / Scalar.Two; + public Vector2D Center => (Min + Max) / T.CreateTruncating(2); /// /// The size of this box. @@ -92,8 +94,8 @@ public Box2D(T minX, T minY, T maxX, T maxY) /// True if this box contains the point; False otherwise. /// This does consider a point on the edge contained. public bool Contains(Vector2D point) - => Scalar.GreaterThanOrEqual(point.X, Min.X) && Scalar.GreaterThanOrEqual(point.Y, Min.Y) - && Scalar.LessThanOrEqual(point.X, Max.X) && Scalar.LessThanOrEqual(point.Y, Max.Y); + => (point.X >= Min.X) && (point.Y >= Min.Y) + && (point.X <= Max.X) && (point.Y <= Max.Y); /// /// Calculates whether this box contains another box @@ -102,20 +104,8 @@ public bool Contains(Vector2D point) /// True if this box contains the given box; False otherwise. /// This does consider a box that touches the edge contained. public bool Contains(Box2D other) - => Scalar.GreaterThanOrEqual(other.Min.X, Min.X) && Scalar.GreaterThanOrEqual(other.Min.Y, Min.Y) - && Scalar.LessThanOrEqual(other.Max.X, Max.X) && Scalar.LessThanOrEqual(other.Max.Y, Max.Y); - - /// - /// Calculates the distance to the nearest edge from the point. - /// - /// The point. - /// The distance. - public T GetDistanceToNearestEdge(Vector2D point) - { - var dx = Scalar.Max(Scalar.Max(Scalar.Subtract(Min.X, point.X), Scalar.Zero), Scalar.Subtract(point.X, Max.X)); - var dy = Scalar.Max(Scalar.Max(Scalar.Subtract(Min.Y, point.Y), Scalar.Zero), Scalar.Subtract(point.Y, Max.Y)); - return Scalar.Sqrt(Scalar.Add(Scalar.Multiply(dx, dx), Scalar.Multiply(dy, dy))); - } + => (other.Min.X >= Min.X) && (other.Min.Y >= Min.Y) + && (other.Max.X <= Max.X) && (other.Max.Y <= Max.Y); /// /// Calculates this box translated by a given distance. @@ -148,9 +138,9 @@ public Box2D GetScaled(Vector2D scale, Vector2D anchor) /// The type of the scale. /// The calculated box. public Box2D GetScaled(Vector2D scale, Vector2D anchor) - where TScale : unmanaged, IFormattable, IEquatable, IComparable + where TScale : INumber { - return this.As().GetScaled(scale, anchor.As()).As(); + return this.AsTruncating().GetScaled(scale, anchor.AsTruncating()).AsTruncating(); } /// @@ -209,9 +199,64 @@ public override int GetHashCode() /// /// The type to cast to /// The casted box - public Box2D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Box2D As() + where TOther : INumber { return new(Min.As(), Max.As()); } + + /// + /// Returns this box casted to + /// + /// The type to cast to + /// The casted box + public Box2D AsChecked() + where TOther : INumber + { + return new(Min.AsChecked(), Max.AsChecked()); + } + + /// + /// Returns this box casted to + /// + /// The type to cast to + /// The casted box + public Box2D AsSaturating() + where TOther : INumber + { + return new(Min.AsSaturating(), Max.AsSaturating()); + } + + /// + /// Returns this box casted to + /// + /// The type to cast to + /// The casted box + public Box2D AsTruncating() + where TOther : INumber + { + return new(Min.AsTruncating(), Max.AsTruncating()); + } + } + + /// + /// Helper methods to work with + /// + public static class Box2D + { + /// + /// Calculates the distance to the nearest edge from the point. + /// + /// The box. + /// The point. + /// The distance. + public static T GetDistanceToNearestEdge(this Box2D box, Vector2D point) + where T : INumber, IRootFunctions + { + var dx = T.Max(T.Max(box.Min.X - point.X, T.Zero), point.X - box.Max.X); + var dy = T.Max(T.Max(box.Min.Y - point.Y, T.Zero), point.Y - box.Max.Y); + return T.Sqrt((dx * dx) + (dy * dy)); + } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Box3D.cs b/sources/Maths/Maths/Box3D.cs index 36c4ab815c..5ef5851122 100644 --- a/sources/Maths/Maths/Box3D.cs +++ b/sources/Maths/Maths/Box3D.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Serialization; @@ -14,13 +15,14 @@ namespace Silk.NET.Maths [DataContract] public struct Box3D : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { /// /// The min. /// [DataMember] public Vector3D Min; + /// /// The max. /// @@ -80,7 +82,7 @@ public Box3D(T minX, T minY, T minZ, T maxX, T maxY, T maxZ) /// The center of this box. /// [IgnoreDataMember] - public Vector3D Center => (Min + Max) / Scalar.Two; + public Vector3D Center => (Min + Max) / T.CreateTruncating(2); /// /// The size of this box. @@ -96,10 +98,8 @@ public Box3D(T minX, T minY, T minZ, T maxX, T maxY, T maxZ) /// True if this box contains the point; False otherwise. /// This does consider a point on the edge contained. public bool Contains(Vector3D point) - => Scalar.GreaterThanOrEqual(point.X, Min.X) && Scalar.GreaterThanOrEqual(point.Y, Min.Y) - && Scalar.GreaterThanOrEqual(point.Z, Min.Z) - && Scalar.LessThanOrEqual(point.X, Max.X) && Scalar.LessThanOrEqual(point.Y, Max.Y) - && Scalar.LessThanOrEqual(point.Z, Max.Z); + => (point.X >= Min.X) && (point.Y >= Min.Y) && (point.Z >= Min.Z) + && (point.X <= Max.X) && (point.Y <= Max.Y) && (point.Z <= Max.Z); /// /// Calculates whether this box contains another box @@ -108,23 +108,8 @@ public bool Contains(Vector3D point) /// True if this box contains the given box; False otherwise. /// This does consider a box that touches the edge contained. public bool Contains(Box3D other) - => Scalar.GreaterThanOrEqual(other.Min.X, this.Min.X) && Scalar.GreaterThanOrEqual(other.Min.Y, this.Min.Y) - && Scalar.GreaterThanOrEqual(other.Min.Z, this.Min.Z) - && Scalar.LessThanOrEqual(other.Max.X, this.Max.X) && Scalar.LessThanOrEqual(other.Max.Y, this.Max.Y) - && Scalar.LessThanOrEqual(other.Max.Z, this.Max.Z); - - /// - /// Calculates the distance to the nearest edge from the point. - /// - /// The point. - /// The distance. - public T GetDistanceToNearestEdge(Vector3D point) - { - var dx = Scalar.Max(Scalar.Max(Scalar.Subtract(Min.X, point.X), Scalar.Zero), Scalar.Subtract(point.X, Max.X)); - var dy = Scalar.Max(Scalar.Max(Scalar.Subtract(Min.Y, point.Y), Scalar.Zero), Scalar.Subtract(point.Y, Max.Y)); - var dz = Scalar.Max(Scalar.Max(Scalar.Subtract(Min.Z, point.Z), Scalar.Zero), Scalar.Subtract(point.Z, Max.Z)); - return Scalar.Sqrt(Scalar.Add(Scalar.Add(Scalar.Multiply(dx, dx), Scalar.Multiply(dy, dy)), Scalar.Multiply(dz, dz))); - } + => (other.Min.X >= this.Min.X) && (other.Min.Y >= this.Min.Y) && (other.Min.Z >= this.Min.Z) + && (other.Max.X <= this.Max.X) && (other.Max.Y <= this.Max.Y) && (other.Max.Z <= this.Max.Z); /// /// Calculates this box translated by a given distance. @@ -148,7 +133,7 @@ public Box3D GetScaled(Vector3D scale, Vector3D anchor) var max = (scale * (Max - anchor)) + anchor; return new(min, max); } - + /// /// Calculates a new box scaled by the given scale around the given anchor. /// @@ -157,12 +142,12 @@ public Box3D GetScaled(Vector3D scale, Vector3D anchor) /// The anchor. /// The calculated box. public Box3D GetScaled(Vector3D scale, Vector3D anchor) - where TScale : unmanaged, IFormattable, IEquatable, IComparable + where TScale : INumberBase { - var convertedAnchor = anchor.As(); - var min = (scale * (Min.As() - convertedAnchor)) + convertedAnchor; - var max = (scale * (Max.As() - convertedAnchor)) + convertedAnchor; - return new Box3D(min.As(), max.As()); + var convertedAnchor = anchor.AsTruncating(); + var min = (scale * (Min.AsTruncating() - convertedAnchor)) + convertedAnchor; + var max = (scale * (Max.AsTruncating() - convertedAnchor)) + convertedAnchor; + return new Box3D(min.AsTruncating(), max.AsTruncating()); } /// @@ -215,15 +200,38 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this box casted to /// /// The type to cast to /// The casted box - public Box3D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Box3D As() + where TOther : INumber { return new(Min.As(), Max.As()); } } -} \ No newline at end of file + + /// + /// Helper methods to work with + /// + public static class Box3D + { + /// + /// Calculates the distance to the nearest edge from the point. + /// + /// The box. + /// The point. + /// The distance. + public static T GetDistanceToNearestEdge(this Box3D box, Vector3D point) + where T : INumber, IRootFunctions + { + var dx = T.Max(T.Max(box.Min.X - point.X, T.Zero), point.X - box.Max.X); + var dy = T.Max(T.Max(box.Min.Y - point.Y, T.Zero), point.Y - box.Max.Y); + var dz = T.Max(T.Max(box.Min.Z - point.Z, T.Zero), point.Z - box.Max.Z); + return T.Sqrt((dx * dx) + (dy * dy) + (dz * dz)); + } + } +} diff --git a/sources/Maths/Maths/Circle.cs b/sources/Maths/Maths/Circle.cs index fafcc12f4d..5468fd3be5 100644 --- a/sources/Maths/Maths/Circle.cs +++ b/sources/Maths/Maths/Circle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.Serialization; namespace Silk.NET.Maths @@ -12,13 +13,15 @@ namespace Silk.NET.Maths [Serializable] [DataContract] public struct Circle - : IEquatable> where T : unmanaged, IFormattable, IEquatable, IComparable + : IEquatable> + where T : IRootFunctions { /// /// The center. /// [DataMember] public Vector2D Center; + /// /// The radius. /// @@ -51,43 +54,19 @@ public Circle(T centerX, T centerY, T radius) /// The diameter. /// [IgnoreDataMember] - public T Diameter => Scalar.Multiply(Radius, Scalar.Two); + public T Diameter => Radius * T.CreateTruncating(2); /// /// The radius squared. /// [IgnoreDataMember] - public T SquaredRadius => Scalar.Multiply(Radius, Radius); + public T SquaredRadius => Radius * Radius; /// /// The circumference. /// [IgnoreDataMember] - public T Circumference => Scalar.Multiply(Scalar.Tau, Radius); - - /// - /// Calculates whether this circle contains a point. - /// - /// The point. - /// True if this circle contains the point; False otherwise. - /// This does consider a point on the edge contained. - public bool Contains(Vector2D point) - { - return Scalar.LessThanOrEqual(Vector2D.DistanceSquared(point, Center), Radius); - } - - /// - /// Calculates whether this circle contains another circle - /// - /// The circle. - /// True if this circle contains the given circle; False otherwise. - /// This does consider a circle that touches the edge contained. - public bool Contains(Circle other) - { - var distanceSquared = Vector2D.DistanceSquared(Center, other.Center); - var radiusDiff = Scalar.Subtract(Radius, other.Radius); - return Scalar.LessThanOrEqual(distanceSquared, Scalar.Multiply(radiusDiff, radiusDiff)); - } + public T Circumference => T.Tau * Radius; /// /// Calculates the squared distance to the nearest edge from the point. @@ -96,7 +75,7 @@ public bool Contains(Circle other) /// The distance squared. public T GetDistanceToNearestEdgeSquared(Vector2D point) { - return Scalar.Subtract(Vector2D.DistanceSquared(Center, point), SquaredRadius); + return Vector2D.DistanceSquared(Center, point) - SquaredRadius; } /// @@ -104,7 +83,7 @@ public T GetDistanceToNearestEdgeSquared(Vector2D point) /// /// The point. /// The distance. - public T GetDistanceToNearestEdge(Vector2D point) => Scalar.Sqrt(GetDistanceToNearestEdgeSquared(point)); + public T GetDistanceToNearestEdge(Vector2D point) => T.Sqrt(GetDistanceToNearestEdgeSquared(point)); /// /// Calculates a new circle translated by a given distance. @@ -116,16 +95,6 @@ public Circle GetTranslated(Vector2D distance) return new(Center + distance, Radius); } - /// - /// Calculates a circle inflated to contain the given point. - /// - /// The point. - /// The circle. - public Circle GetInflated(Vector2D point) - { - return new(Center, Scalar.Max(Radius, Vector2D.Distance(Center, point))); - } - /// Returns a boolean indicating whether the given Circle is equal to this Circle instance. /// The Circle to compare this instance to. /// True if the other Circle is equal to this instance; False otherwise. @@ -166,15 +135,62 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this circle casted to /// /// The type to cast to /// The casted circle - public Circle As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Circle As() where TOther : IRootFunctions + { + return new(Center.As(), TOther.CreateTruncating(Radius)); + } + } + + /// + /// Helper methods to work with + /// + public static class Circle + { + /// + /// Calculates whether this circle contains a point. + /// + /// The circle. + /// The point. + /// True if this circle contains the point; False otherwise. + /// This does consider a point on the edge contained. + public static bool Contains(this Circle circle, Vector2D point) + where T : INumber, IRootFunctions + { + return Vector2D.DistanceSquared(point, circle.Center) <= circle.Radius; + } + + /// + /// Calculates whether this circle contains another circle + /// + /// The circle. + /// The other circle. + /// True if this circle contains the given circle; False otherwise. + /// This does consider a circle that touches the edge contained. + public static bool Contains(this Circle circle, Circle other) + where T : INumber, IRootFunctions + { + var distanceSquared = Vector2D.DistanceSquared(circle.Center, other.Center); + var radiusDiff = circle.Radius - other.Radius; + return distanceSquared <= radiusDiff * radiusDiff; + } + + /// + /// Calculates a circle inflated to contain the given point. + /// + /// The circle. + /// The point. + /// The circle. + public static Circle GetInflated(this Circle circle, Vector2D point) + where T : INumber, IRootFunctions { - return new(Center.As(), Scalar.As(Radius)); + return new(circle.Center, T.Max(circle.Radius, Vector2D.Distance(circle.Center, point))); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Cube.cs b/sources/Maths/Maths/Cube.cs index c5ef00cca7..f04423f3e7 100644 --- a/sources/Maths/Maths/Cube.cs +++ b/sources/Maths/Maths/Cube.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Serialization; @@ -14,13 +15,14 @@ namespace Silk.NET.Maths [DataContract] public struct Cube : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { /// /// The origin. /// [DataMember] public Vector3D Origin; + /// /// The size. /// @@ -92,7 +94,7 @@ public Cube(T originX, T originY, T originZ, T sizeX, T sizeY, T sizeZ) /// Half the size of this cube. /// [IgnoreDataMember] - public Vector3D HalfSize => Size / Scalar.Two; + public Vector3D HalfSize => Size / T.CreateTruncating(2); /// /// Calculates whether this cube contains a point. @@ -103,9 +105,8 @@ public Cube(T originX, T originY, T originZ, T sizeX, T sizeY, T sizeZ) public bool Contains(Vector3D point) { var max = Max; - return Scalar.GreaterThanOrEqual(point.X, Origin.X) && Scalar.GreaterThanOrEqual - (point.Y, Origin.Y) && Scalar.GreaterThanOrEqual(point.Z, Origin.Z) && Scalar.LessThanOrEqual - (point.X, max.X) && Scalar.LessThanOrEqual(point.Y, max.Y) && Scalar.LessThanOrEqual(point.Z, max.Z); + return (point.X >= Origin.X) && (point.Y >= Origin.Y) && (point.Z >= Origin.Z) + && (point.X <= max.X) && (point.Y <= max.Y) && (point.Z <= max.Z); } /// @@ -118,24 +119,8 @@ public bool Contains(Cube other) { var tMax = this.Max; var oMax = other.Max; - return Scalar.GreaterThanOrEqual(other.Origin.X, this.Origin.X) && Scalar.GreaterThanOrEqual - (other.Origin.Y, this.Origin.Y) && Scalar.GreaterThanOrEqual - (other.Origin.Z, this.Origin.Z) && Scalar.LessThanOrEqual(oMax.X, tMax.X) && Scalar.LessThanOrEqual - (oMax.Y, tMax.Y) && Scalar.GreaterThanOrEqual(oMax.Y, tMax.Y); - } - - /// - /// Calculates the distance to the nearest edge from the point. - /// - /// The point. - /// The distance. - public T GetDistanceToNearestEdge(Vector3D point) - { - var max = Max; - var dx = Scalar.Max(Scalar.Max(Scalar.Subtract(Origin.X, point.X), Scalar.Zero), Scalar.Subtract(point.X, max.X)); - var dy = Scalar.Max(Scalar.Max(Scalar.Subtract(Origin.Y, point.Y), Scalar.Zero), Scalar.Subtract(point.Y, max.Y)); - var dz = Scalar.Max(Scalar.Max(Scalar.Subtract(Origin.Z, point.Z), Scalar.Zero), Scalar.Subtract(point.Z, max.Z)); - return Scalar.Sqrt(Scalar.Add(Scalar.Add(Scalar.Multiply(dx, dx), Scalar.Multiply(dy, dy)), Scalar.Multiply(dz, dz))); + return (other.Origin.X >= this.Origin.X) && (other.Origin.Y >= this.Origin.Y) && (other.Origin.Z >= this.Origin.Z) + && (oMax.X <= tMax.X) && (oMax.Y <= tMax.Y) && (oMax.Y <= tMax.Y); } /// @@ -160,7 +145,7 @@ public Cube GetScaled(Vector3D scale, Vector3D anchor) var max = (scale * (Max - anchor)) + anchor; return new(min, max - min); } - + /// /// Calculates a new cube scaled by the given scale around the given anchor. /// @@ -169,12 +154,12 @@ public Cube GetScaled(Vector3D scale, Vector3D anchor) /// The anchor. /// The calculated cube. public Cube GetScaled(Vector3D scale, Vector3D anchor) - where TScale : unmanaged, IFormattable, IEquatable, IComparable + where TScale : INumberBase { - var convertedAnchor = anchor.As(); - var min = (scale * (Origin.As() - convertedAnchor)) + convertedAnchor; - var max = (scale * (Max.As() - convertedAnchor)) + convertedAnchor; - return new(min.As(), (max - min).As()); + var convertedAnchor = anchor.AsTruncating(); + var min = (scale * (Origin.AsTruncating() - convertedAnchor)) + convertedAnchor; + var max = (scale * (Max.AsTruncating() - convertedAnchor)) + convertedAnchor; + return new(min.AsTruncating(), (max - min).AsTruncating()); } /// @@ -229,15 +214,39 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this circle casted to /// /// The type to cast to /// The casted cube - public Cube As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Cube As() + where TOther : INumber { return new(Origin.As(), Max.As()); } } -} \ No newline at end of file + + /// + /// Helper methods to work with + /// + public static class Cube + { + /// + /// Calculates the distance to the nearest edge from the point. + /// + /// The cube. + /// The point. + /// The distance. + public static T GetDistanceToNearestEdge(Cube cube, Vector3D point) + where T : INumber, IRootFunctions + { + var max = cube.Max; + var dx = T.Max(T.Max(cube.Origin.X - point.X, T.Zero), point.X - max.X); + var dy = T.Max(T.Max(cube.Origin.Y - point.Y, T.Zero), point.Y - max.Y); + var dz = T.Max(T.Max(cube.Origin.Z - point.Z, T.Zero), point.Z - max.Z); + return T.Sqrt((dx * dx) + (dy * dy) + (dz * dz)); + } + } +} diff --git a/sources/Maths/Maths/Matrix2X2.Ops.cs b/sources/Maths/Maths/Matrix2X2.Ops.cs deleted file mode 100644 index 0d768ab0ce..0000000000 --- a/sources/Maths/Maths/Matrix2X2.Ops.cs +++ /dev/null @@ -1,93 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - /// - /// Methods for working with - /// - public static class Matrix2X2 - { - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Add(Matrix2X2 value1, Matrix2X2 value2) where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Multiply(Matrix2X2 value1, Matrix2X2 value2) where T : unmanaged, IFormattable, IEquatable, IComparable => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Multiply(Matrix3X2 value1, Matrix2X2 value2) where T : unmanaged, IFormattable, IEquatable, IComparable => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X2 value1, Matrix2X3 value2) where T : unmanaged, IFormattable, IEquatable, IComparable => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Multiply(Matrix2X2 value1, T value2) where T : unmanaged, IFormattable, IEquatable, IComparable => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector2D value1, Matrix2X2 value2) where T : unmanaged, IFormattable, IEquatable, IComparable => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Negate(Matrix2X2 value) where T : unmanaged, IFormattable, IEquatable, IComparable => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Subtract(Matrix2X2 value1, Matrix2X2 value2) where T : unmanaged, IFormattable, IEquatable, IComparable => value1 - value2; - - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix2X2 Lerp(Matrix2X2 matrix1, Matrix2X2 matrix2, T amount) where T : unmanaged, IFormattable, IEquatable, IComparable - { - Matrix2X2 result = default; - - // First row - result.M11 = Scalar.Add(matrix1.M11, Scalar.Multiply(Scalar.Subtract(matrix2.M11, matrix1.M11), amount)); - result.M12 = Scalar.Add(matrix1.M12, Scalar.Multiply(Scalar.Subtract(matrix2.M12, matrix1.M12), amount)); - - // Second row - result.M21 = Scalar.Add(matrix1.M21, Scalar.Multiply(Scalar.Subtract(matrix2.M21, matrix1.M21), amount)); - result.M22 = Scalar.Add(matrix1.M22, Scalar.Multiply(Scalar.Subtract(matrix2.M22, matrix1.M22), amount)); - - return result; - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Matrix2X2.Ops.gen.cs b/sources/Maths/Maths/Matrix2X2.Ops.gen.cs new file mode 100644 index 0000000000..838f36a311 --- /dev/null +++ b/sources/Maths/Maths/Matrix2X2.Ops.gen.cs @@ -0,0 +1,118 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix2X2 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix2X2 Lerp(Matrix2X2 value1, Matrix2X2 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector2D.Lerp(value1.Row1, value2.Row1, amount), + Vector2D.Lerp(value1.Row2, value2.Row2, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix2X2 Add(Matrix2X2 left, Matrix2X2 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix2X2 Negate(Matrix2X2 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix2X2 Subtract(Matrix2X2 left, Matrix2X2 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix2X2 Multiply(Matrix2X2 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix2X2 Multiply(T left, Matrix2X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector2D Multiply(Vector2D rowVector, Matrix2X2 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector2D Multiply(Matrix2X2 matrix, Vector2D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 Multiply(Matrix2X2 left, Matrix2X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 Multiply(Matrix2X2 left, Matrix2X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 Multiply(Matrix2X2 left, Matrix2X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 Multiply(Matrix3X2 left, Matrix2X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 Multiply(Matrix4X2 left, Matrix2X2 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix2X2.cs b/sources/Maths/Maths/Matrix2X2.cs index e01fcf288f..68776d1594 100644 --- a/sources/Maths/Maths/Matrix2X2.cs +++ b/sources/Maths/Maths/Matrix2X2.cs @@ -1,127 +1,10 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - namespace Silk.NET.Maths { - /// A structure encapsulating a 2x2 matrix. - [Serializable] - [DataContract] - public struct Matrix2X2 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix2X2 { - private static readonly Matrix2X2 _identity = new(Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.One); - - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Row1; - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Row2; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column1 => new(M11, M21); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column2 => new(M12, M22); - - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector2D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 1 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// Constructs a from the given components. - public Matrix2X2(T m11, T m12, T m21, T m22) - { - Row1 = new(m11, m12); - Row2 = new(m21, m22); - } - - /// Constructs a from the given rows. - public Matrix2X2(Vector2D row1, Vector2D row2) - { - Row1 = row1; - Row2 = row2; - } - /// Constructs a from the given . /// The source . public Matrix2X2(Matrix3X2 value) @@ -162,98 +45,6 @@ public Matrix2X2(Matrix4X2 value) Row2 = new(value.M21, value.M22); } - /// Returns the multiplicative identity matrix. - public static Matrix2X2 Identity => _identity; - - /// Returns whether the matrix is the identity matrix. - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && - Scalar.Equal(M22, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M21, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix2X2 operator +(Matrix2X2 value1, Matrix2X2 value2) - { - Matrix2X2 m; - - m.Row1 = value1.Row1 + value2.Row1; - m.Row2 = value1.Row2 + value2.Row2; - - return m; - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix2X2 value1, Matrix2X2 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M21, value2.M21); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix2X2 value1, Matrix2X2 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || - Scalar.NotEqual(value1.M22, value2.M22) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M21, value2.M21); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X2 operator *(Matrix2X2 value1, Matrix2X2 value2) - { - return new - ( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, value1.M21 * value2.Row1 + value1.M22 * value2.Row2 - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector2D operator *(Vector2D value1, Matrix2X2 value2) - { - return value1 * value2.Row1 + value1 * value2.Row2; - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix2X2 operator *(Matrix2X2 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix2X2 operator -(Matrix2X2 value1, Matrix2X2 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix2X2 operator -(Matrix2X2 value) - { - return new(-value.Row1, -value.Row2); - } - /// Calculates the determinant of the matrix. /// The determinant of the matrix. public readonly T GetDeterminant() @@ -261,162 +52,10 @@ public readonly T GetDeterminant() // | a b | // | c d | = ad - bc - T a = M11, b = M12; - T d = M21, c = M22; - - return Scalar.Subtract(Scalar.Multiply(a, d), Scalar.Multiply(b, c)); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) => (obj is Matrix2X2 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix2X2 other) => this == other; + T a = Row1.X, b = Row1.Y; + T d = Row2.X, c = Row1.Y; - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - - hash.Add(M21); - hash.Add(M22); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} }}", M11, M12, - M21, M22); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M21), - Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M21), - Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M21), - Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M21), - Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X2(Matrix2X2 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M21), - Scalar.As(from.M22)); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix2X2 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As()); + return (a * d) - (b * c); } } } diff --git a/sources/Maths/Maths/Matrix2X2.gen.cs b/sources/Maths/Maths/Matrix2X2.gen.cs new file mode 100644 index 0000000000..a7ec0021c2 --- /dev/null +++ b/sources/Maths/Maths/Matrix2X2.gen.cs @@ -0,0 +1,453 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 2x2 matrix. + [Serializable] + [DataContract] + public partial struct Matrix2X2 : + IEquatable> + where T : INumberBase + { + /// Gets the multiplicative identity matrix of size 2x2. + public static Matrix2X2 Identity { get; } = new( + new(T.One, T.Zero), + new(T.Zero, T.One)); + + /// Returns whether the matrix is the identity matrix. + [IgnoreDataMember] + public readonly bool IsIdentity => this == Identity; + + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row2; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column1 => new(Row1.X, Row2.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column2 => new(Row1.Y, Row2.Y); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector2D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix2X2(Vector2D row1, Vector2D row2) => + (Row1, Row2) = (row1, row2); + + /// Constructs a from the given components. + public Matrix2X2( + T m11, T m12, + T m21, T m22) + { + Row1 = new(m11, m12); + Row2 = new(m21, m22); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} }}", + Row1.X, Row1.Y, + Row2.X, Row2.Y); + + /// + public override bool Equals(object? obj) => obj is Matrix2X2 other && Equals(other); + + /// + public bool Equals(Matrix2X2 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2); + + /// Converts the components of this matrix to another type. + public static Matrix2X2 CreateChecked(Matrix2X2 other) + where TOther : INumberBase => + new(Vector2D.CreateChecked(other.Row1), Vector2D.CreateChecked(other.Row2)); + + /// Converts the components of this matrix to another type. + public static Matrix2X2 CreateSaturating(Matrix2X2 other) + where TOther : INumberBase => + new(Vector2D.CreateSaturating(other.Row1), Vector2D.CreateSaturating(other.Row2)); + + /// Converts the components of this matrix to another type. + public static Matrix2X2 CreateTruncating(Matrix2X2 other) + where TOther : INumberBase => + new(Vector2D.CreateTruncating(other.Row1), Vector2D.CreateTruncating(other.Row2)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix2X2 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As()); + + /// Converts the components of this matrix to another type. + public Matrix2X2 AsChecked() + where TOther : INumberBase => + Matrix2X2.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix2X2 AsSaturating() + where TOther : INumberBase => + Matrix2X2.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix2X2 AsTruncating() + where TOther : INumberBase => + Matrix2X2.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix2X2 Transpose() => + new(Column1, + Column2); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix2X2 left, Matrix2X2 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix2X2 left, Matrix2X2 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix2X2 operator +(Matrix2X2 left, Matrix2X2 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix2X2 operator -(Matrix2X2 left, Matrix2X2 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix2X2 operator -(Matrix2X2 value) => + new(-value.Row1, + -value.Row2); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix2X2 operator *(T left, Matrix2X2 right) => + new(left * right.Row1, + left * right.Row2); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix2X2 operator *(Matrix2X2 left, T right) => + new(left.Row1 * right, + left.Row2 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector2D operator *(Vector2D rowVector, Matrix2X2 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector2D operator *(Matrix2X2 matrix, Vector2D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 operator *(Matrix2X2 left, Matrix2X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X2(Matrix2X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2)); + } +} diff --git a/sources/Maths/Maths/Matrix2X3.Ops.cs b/sources/Maths/Maths/Matrix2X3.Ops.cs index 242912de0b..6cb8eefe84 100644 --- a/sources/Maths/Maths/Matrix2X3.Ops.cs +++ b/sources/Maths/Maths/Matrix2X3.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -9,21 +10,10 @@ namespace Silk.NET.Maths /// /// Methods for working with /// - public static class Matrix2X3 + public static partial class Matrix2X3 { private const float BillboardEpsilon = 1e-4f; - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Add(Matrix2X3 value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - /// Creates a spherical billboard that rotates around a specified object position. /// Position of the object the billboard will rotate around. /// Position of the camera. @@ -31,18 +21,18 @@ public static Matrix2X3 Add(Matrix2X3 value1, Matrix2X3 value2) /// The forward vector of the camera. /// The created billboard matrix public static Matrix2X3 CreateBillboard(Vector3D objectPosition, Vector3D cameraPosition, Vector3D cameraUpVector, Vector3D cameraForwardVector) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { Vector3D zaxis = objectPosition - cameraPosition; var norm = zaxis.LengthSquared; - if (!Scalar.GreaterThanOrEqual(norm, Scalar.As(BillboardEpsilon))) + if (!(norm >= T.CreateTruncating(BillboardEpsilon))) { zaxis = -cameraForwardVector; } else { - zaxis = Vector3D.Multiply(zaxis, Scalar.Reciprocal(Scalar.Sqrt(norm))); + zaxis = Vector3D.Multiply(zaxis, T.One / T.Sqrt(norm)); } Vector3D xaxis = Vector3D.Normalize(Vector3D.Cross(cameraUpVector, zaxis)); @@ -56,7 +46,7 @@ public static Matrix2X3 CreateBillboard(Vector3D objectPosition, Vector /// The angle to rotate around the given axis, in radians. /// The rotation matrix. public static Matrix2X3 CreateFromAxisAngle(Vector3D axis, T angle) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { // a: angle // x, y, z: unit vector for axis. @@ -84,19 +74,19 @@ public static Matrix2X3 CreateFromAxisAngle(Vector3D axis, T angle) // [ zx-cosa*zx-sina*y zy-cosa*zy+sina*x zz+cosa*(1-zz) ] // T x = axis.X, y = axis.Y, z = axis.Z; - T sa = Scalar.Sin(angle), ca = Scalar.Cos(angle); - T xx = Scalar.Multiply(x, x), yy = Scalar.Multiply(y, y), zz = Scalar.Multiply(z, z); - T xy = Scalar.Multiply(x, y), xz = Scalar.Multiply(x, z), yz = Scalar.Multiply(y, z); + T sa = T.Sin(angle), ca = T.Cos(angle); + T xx = x * x, yy = y * y, zz = z * z; + T xy = x * y, xz = x * z, yz = y * z; Matrix2X3 result = Matrix2X3.Identity; - result.M11 = Scalar.Add(xx, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, xx))); - result.M12 = Scalar.Add(Scalar.Subtract(xy, Scalar.Multiply(ca, xy)), Scalar.Multiply(sa, z)); - result.M13 = Scalar.Subtract(Scalar.Subtract(xz, Scalar.Multiply(ca, xz)), Scalar.Multiply(sa, y)); + result.M11 = xx + (ca * (T.One - xx)); + result.M12 = xy - (ca * xy) + (sa * z); + result.M13 = xz - (ca * xz) - (sa * y); - result.M21 = Scalar.Subtract(Scalar.Subtract(xy, Scalar.Multiply(ca, xy)), Scalar.Multiply(sa, z)); - result.M22 = Scalar.Add(yy, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, yy))); - result.M23 = Scalar.Add(Scalar.Subtract(yz, Scalar.Multiply(ca, yz)), Scalar.Multiply(sa, x)); + result.M21 = xy - (ca * xy) - (sa * z); + result.M22 = yy + (ca * (T.One - yy)); + result.M23 = yz - (ca * yz) + (sa * x); return result; } @@ -105,28 +95,28 @@ public static Matrix2X3 CreateFromAxisAngle(Vector3D axis, T angle) /// The source Quaternion. /// The rotation matrix. public static Matrix2X3 CreateFromQuaternion(Quaternion quaternion) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { Matrix2X3 result = Matrix2X3.Identity; - T xx = Scalar.Multiply(quaternion.X, quaternion.X); - T yy = Scalar.Multiply(quaternion.Y, quaternion.Y); - T zz = Scalar.Multiply(quaternion.Z, quaternion.Z); + T xx = quaternion.X * quaternion.X; + T yy = quaternion.Y * quaternion.Y; + T zz = quaternion.Z * quaternion.Z; - T xy = Scalar.Multiply(quaternion.X, quaternion.Y); - T wz = Scalar.Multiply(quaternion.Z, quaternion.W); - T xz = Scalar.Multiply(quaternion.Z, quaternion.X); - T wy = Scalar.Multiply(quaternion.Y, quaternion.W); - T yz = Scalar.Multiply(quaternion.Y, quaternion.Z); - T wx = Scalar.Multiply(quaternion.X, quaternion.W); + T xy = quaternion.X * quaternion.Y; + T wz = quaternion.Z * quaternion.W; + T xz = quaternion.Z * quaternion.X; + T wy = quaternion.Y * quaternion.W; + T yz = quaternion.Y * quaternion.Z; + T wx = quaternion.X * quaternion.W; - result.M11 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(yy, zz))); - result.M12 = Scalar.Multiply(Scalar.Two, Scalar.Add(xy, wz)); - result.M13 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(xz, wy)); + result.M11 = T.One - (T.CreateTruncating(2) * (yy + zz)); + result.M12 = T.CreateTruncating(2) * (xy + wz); + result.M13 = T.CreateTruncating(2) * (xz - wy); - result.M21 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(xy, wz)); - result.M22 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(zz, xx))); - result.M23 = Scalar.Multiply(Scalar.Two, Scalar.Add(yz, wx)); + result.M21 = T.CreateTruncating(2) * (xy - wz); + result.M22 = T.One - (T.CreateTruncating(2) * (zz + xx)); + result.M23 = T.CreateTruncating(2) * (yz + wx); return result; } @@ -138,126 +128,51 @@ public static Matrix2X3 CreateFromQuaternion(Quaternion quaternion) /// Angle of rotation, in radians, around the Z-axis. /// The rotation matrix. public static Matrix2X3 CreateFromYawPitchRoll(T yaw, T pitch, T roll) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { - Quaternion q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); + var q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); return CreateFromQuaternion(q); } - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Multiply(Matrix2X3 value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X2 value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X3 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector2D value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Negate(Matrix2X3 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Subtract(Matrix2X3 value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix2X3 Lerp(Matrix2X3 matrix1, Matrix2X3 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Vector3D.Lerp(matrix1.Row1, matrix2.Row2, amount), Vector3D.Lerp(matrix1.Row2, matrix2.Row2, amount)); - } - /// Transforms the given matrix by applying the given Quaternion rotation. /// The source matrix to transform. /// The rotation to apply. /// The transformed matrix. public static Matrix2X3 Transform(Matrix2X3 value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { // Compute rotation matrix. - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - T q11 = Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2); - T q21 = Scalar.Subtract(xy2, wz2); - T q31 = Scalar.Add(xz2, wy2); - - T q12 = Scalar.Add(xy2, wz2); - T q22 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2); - T q32 = Scalar.Subtract(yz2, wx2); - - T q13 = Scalar.Subtract(xz2, wy2); - T q23 = Scalar.Add(yz2, wx2); - T q33 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2); + T x2 = rotation.X + rotation.X; + T y2 = rotation.Y + rotation.Y; + T z2 = rotation.Z + rotation.Z; + + T wx2 = rotation.W * x2; + T wy2 = rotation.W * y2; + T wz2 = rotation.W * z2; + T xx2 = rotation.X * x2; + T xy2 = rotation.X * y2; + T xz2 = rotation.X * z2; + T yy2 = rotation.Y * y2; + T yz2 = rotation.Y * z2; + T zz2 = rotation.Z * z2; + + T q11 = T.One - yy2 - zz2; + T q21 = xy2 - wz2; + T q31 = xz2 + wy2; + + T q12 = xy2 + wz2; + T q22 = T.One - xx2 - zz2; + T q32 = yz2 - wx2; + + T q13 = xz2 - wy2; + T q23 = yz2 + wx2; + T q33 = T.One - xx2 - yy2; var q1 = new Vector3D(q11, q12, q13); var q2 = new Vector3D(q21, q22, q23); var q3 = new Vector3D(q31, q32, q33); - return new(value.M11 * q1 + value.M12 * q2 + value.M13 * q3, value.M21 * q1 + value.M22 * q2 + value.M23 * q3); + return new((value.M11 * q1) + (value.M12 * q2) + (value.M13 * q3), (value.M21 * q1) + (value.M22 * q2) + (value.M23 * q3)); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Matrix2X3.Ops.gen.cs b/sources/Maths/Maths/Matrix2X3.Ops.gen.cs new file mode 100644 index 0000000000..b889b49719 --- /dev/null +++ b/sources/Maths/Maths/Matrix2X3.Ops.gen.cs @@ -0,0 +1,126 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix2X3 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix2X3 Lerp(Matrix2X3 value1, Matrix2X3 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector3D.Lerp(value1.Row1, value2.Row1, amount), + Vector3D.Lerp(value1.Row2, value2.Row2, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix2X3 Add(Matrix2X3 left, Matrix2X3 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix2X3 Negate(Matrix2X3 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix2X3 Subtract(Matrix2X3 left, Matrix2X3 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix2X3 Multiply(Matrix2X3 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix2X3 Multiply(T left, Matrix2X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector3D Multiply(Vector2D rowVector, Matrix2X3 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector2D Multiply(Matrix2X3 matrix, Vector3D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 Multiply(Matrix2X2 left, Matrix2X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 Multiply(Matrix2X3 left, Matrix3X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 Multiply(Matrix2X3 left, Matrix3X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 Multiply(Matrix2X3 left, Matrix3X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 Multiply(Matrix3X2 left, Matrix2X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 Multiply(Matrix4X2 left, Matrix2X3 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix2X3.cs b/sources/Maths/Maths/Matrix2X3.cs index 87bdfc4701..7a6d04767c 100644 --- a/sources/Maths/Maths/Matrix2X3.cs +++ b/sources/Maths/Maths/Matrix2X3.cs @@ -1,161 +1,24 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 2x3 matrix. - [Serializable] - [DataContract] - public struct Matrix2X3 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix2X3 { private static readonly Matrix2X3 _identity = new ( - Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero + T.One, T.Zero, T.Zero, + T.Zero, T.One, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row2; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column1 => new Vector2D(M11, M21); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column2 => new Vector2D(M12, M22); - - /// - /// Column 3 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column3 => new Vector2D(M13, M23); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector3D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 1 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// Constructs a from the given components. - public Matrix2X3(T m11, T m12, T m13, - T m21, T m22, T m23) - { - Row1 = new(m11, m12, m13); - Row2 = new(m21, m22, m23); - } - - /// - /// Constructs a from the given rows. - /// - public Matrix2X3(Vector3D row1, Vector3D row2) - { - Row1 = row1; - Row2 = row2; - } - /// Constructs a from the given . /// The source . public Matrix2X3(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default); - Row2 = new(value.M21, value.M22, default); + Row1 = new(value.M11, value.M12, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero); } /// Constructs a from the given . @@ -186,8 +49,8 @@ public Matrix2X3(Matrix2X4 value) /// The source . public Matrix2X3(Matrix4X2 value) { - Row1 = new Vector3D(value.M11, value.M12, default); - Row2 = new Vector3D(value.M21, value.M22, default); + Row1 = new Vector3D(value.M11, value.M12, T.Zero); + Row2 = new Vector3D(value.M21, value.M22, T.Zero); } /// Returns the multiplicative identity matrix. @@ -195,268 +58,6 @@ public Matrix2X3(Matrix4X2 value) /// Returns whether the matrix is the identity matrix. [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && - Scalar.Equal(M22, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M21, Scalar.Zero) && Scalar.Equal(M23, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix2X3 operator +(Matrix2X3 value1, Matrix2X3 value2) - { - return new(value1.Row1 + value2.Row1, value1.Row2 + value2.Row2); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix2X3 value1, Matrix2X3 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M21, value2.M21) && Scalar.Equal(value1.M23, value2.M23); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix2X3 value1, Matrix2X3 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || - Scalar.NotEqual(value1.M22, value2.M22) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M21, value2.M21) || Scalar.NotEqual(value1.M23, value2.M23); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X3 operator *(Matrix2X3 value1, Matrix3X3 value2) - { - return new(value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3, value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector3D operator *(Vector2D value1, Matrix2X3 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X3 operator *(Matrix2X2 value1, Matrix2X3 value2) - { - return new(value1.M11 * value2.Row1 + value1.M12 * value2.Row2, value1.M21 * value2.Row1 + value2.M22 * value2.Row2); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X2 operator *(Matrix2X3 value1, Matrix3X2 value2) - { - return new(value1.M11 * value2.Row1 + value1.M12 * value2.Row2, value1.M21 * value2.Row1 + value1.M22 * value2.Row2); - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix2X3 operator *(Matrix2X3 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix2X3 operator -(Matrix2X3 value1, Matrix2X3 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix2X3 operator -(Matrix2X3 value) - { - return new(-value.Row1, -value.Row2); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix2X3 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix2X3 other) - => this == other; - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2} }} {{M21:{3} M22:{4} M23:{5} }} }}", - M11, M12, M13, - M21, M22, M23); - } - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), - Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), - Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), - Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X3(Matrix2X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23)); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix2X3 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As()); - } + public readonly bool IsIdentity => this == Identity; } } diff --git a/sources/Maths/Maths/Matrix2X3.gen.cs b/sources/Maths/Maths/Matrix2X3.gen.cs new file mode 100644 index 0000000000..154678319a --- /dev/null +++ b/sources/Maths/Maths/Matrix2X3.gen.cs @@ -0,0 +1,467 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 2x3 matrix. + [Serializable] + [DataContract] + public partial struct Matrix2X3 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row2; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column1 => new(Row1.X, Row2.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column2 => new(Row1.Y, Row2.Y); + + /// The 3rd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column3 => new(Row1.Z, Row2.Z); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector3D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix2X3(Vector3D row1, Vector3D row2) => + (Row1, Row2) = (row1, row2); + + /// Constructs a from the given components. + public Matrix2X3( + T m11, T m12, T m13, + T m21, T m22, T m23) + { + Row1 = new(m11, m12, m13); + Row2 = new(m21, m22, m23); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2}}} {{M21:{3} M22:{4} M23:{5}}} }}", + Row1.X, Row1.Y, Row1.Z, + Row2.X, Row2.Y, Row2.Z); + + /// + public override bool Equals(object? obj) => obj is Matrix2X3 other && Equals(other); + + /// + public bool Equals(Matrix2X3 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2); + + /// Converts the components of this matrix to another type. + public static Matrix2X3 CreateChecked(Matrix2X3 other) + where TOther : INumberBase => + new(Vector3D.CreateChecked(other.Row1), Vector3D.CreateChecked(other.Row2)); + + /// Converts the components of this matrix to another type. + public static Matrix2X3 CreateSaturating(Matrix2X3 other) + where TOther : INumberBase => + new(Vector3D.CreateSaturating(other.Row1), Vector3D.CreateSaturating(other.Row2)); + + /// Converts the components of this matrix to another type. + public static Matrix2X3 CreateTruncating(Matrix2X3 other) + where TOther : INumberBase => + new(Vector3D.CreateTruncating(other.Row1), Vector3D.CreateTruncating(other.Row2)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix2X3 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As()); + + /// Converts the components of this matrix to another type. + public Matrix2X3 AsChecked() + where TOther : INumberBase => + Matrix2X3.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix2X3 AsSaturating() + where TOther : INumberBase => + Matrix2X3.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix2X3 AsTruncating() + where TOther : INumberBase => + Matrix2X3.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix3X2 Transpose() => + new(Column1, + Column2, + Column3); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix2X3 left, Matrix2X3 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix2X3 left, Matrix2X3 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix2X3 operator +(Matrix2X3 left, Matrix2X3 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix2X3 operator -(Matrix2X3 left, Matrix2X3 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix2X3 operator -(Matrix2X3 value) => + new(-value.Row1, + -value.Row2); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix2X3 operator *(T left, Matrix2X3 right) => + new(left * right.Row1, + left * right.Row2); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix2X3 operator *(Matrix2X3 left, T right) => + new(left.Row1 * right, + left.Row2 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector3D operator *(Vector2D rowVector, Matrix2X3 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector2D operator *(Matrix2X3 matrix, Vector3D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y + matrix.Column3 * columnVector.Z; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 operator *(Matrix2X2 left, Matrix2X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 operator *(Matrix2X3 left, Matrix3X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X3(Matrix2X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2)); + } +} diff --git a/sources/Maths/Maths/Matrix2X4.Ops.cs b/sources/Maths/Maths/Matrix2X4.Ops.cs deleted file mode 100644 index b7402f1507..0000000000 --- a/sources/Maths/Maths/Matrix2X4.Ops.cs +++ /dev/null @@ -1,101 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - /// - /// Methods for working with - /// - public static class Matrix2X4 - { - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X4 Add(Matrix2X4 value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X4 Multiply(Matrix2X4 value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X4 value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Multiply(Matrix2X4 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Multiply(Matrix4X2 value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Multiply(Matrix3X2 value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X4 Multiply(Matrix2X2 value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector2D value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix2X4 Lerp(Matrix2X4 matrix1, Matrix2X4 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Vector4D.Lerp(matrix1.Row1, matrix2.Row1, amount), Vector4D.Lerp(matrix1.Row2, matrix2.Row2, amount)); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Matrix2X4.Ops.gen.cs b/sources/Maths/Maths/Matrix2X4.Ops.gen.cs new file mode 100644 index 0000000000..11fb2e377b --- /dev/null +++ b/sources/Maths/Maths/Matrix2X4.Ops.gen.cs @@ -0,0 +1,126 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix2X4 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix2X4 Lerp(Matrix2X4 value1, Matrix2X4 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector4D.Lerp(value1.Row1, value2.Row1, amount), + Vector4D.Lerp(value1.Row2, value2.Row2, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix2X4 Add(Matrix2X4 left, Matrix2X4 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix2X4 Negate(Matrix2X4 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix2X4 Subtract(Matrix2X4 left, Matrix2X4 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix2X4 Multiply(Matrix2X4 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix2X4 Multiply(T left, Matrix2X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector4D Multiply(Vector2D rowVector, Matrix2X4 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector2D Multiply(Matrix2X4 matrix, Vector4D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 Multiply(Matrix2X2 left, Matrix2X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 Multiply(Matrix2X4 left, Matrix4X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 Multiply(Matrix2X4 left, Matrix4X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 Multiply(Matrix2X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 Multiply(Matrix3X2 left, Matrix2X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 Multiply(Matrix4X2 left, Matrix2X4 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix2X4.cs b/sources/Maths/Maths/Matrix2X4.cs index 7e6f38eabf..6bb404325a 100644 --- a/sources/Maths/Maths/Matrix2X4.cs +++ b/sources/Maths/Maths/Matrix2X4.cs @@ -1,190 +1,32 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 2x4 matrix. - [Serializable] - [DataContract] - public struct Matrix2X4 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix2X4 { private static readonly Matrix2X4 _identity = new ( - Scalar.One, Scalar.Zero, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero, Scalar.Zero + T.One, T.Zero, T.Zero, T.Zero, + T.Zero, T.One, T.Zero, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row2; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column1 => new(M11, M21); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column2 => new(M12, M22); - - /// - /// Column 3 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column3 => new(M13, M23); - - /// - /// Column 4 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Column4 => new(M14, M24); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 1, column 4 of the matrix. - [DataMember] - public T M14 - { - readonly get => Row1.W; - set => Row1.W = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// Value at row 2, column 4 of the matrix. - [DataMember] - public T M24 - { - readonly get => Row2.W; - set => Row2.W = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector4D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 1 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int j] - { - get - { - var row = this[x]; - return row[j]; - } - } - - /// - /// Constructs a from the given rows - /// - public Matrix2X4(Vector4D row1, Vector4D row2) - { - Row1 = row1; - Row2 = row2; - } - - /// Constructs a from the given components. - public Matrix2X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24) - { - Row1 = new(m11, m12, m13, m14); - Row2 = new(m21, m22, m23, m24); - } - /// Constructs a from the given . /// The source . public Matrix2X4(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); } /// Constructs a from the given Matrix4x3. /// The source Matrix4x3. public Matrix2X4(Matrix4X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); } /// Constructs a from the given . @@ -199,16 +41,16 @@ public Matrix2X4(Matrix3X4 value) /// The source . public Matrix2X4(Matrix3X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); } /// Constructs a Matrix2x4 from the given . /// The source . public Matrix2X4(Matrix4X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); } /// Returns the multiplicative identity matrix. @@ -216,346 +58,6 @@ public Matrix2X4(Matrix4X2 value) /// Returns whether the matrix is the identity matrix. [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && - Scalar.Equal(M22, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M14, Scalar.Zero) && Scalar.Equal(M21, Scalar.Zero) && - Scalar.Equal(M23, Scalar.Zero) && Scalar.Equal(M24, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix2X4 operator +(Matrix2X4 value1, Matrix2X4 value2) - { - return new(value1.Row1 + value2.Row1, value1.Row2 + value2.Row2); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix2X4 value1, Matrix2X4 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && - Scalar.Equal(value1.M22, value2.M22) && // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M14, value2.M14) && Scalar.Equal(value1.M21, value2.M21) && - Scalar.Equal(value1.M23, value2.M23) && Scalar.Equal(value1.M24, value2.M24); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix2X4 value1, Matrix2X4 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || - Scalar.NotEqual(value1.M22, value2.M22) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M14, value2.M14) || Scalar.NotEqual(value1.M21, value2.M21) || - Scalar.NotEqual(value1.M23, value2.M23) || Scalar.NotEqual(value1.M24, value2.M24); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X4 operator *(Matrix2X4 value1, Matrix4X4 value2) - { - return new(value1.M11 * value2.Row1 + value1.M12 * value1.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value1.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector4D operator *(Vector2D value1, Matrix2X4 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X3 operator *(Matrix2X4 value1, Matrix4X3 value2) - { - return new(value1.M11 * value2.Row1 + value2.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value2.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X4 operator *(Matrix3X2 value1, Matrix2X4 value2) - { - return new - ( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X4 operator *(Matrix2X2 value1, Matrix2X4 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 - ); - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix2X4 operator *(Matrix2X4 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix2X4 operator -(Matrix2X4 value1, Matrix2X4 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix2X4 operator -(Matrix2X4 value) - { - return new(-value.Row1, -value.Row2); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix2X4 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix2X4 other) - => this == other; - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - hash.Add(M14); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - hash.Add(M24); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} }}", - M11, M12, M13, M14, - M21, M22, M23, M24); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix2X4(Matrix2X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix2X4 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As()); - } + public readonly bool IsIdentity => this == Identity; } } diff --git a/sources/Maths/Maths/Matrix2X4.gen.cs b/sources/Maths/Maths/Matrix2X4.gen.cs new file mode 100644 index 0000000000..799c1553dc --- /dev/null +++ b/sources/Maths/Maths/Matrix2X4.gen.cs @@ -0,0 +1,491 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 2x4 matrix. + [Serializable] + [DataContract] + public partial struct Matrix2X4 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row2; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column1 => new(Row1.X, Row2.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column2 => new(Row1.Y, Row2.Y); + + /// The 3rd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column3 => new(Row1.Z, Row2.Z); + + /// The 4th column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Column4 => new(Row1.W, Row2.W); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 1st row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M14 => ref Row1.W; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// Gets the element in the 2nd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M24 => ref Row2.W; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector4D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix2X4(Vector4D row1, Vector4D row2) => + (Row1, Row2) = (row1, row2); + + /// Constructs a from the given components. + public Matrix2X4( + T m11, T m12, T m13, T m14, + T m21, T m22, T m23, T m24) + { + Row1 = new(m11, m12, m13, m14); + Row2 = new(m21, m22, m23, m24); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} }}", + Row1.X, Row1.Y, Row1.Z, Row1.W, + Row2.X, Row2.Y, Row2.Z, Row2.W); + + /// + public override bool Equals(object? obj) => obj is Matrix2X4 other && Equals(other); + + /// + public bool Equals(Matrix2X4 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2); + + /// Converts the components of this matrix to another type. + public static Matrix2X4 CreateChecked(Matrix2X4 other) + where TOther : INumberBase => + new(Vector4D.CreateChecked(other.Row1), Vector4D.CreateChecked(other.Row2)); + + /// Converts the components of this matrix to another type. + public static Matrix2X4 CreateSaturating(Matrix2X4 other) + where TOther : INumberBase => + new(Vector4D.CreateSaturating(other.Row1), Vector4D.CreateSaturating(other.Row2)); + + /// Converts the components of this matrix to another type. + public static Matrix2X4 CreateTruncating(Matrix2X4 other) + where TOther : INumberBase => + new(Vector4D.CreateTruncating(other.Row1), Vector4D.CreateTruncating(other.Row2)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix2X4 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As()); + + /// Converts the components of this matrix to another type. + public Matrix2X4 AsChecked() + where TOther : INumberBase => + Matrix2X4.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix2X4 AsSaturating() + where TOther : INumberBase => + Matrix2X4.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix2X4 AsTruncating() + where TOther : INumberBase => + Matrix2X4.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix4X2 Transpose() => + new(Column1, + Column2, + Column3, + Column4); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix2X4 left, Matrix2X4 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix2X4 left, Matrix2X4 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix2X4 operator +(Matrix2X4 left, Matrix2X4 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix2X4 operator -(Matrix2X4 left, Matrix2X4 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix2X4 operator -(Matrix2X4 value) => + new(-value.Row1, + -value.Row2); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix2X4 operator *(T left, Matrix2X4 right) => + new(left * right.Row1, + left * right.Row2); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix2X4 operator *(Matrix2X4 left, T right) => + new(left.Row1 * right, + left.Row2 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector4D operator *(Vector2D rowVector, Matrix2X4 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector2D operator *(Matrix2X4 matrix, Vector4D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y + matrix.Column3 * columnVector.Z + matrix.Column4 * columnVector.W; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 operator *(Matrix2X2 left, Matrix2X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 operator *(Matrix2X4 left, Matrix4X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 operator *(Matrix3X2 left, Matrix2X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2, + left.M31 * right.Row1 + left.M32 * right.Row2); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix2X4(Matrix2X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2)); + } +} diff --git a/sources/Maths/Maths/Matrix3X2.Ops.cs b/sources/Maths/Maths/Matrix3X2.Ops.cs index 20d7ff905a..d4f919805c 100644 --- a/sources/Maths/Maths/Matrix3X2.Ops.cs +++ b/sources/Maths/Maths/Matrix3X2.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -9,7 +10,7 @@ namespace Silk.NET.Maths /// /// Methods for working with /// - public static class Matrix3X2 + public static partial class Matrix3X2 { #if MATHF private const float RotationEpsilon = 0.001f * MathF.PI / 180f; // 0.1% of a degree @@ -17,38 +18,29 @@ public static class Matrix3X2 private const float RotationEpsilon = 0.001f * ((float) Math.PI) / 180f; // 0.1% of a degree #endif - /// Adds each matrix element in value1 with its corresponding element in value2. - /// The first source matrix. - /// The second source matrix. - /// The matrix containing the summed values. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Add(Matrix3X2 value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 + value2; - /// Creates a rotation matrix using the given rotation in radians. /// The amount of rotation, in radians. /// A rotation matrix. public static Matrix3X2 CreateRotation(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IFloatingPointIeee754 { - radians = Scalar.IEEERemainder(radians, Scalar.Tau); + radians = T.Ieee754Remainder(radians, T.Tau); T c, s; - if (Scalar.GreaterThan(radians, Scalar.As(-RotationEpsilon)) && !Scalar.GreaterThanOrEqual(radians, Scalar.As(RotationEpsilon))) + if ((radians > T.CreateTruncating(-RotationEpsilon)) && !(radians >= T.CreateTruncating(RotationEpsilon))) { // Exact case for zero rotation. - c = Scalar.One; - s = Scalar.Zero; + c = T.One; + s = T.Zero; } - else if (Scalar.GreaterThan(radians, Scalar.As( + else if ((radians > T.CreateTruncating( #if MATHF MathF.PI #else ((float) Math.PI) #endif - / 2 - RotationEpsilon)) && !Scalar.GreaterThanOrEqual(radians, Scalar.As( + / 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating( #if MATHF MathF.PI #else @@ -57,16 +49,16 @@ public static Matrix3X2 CreateRotation(T radians) / 2 + RotationEpsilon))) { // Exact case for 90 degree rotation. - c = Scalar.Zero; - s = Scalar.One; + c = T.Zero; + s = T.One; } - else if (!Scalar.GreaterThanOrEqual(radians, Scalar.As(- + else if (!(radians >= T.CreateTruncating(- #if MATHF MathF.PI #else ((float) Math.PI) #endif - + RotationEpsilon)) || Scalar.GreaterThan(radians, Scalar.As( + + RotationEpsilon)) || (radians > T.CreateTruncating( #if MATHF MathF.PI #else @@ -75,16 +67,16 @@ public static Matrix3X2 CreateRotation(T radians) - RotationEpsilon))) { // Exact case for 180 degree rotation. - c = Scalar.MinusOne; - s = Scalar.Zero; + c = -T.One; + s = T.Zero; } - else if (Scalar.GreaterThan(radians, Scalar.As(- + else if ((radians > T.CreateTruncating(- #if MATHF MathF.PI #else ((float) Math.PI) #endif - / 2 - RotationEpsilon)) && !Scalar.GreaterThanOrEqual(radians, Scalar.As(- + / 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating(- #if MATHF MathF.PI #else @@ -93,14 +85,14 @@ public static Matrix3X2 CreateRotation(T radians) / 2 + RotationEpsilon))) { // Exact case for 270 degree rotation. - c = Scalar.Zero; - s = Scalar.MinusOne; + c = T.Zero; + s = -T.One; } else { // Arbitrary rotation. - c = Scalar.Cos(radians); - s = Scalar.Sin(radians); + c = T.Cos(radians); + s = T.Sin(radians); } // [ c s ] @@ -110,7 +102,7 @@ public static Matrix3X2 CreateRotation(T radians) result.M11 = c; result.M12 = s; - result.M21 = Scalar.Negate(s); + result.M21 = -s; result.M22 = c; return result; @@ -121,25 +113,25 @@ public static Matrix3X2 CreateRotation(T radians) /// The center point. /// A rotation matrix. public static Matrix3X2 CreateRotation(T radians, Vector2D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IFloatingPointIeee754 { - radians = Scalar.IEEERemainder(radians, Scalar.Tau); + radians = T.Ieee754Remainder(radians, T.Tau); T c, s; - if (Scalar.GreaterThan(radians, Scalar.As(-RotationEpsilon)) && !Scalar.GreaterThanOrEqual(radians, Scalar.As(RotationEpsilon))) + if ((radians > T.CreateTruncating(-RotationEpsilon)) && !(radians >= T.CreateTruncating(RotationEpsilon))) { // Exact case for zero rotation. - c = Scalar.One; - s = Scalar.Zero; + c = T.One; + s = T.Zero; } - else if (Scalar.GreaterThan(radians, Scalar.As( + else if ((radians > T.CreateTruncating( #if MATHF MathF.PI #else ((float) Math.PI) #endif - / 2 - RotationEpsilon)) && !Scalar.GreaterThanOrEqual(radians, Scalar.As( + / 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating( #if MATHF MathF.PI #else @@ -148,16 +140,16 @@ public static Matrix3X2 CreateRotation(T radians, Vector2D centerPoint) / 2 + RotationEpsilon))) { // Exact case for 90 degree rotation. - c = Scalar.Zero; - s = Scalar.One; + c = T.Zero; + s = T.One; } - else if (!Scalar.GreaterThanOrEqual(radians, Scalar.As(- + else if (!(radians >= T.CreateTruncating(- #if MATHF MathF.PI #else ((float) Math.PI) #endif - + RotationEpsilon)) || Scalar.GreaterThan(radians, Scalar.As( + + RotationEpsilon)) || (radians > T.CreateTruncating( #if MATHF MathF.PI #else @@ -166,16 +158,16 @@ public static Matrix3X2 CreateRotation(T radians, Vector2D centerPoint) - RotationEpsilon))) { // Exact case for 180 degree rotation. - c = Scalar.MinusOne; - s = Scalar.Zero; + c = -T.One; + s = T.Zero; } - else if (Scalar.GreaterThan(radians, Scalar.As(- + else if ((radians > T.CreateTruncating(- #if MATHF MathF.PI #else ((float) Math.PI) #endif - / 2 - RotationEpsilon)) && !Scalar.GreaterThanOrEqual(radians, Scalar.As(- + / 2 - RotationEpsilon)) && !(radians >= T.CreateTruncating(- #if MATHF MathF.PI #else @@ -184,25 +176,25 @@ public static Matrix3X2 CreateRotation(T radians, Vector2D centerPoint) / 2 + RotationEpsilon))) { // Exact case for 270 degree rotation. - c = Scalar.Zero; - s = Scalar.MinusOne; + c = T.Zero; + s = -T.One; } else { // Arbitrary rotation. - c = Scalar.Cos(radians); - s = Scalar.Sin(radians); + c = T.Cos(radians); + s = T.Sin(radians); } - T x = Scalar.Add(Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.Y, s)); - T y = Scalar.Subtract(Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.X, s)); + T x = (centerPoint.X * (T.One - c)) + (centerPoint.Y * s); + T y = (centerPoint.Y * (T.One - c)) - (centerPoint.X * s); // [ c s ] // [ -s c ] // [ x y ] return new( new(c, s), - new(Scalar.Negate(s), c), + new(-s, c), new(x, y)); } @@ -210,7 +202,7 @@ public static Matrix3X2 CreateRotation(T radians, Vector2D centerPoint) /// The scale to use. /// A scaling matrix. public static Matrix3X2 CreateScale(Vector2D scales) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; @@ -225,7 +217,7 @@ public static Matrix3X2 CreateScale(Vector2D scales) /// Value to scale by on the Y-axis. /// A scaling matrix. public static Matrix3X2 CreateScale(T xScale, T yScale) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; @@ -241,12 +233,12 @@ public static Matrix3X2 CreateScale(T xScale, T yScale) /// The center point. /// A scaling matrix. public static Matrix3X2 CreateScale(T xScale, T yScale, Vector2D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; - T tx = Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, xScale)); - T ty = Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, yScale)); + T tx = centerPoint.X * (T.One - xScale); + T ty = centerPoint.Y * (T.One - yScale); result.M11 = xScale; result.M22 = yScale; @@ -261,12 +253,12 @@ public static Matrix3X2 CreateScale(T xScale, T yScale, Vector2D center /// The center offset. /// A scaling matrix. public static Matrix3X2 CreateScale(Vector2D scales, Vector2D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; - T tx = Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, scales.X)); - T ty = Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, scales.Y)); + T tx = centerPoint.X * (T.One - scales.X); + T ty = centerPoint.Y * (T.One - scales.Y); result.M11 = scales.X; result.M22 = scales.Y; @@ -280,7 +272,7 @@ public static Matrix3X2 CreateScale(Vector2D scales, Vector2D center /// The uniform scale to use. /// A scaling matrix. public static Matrix3X2 CreateScale(T scale) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; @@ -295,12 +287,12 @@ public static Matrix3X2 CreateScale(T scale) /// The center offset. /// A scaling matrix. public static Matrix3X2 CreateScale(T scale, Vector2D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; - T tx = Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, scale)); - T ty = Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, scale)); + T tx = centerPoint.X * (T.One - scale); + T ty = centerPoint.Y * (T.One - scale); result.M11 = scale; result.M22 = scale; @@ -315,12 +307,12 @@ public static Matrix3X2 CreateScale(T scale, Vector2D centerPoint) /// The Y angle, in radians. /// A skew matrix. public static Matrix3X2 CreateSkew(T radiansX, T radiansY) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix3X2 result = Matrix3X2.Identity; - T xTan = Scalar.Tan(radiansX); - T yTan = Scalar.Tan(radiansY); + T xTan = T.Tan(radiansX); + T yTan = T.Tan(radiansY); result.M12 = yTan; result.M21 = xTan; @@ -334,15 +326,15 @@ public static Matrix3X2 CreateSkew(T radiansX, T radiansY) /// The center point. /// A skew matrix. public static Matrix3X2 CreateSkew(T radiansX, T radiansY, Vector2D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix3X2 result = Matrix3X2.Identity; - T xTan = Scalar.Tan(radiansX); - T yTan = Scalar.Tan(radiansY); + T xTan = T.Tan(radiansX); + T yTan = T.Tan(radiansY); - T tx = Scalar.Negate(Scalar.Multiply(centerPoint.Y, xTan)); - T ty = Scalar.Negate(Scalar.Multiply(centerPoint.X, yTan)); + T tx = -(centerPoint.Y * xTan); + T ty = -(centerPoint.X * yTan); result.M12 = yTan; result.M21 = xTan; @@ -354,10 +346,10 @@ public static Matrix3X2 CreateSkew(T radiansX, T radiansY, Vector2D cen } /// Creates a translation matrix from the given vector. - /// The translation position. ` + /// The translation position. /// A translation matrix. public static Matrix3X2 CreateTranslation(Vector2D position) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; @@ -372,7 +364,7 @@ public static Matrix3X2 CreateTranslation(Vector2D position) /// The Y position. /// A translation matrix. public static Matrix3X2 CreateTranslation(T xPosition, T yPosition) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X2 result = Matrix3X2.Identity; @@ -387,114 +379,30 @@ public static Matrix3X2 CreateTranslation(T xPosition, T yPosition) /// The output matrix. /// True if the operation succeeded, False otherwise. public static bool Invert(Matrix3X2 matrix, out Matrix3X2 result) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IFloatingPointIeee754 { - T det = Scalar.Subtract(Scalar.Multiply(matrix.M11, matrix.M22), Scalar.Multiply(matrix.M21, matrix.M12)); + T det = (matrix.M11 * matrix.M22) - (matrix.M21 * matrix.M12); - if (!Scalar.GreaterThanOrEqual(Scalar.Abs(det), Scalar.Epsilon)) + if (!(T.Abs(det) >= T.Epsilon)) { - result = new(Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN); + result = new(T.NaN, T.NaN, T.NaN, T.NaN, T.NaN, T.NaN); return false; } - T invDet = Scalar.Reciprocal(det); + T invDet = T.One / det; result = default; - result.M11 = Scalar.Multiply(matrix.M22, invDet); - result.M12 = Scalar.Negate(Scalar.Multiply(matrix.M12, invDet)); + result.M11 = matrix.M22 * invDet; + result.M12 = -(matrix.M12 * invDet); - result.M21 = Scalar.Negate(Scalar.Multiply(matrix.M21, invDet)); - result.M22 = Scalar.Multiply(matrix.M11, invDet); + result.M21 = -(matrix.M21 * invDet); + result.M22 = matrix.M11 * invDet; - result.M31 = Scalar.Multiply(Scalar.Subtract(Scalar.Multiply(matrix.M21, matrix.M32), Scalar.Multiply(matrix.M31, matrix.M22)), invDet); - result.M32 = Scalar.Multiply(Scalar.Subtract(Scalar.Multiply(matrix.M31, matrix.M12), Scalar.Multiply(matrix.M11, matrix.M32)), invDet); + result.M31 = ((matrix.M21 * matrix.M32) - (matrix.M31 * matrix.M22)) * invDet; + result.M32 = ((matrix.M31 * matrix.M12) - (matrix.M11 * matrix.M32)) * invDet; return true; } - - /// Linearly interpolates from matrix1 to matrix2, based on the third parameter. - /// The first source matrix. - /// The second source matrix. - /// The relative weighting of matrix2. - /// The interpolated matrix. - public static Matrix3X2 Lerp(Matrix3X2 matrix1, Matrix3X2 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Vector2D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector2D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector2D.Lerp(matrix1.Row3, matrix2.Row3, amount)); - } - - /// Multiplies two matrices together and returns the resulting matrix. - /// The first source matrix. - /// The second source matrix. - /// The product matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Multiply(Matrix3X2 value1, Matrix2X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector3D value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies two matrices together and returns the resulting matrix. - /// The first source matrix. - /// The second source matrix. - /// The product matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Multiply(Matrix3X2 value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies two matrices together and returns the resulting matrix. - /// The first source matrix. - /// The second source matrix. - /// The product matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Multiply(Matrix2X3 value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies two matrices together and returns the resulting matrix. - /// The first source matrix. - /// The second source matrix. - /// The product matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Scales all elements in a matrix by the given scalar factor. - /// The source matrix. - /// The scaling value to use. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Multiply(Matrix3X2 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Negates the given matrix by multiplying all values by -1. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Negate(Matrix3X2 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts each matrix element in value2 from its corresponding element in value1. - /// The first source matrix. - /// The second source matrix. - /// The matrix containing the resulting values. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Subtract(Matrix3X2 value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Matrix3X2.Ops.gen.cs b/sources/Maths/Maths/Matrix3X2.Ops.gen.cs new file mode 100644 index 0000000000..f8aa0e2e8e --- /dev/null +++ b/sources/Maths/Maths/Matrix3X2.Ops.gen.cs @@ -0,0 +1,127 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix3X2 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix3X2 Lerp(Matrix3X2 value1, Matrix3X2 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector2D.Lerp(value1.Row1, value2.Row1, amount), + Vector2D.Lerp(value1.Row2, value2.Row2, amount), + Vector2D.Lerp(value1.Row3, value2.Row3, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix3X2 Add(Matrix3X2 left, Matrix3X2 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix3X2 Negate(Matrix3X2 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix3X2 Subtract(Matrix3X2 left, Matrix3X2 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix3X2 Multiply(Matrix3X2 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix3X2 Multiply(T left, Matrix3X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector2D Multiply(Vector3D rowVector, Matrix3X2 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector3D Multiply(Matrix3X2 matrix, Vector2D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 Multiply(Matrix2X3 left, Matrix3X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 Multiply(Matrix3X2 left, Matrix2X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 Multiply(Matrix3X2 left, Matrix2X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 Multiply(Matrix3X2 left, Matrix2X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 Multiply(Matrix3X3 left, Matrix3X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 Multiply(Matrix4X3 left, Matrix3X2 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix3X2.cs b/sources/Maths/Maths/Matrix3X2.cs index 8d80e72d79..9a1c68fe83 100644 --- a/sources/Maths/Maths/Matrix3X2.cs +++ b/sources/Maths/Maths/Matrix3X2.cs @@ -1,159 +1,18 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 3x2 matrix. - [Serializable] - [DataContract] - public struct Matrix3X2 - : IEquatable> - where T : unmanaged, IFormattable, IComparable, IEquatable + public partial struct Matrix3X2 { private static readonly Matrix3X2 _identity = new( - Scalar.One, Scalar.Zero, - Scalar.Zero, Scalar.One, - Scalar.Zero, Scalar.Zero + T.One, T.Zero, + T.Zero, T.One, + T.Zero, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Row2; - - /// - /// Row 3 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Row3; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column1 => new(Row1.X, Row2.X, Row3.X); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column2 => new(Row1.Y, Row2.Y, Row3.Y); - - /// The first element of the first row - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// The second element of the first row - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// The first element of the second row - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// The second element of the second row - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// The first element of the third row - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// The second element of the third row - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector2D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 2 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// Constructs a from the given components. - public Matrix3X2(T m11, T m12, - T m21, T m22, - T m31, T m32) - { - Row1 = new(m11, m12); - Row2 = new(m21, m22); - Row3 = new(m31, m32); - } - - /// - /// Constructs a from the given rows. - /// - public Matrix3X2(Vector2D row1, Vector2D row2, Vector2D row3) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - } - /// Constructs a from the given Matrix4x3. /// The source Matrix4x3. public Matrix3X2(Matrix4X3 value) @@ -206,130 +65,6 @@ public Matrix3X2(Matrix4X2 value) [IgnoreDataMember] public readonly bool IsIdentity => this == Identity; - /// Adds each matrix element in value1 with its corresponding element in value2. - /// The first source matrix. - /// The second source matrix. - /// The matrix containing the summed values. - public static Matrix3X2 operator +(Matrix3X2 value1, Matrix3X2 value2) - { - return new(value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3); - } - - /// Returns a boolean indicating whether the given matrices are equal. - /// The first source matrix. - /// The second source matrix. - /// True if the matrices are equal; False otherwise. - public static bool operator ==(Matrix3X2 value1, Matrix3X2 value2) - { - return (Scalar.Equal(value1.M11, value2.M11) - && Scalar.Equal(value1.M22, value2.M22) // Check diagonal element first for early out - && Scalar.Equal(value1.M12, value2.M12) - && Scalar.Equal(value1.M21, value2.M21) - && Scalar.Equal(value1.M31, value2.M31) - && Scalar.Equal(value1.M32, value2.M32)); - } - - /// Returns a boolean indicating whether the given matrices are not equal. - /// The first source matrix. - /// The second source matrix. - /// True if the matrices are not equal; False if they are equal. - public static bool operator !=(Matrix3X2 value1, Matrix3X2 value2) - { - return (Scalar.NotEqual(value1.M11, value2.M11) - || Scalar.NotEqual(value1.M22, value2.M22) // Check diagonal element first for early out - || Scalar.NotEqual(value1.M12, value2.M12) - || Scalar.NotEqual(value1.M21, value2.M21) - || Scalar.NotEqual(value1.M31, value2.M31) - || Scalar.NotEqual(value1.M32, value2.M32)); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X3 operator *(Matrix3X2 value1, Matrix2X3 value2) - { - return new(value1.M11 * value2.Row1 * value1.M12 * value2.Row2, - value1.M21 * value2.Row1 * value1.M22 * value2.Row2, - value1.M31 * value2.Row1 * value1.M32 * value2.Row2); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector2D operator *(Vector3D value1, Matrix3X2 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X2 operator *(Matrix3X2 value1, Matrix2X2 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X2 operator *(Matrix3X3 value1, Matrix3X2 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M33 * value2.Row3, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M23 * value2.Row3 - ); - } - - /// Scales all elements in a matrix by the given scalar factor. - /// The source matrix. - /// The scaling value to use. - /// The resulting matrix. - public static Matrix3X2 operator *(Matrix3X2 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2, value1.Row3 * value2); - } - - /// Subtracts each matrix element in value2 from its corresponding element in value1. - /// The first source matrix. - /// The second source matrix. - /// The matrix containing the resulting values. - public static Matrix3X2 operator -(Matrix3X2 value1, Matrix3X2 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2, value1.Row3 - value2.Row3); - } - - /// Negates the given matrix by multiplying all values by -1. - /// The source matrix. - /// The negated matrix. - public static Matrix3X2 operator -(Matrix3X2 value) - { - return new(-value.Row1, -value.Row2, -value.Row3); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix3X2 other) && Equals(other); - - /// Returns a boolean indicating whether the matrix is equal to the other given matrix. - /// The other matrix to test equality against. - /// True if this matrix is equal to other; False otherwise. - public readonly bool Equals(Matrix3X2 other) - { - return this == other; - } - /// Calculates the determinant for this matrix. /// The determinant is calculated by expanding the matrix with a third column whose values are (0,0,1). /// The determinant. @@ -351,190 +86,7 @@ public readonly T GetDeterminant() // // Collapse out the constants and oh look, this is just a 2x2 determinant! - return Scalar.Subtract(Scalar.Multiply(M11, M22), Scalar.Multiply(M21, M12)); - } - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(M11, M12, M21, M22, M31, M32); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} {{M31:{4} M32:{5}}} }}", - M11, M12, - M21, M22, - M31, M32); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into a one. - /// - /// The source matrix - /// The matrix - public static explicit operator System.Numerics.Matrix3x2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X2(Matrix3X2 from) - => new( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix3X2 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As()); + return (Row1.X * Row2.Y) - (Row2.X * Row1.Y); } } } diff --git a/sources/Maths/Maths/Matrix3X2.gen.cs b/sources/Maths/Maths/Matrix3X2.gen.cs new file mode 100644 index 0000000000..24d5dfca03 --- /dev/null +++ b/sources/Maths/Maths/Matrix3X2.gen.cs @@ -0,0 +1,527 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 3x2 matrix. + [Serializable] + [DataContract] + public partial struct Matrix3X2 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row3; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column1 => new(Row1.X, Row2.X, Row3.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column2 => new(Row1.Y, Row2.Y, Row3.Y); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector2D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix3X2(Vector2D row1, Vector2D row2, Vector2D row3) => + (Row1, Row2, Row3) = (row1, row2, row3); + + /// Constructs a from the given components. + public Matrix3X2( + T m11, T m12, + T m21, T m22, + T m31, T m32) + { + Row1 = new(m11, m12); + Row2 = new(m21, m22); + Row3 = new(m31, m32); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} {{M31:{4} M32:{5}}} }}", + Row1.X, Row1.Y, + Row2.X, Row2.Y, + Row3.X, Row3.Y); + + /// + public override bool Equals(object? obj) => obj is Matrix3X2 other && Equals(other); + + /// + public bool Equals(Matrix3X2 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3); + + /// Converts the components of this matrix to another type. + public static Matrix3X2 CreateChecked(Matrix3X2 other) + where TOther : INumberBase => + new(Vector2D.CreateChecked(other.Row1), Vector2D.CreateChecked(other.Row2), Vector2D.CreateChecked(other.Row3)); + + /// Converts the components of this matrix to another type. + public static Matrix3X2 CreateSaturating(Matrix3X2 other) + where TOther : INumberBase => + new(Vector2D.CreateSaturating(other.Row1), Vector2D.CreateSaturating(other.Row2), Vector2D.CreateSaturating(other.Row3)); + + /// Converts the components of this matrix to another type. + public static Matrix3X2 CreateTruncating(Matrix3X2 other) + where TOther : INumberBase => + new(Vector2D.CreateTruncating(other.Row1), Vector2D.CreateTruncating(other.Row2), Vector2D.CreateTruncating(other.Row3)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix3X2 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As()); + + /// Converts the components of this matrix to another type. + public Matrix3X2 AsChecked() + where TOther : INumberBase => + Matrix3X2.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix3X2 AsSaturating() + where TOther : INumberBase => + Matrix3X2.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix3X2 AsTruncating() + where TOther : INumberBase => + Matrix3X2.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix2X3 Transpose() => + new(Column1, + Column2); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix3X2 left, Matrix3X2 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix3X2 left, Matrix3X2 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix3X2 operator +(Matrix3X2 left, Matrix3X2 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix3X2 operator -(Matrix3X2 left, Matrix3X2 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix3X2 operator -(Matrix3X2 value) => + new(-value.Row1, + -value.Row2, + -value.Row3); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix3X2 operator *(T left, Matrix3X2 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix3X2 operator *(Matrix3X2 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector2D operator *(Vector3D rowVector, Matrix3X2 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2 + rowVector.Z * matrix.Row3; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector3D operator *(Matrix3X2 matrix, Vector2D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 operator *(Matrix3X2 left, Matrix2X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2, + left.M31 * right.Row1 + left.M32 * right.Row2); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 operator *(Matrix3X2 left, Matrix2X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2, + left.M31 * right.Row1 + left.M32 * right.Row2); + + /// Converts a to a . + public static explicit operator Matrix3X2(Matrix3x2 from) => + new(T.CreateTruncating(from.M11), T.CreateTruncating(from.M12), + T.CreateTruncating(from.M21), T.CreateTruncating(from.M22), + T.CreateTruncating(from.M31), T.CreateTruncating(from.M32)); + + /// Converts a to a . + public static explicit operator checked Matrix3X2(Matrix3x2 from) => + new(T.CreateChecked(from.M11), T.CreateChecked(from.M12), + T.CreateChecked(from.M21), T.CreateChecked(from.M22), + T.CreateChecked(from.M31), T.CreateChecked(from.M32)); + + /// Converts a to . + public static explicit operator Matrix3x2(Matrix3X2 from) => + new(float.CreateTruncating(from.M11), float.CreateTruncating(from.M12), + float.CreateTruncating(from.M21), float.CreateTruncating(from.M22), + float.CreateTruncating(from.M31), float.CreateTruncating(from.M32)); + + /// Converts a to . + public static explicit operator checked Matrix3x2(Matrix3X2 from) => + new(float.CreateChecked(from.M11), float.CreateChecked(from.M12), + float.CreateChecked(from.M21), float.CreateChecked(from.M22), + float.CreateChecked(from.M31), float.CreateChecked(from.M32)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X2(Matrix3X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3)); + } +} diff --git a/sources/Maths/Maths/Matrix3X3.Ops.cs b/sources/Maths/Maths/Matrix3X3.Ops.cs index 2b11c28756..a683892cce 100644 --- a/sources/Maths/Maths/Matrix3X3.Ops.cs +++ b/sources/Maths/Maths/Matrix3X3.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -9,13 +10,14 @@ namespace Silk.NET.Maths /// /// Methods for working with /// - public static class Matrix3X3 + public static partial class Matrix3X3 { private const float BillboardEpsilon = 1e-4f; private const float DecomposeEpsilon = 0.0001f; + /* private struct CanonicalBasis - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { public Vector3D Row0; public Vector3D Row1; @@ -23,7 +25,7 @@ private struct CanonicalBasis }; private struct VectorBasis - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { #pragma warning disable 649 public unsafe Vector3D* Element0; @@ -31,17 +33,7 @@ private struct VectorBasis public unsafe Vector3D* Element2; #pragma warning restore 649 } - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Add(Matrix3X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } + */ /// Creates a spherical billboard that rotates around a specified object position. /// Position of the object the billboard will rotate around. @@ -50,18 +42,18 @@ public static Matrix3X3 Add(Matrix3X3 value1, Matrix3X3 value2) /// The forward vector of the camera. /// The created billboard matrix public static Matrix3X3 CreateBillboard(Vector3D objectPosition, Vector3D cameraPosition, Vector3D cameraUpVector, Vector3D cameraForwardVector) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { Vector3D zaxis = objectPosition - cameraPosition; var norm = zaxis.LengthSquared; - if (!Scalar.GreaterThanOrEqual(norm, Scalar.As(BillboardEpsilon))) + if (!(norm >= T.CreateTruncating(BillboardEpsilon))) { zaxis = -cameraForwardVector; } else { - zaxis = Vector3D.Multiply(zaxis, Scalar.Reciprocal(Scalar.Sqrt(norm))); + zaxis = Vector3D.Multiply(zaxis, T.One / T.Sqrt(norm)); } Vector3D xaxis = Vector3D.Normalize(Vector3D.Cross(cameraUpVector, zaxis)); @@ -75,7 +67,7 @@ public static Matrix3X3 CreateBillboard(Vector3D objectPosition, Vector /// The angle to rotate around the given axis, in radians. /// The rotation matrix. public static Matrix3X3 CreateFromAxisAngle(Vector3D axis, T angle) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { // a: angle // x, y, z: unit vector for axis. @@ -103,23 +95,23 @@ public static Matrix3X3 CreateFromAxisAngle(Vector3D axis, T angle) // [ zx-cosa*zx-sina*y zy-cosa*zy+sina*x zz+cosa*(1-zz) ] // T x = axis.X, y = axis.Y, z = axis.Z; - T sa = Scalar.Sin(angle), ca = Scalar.Cos(angle); - T xx = Scalar.Multiply(x, x), yy = Scalar.Multiply(y, y), zz = Scalar.Multiply(z, z); - T xy = Scalar.Multiply(x, y), xz = Scalar.Multiply(x, z), yz = Scalar.Multiply(y, z); + T sa = T.Sin(angle), ca = T.Cos(angle); + T xx = x * x, yy = y * y, zz = z * z; + T xy = x * y, xz = x * z, yz = y * z; Matrix3X3 result = Matrix3X3.Identity; - result.M11 = Scalar.Add(xx, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, xx))); - result.M12 = Scalar.Add(Scalar.Subtract(xy, Scalar.Multiply(ca, xy)), Scalar.Multiply(sa, z)); - result.M13 = Scalar.Subtract(Scalar.Subtract(xz, Scalar.Multiply(ca, xz)), Scalar.Multiply(sa, y)); + result.M11 = xx + (ca * (T.One - xx)); + result.M12 = xy - (ca * xy) + (sa * z); + result.M13 = xz - (ca * xz) - (sa * y); - result.M21 = Scalar.Subtract(Scalar.Subtract(xy, Scalar.Multiply(ca, xy)), Scalar.Multiply(sa, z)); - result.M22 = Scalar.Add(yy, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, yy))); - result.M23 = Scalar.Add(Scalar.Subtract(yz, Scalar.Multiply(ca, yz)), Scalar.Multiply(sa, x)); + result.M21 = xy - (ca * xy) - (sa * z); + result.M22 = yy + (ca * (T.One - yy)); + result.M23 = yz - (ca * yz) + (sa * x); - result.M31 = Scalar.Add(Scalar.Subtract(xz, Scalar.Multiply(ca, xz)), Scalar.Multiply(sa, y)); - result.M32 = Scalar.Subtract(Scalar.Subtract(yz, Scalar.Multiply(ca, yz)), Scalar.Multiply(sa, x)); - result.M33 = Scalar.Add(zz, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, zz))); + result.M31 = xz - (ca * xz) + (sa * y); + result.M32 = yz - (ca * yz) - (sa * x); + result.M33 = zz + (ca * (T.One - zz)); return result; } @@ -128,32 +120,32 @@ public static Matrix3X3 CreateFromAxisAngle(Vector3D axis, T angle) /// The source Quaternion. /// The rotation matrix. public static Matrix3X3 CreateFromQuaternion(Quaternion quaternion) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { Matrix3X3 result = Matrix3X3.Identity; - T xx = Scalar.Multiply(quaternion.X, quaternion.X); - T yy = Scalar.Multiply(quaternion.Y, quaternion.Y); - T zz = Scalar.Multiply(quaternion.Z, quaternion.Z); + T xx = quaternion.X * quaternion.X; + T yy = quaternion.Y * quaternion.Y; + T zz = quaternion.Z * quaternion.Z; - T xy = Scalar.Multiply(quaternion.X, quaternion.Y); - T wz = Scalar.Multiply(quaternion.Z, quaternion.W); - T xz = Scalar.Multiply(quaternion.Z, quaternion.X); - T wy = Scalar.Multiply(quaternion.Y, quaternion.W); - T yz = Scalar.Multiply(quaternion.Y, quaternion.Z); - T wx = Scalar.Multiply(quaternion.X, quaternion.W); + T xy = quaternion.X * quaternion.Y; + T wz = quaternion.Z * quaternion.W; + T xz = quaternion.Z * quaternion.X; + T wy = quaternion.Y * quaternion.W; + T yz = quaternion.Y * quaternion.Z; + T wx = quaternion.X * quaternion.W; - result.M11 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(yy, zz))); - result.M12 = Scalar.Multiply(Scalar.Two, Scalar.Add(xy, wz)); - result.M13 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(xz, wy)); + result.M11 = T.One - (T.CreateTruncating(2) * (yy + zz)); + result.M12 = T.CreateTruncating(2) * (xy + wz); + result.M13 = T.CreateTruncating(2) * (xz - wy); - result.M21 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(xy, wz)); - result.M22 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(zz, xx))); - result.M23 = Scalar.Multiply(Scalar.Two, Scalar.Add(yz, wx)); + result.M21 = T.CreateTruncating(2) * (xy - wz); + result.M22 = T.One - (T.CreateTruncating(2) * (zz + xx)); + result.M23 = T.CreateTruncating(2) * (yz + wx); - result.M31 = Scalar.Multiply(Scalar.Two, Scalar.Add(xz, wy)); - result.M32 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(yz, wx)); - result.M33 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(yy, xx))); + result.M31 = T.CreateTruncating(2) * (xz + wy); + result.M32 = T.CreateTruncating(2) * (yz - wx); + result.M33 = T.One - (T.CreateTruncating(2) * (yy + xx)); return result; } @@ -165,9 +157,9 @@ public static Matrix3X3 CreateFromQuaternion(Quaternion quaternion) /// Angle of rotation, in radians, around the Z-axis. /// The rotation matrix. public static Matrix3X3 CreateFromYawPitchRoll(T yaw, T pitch, T roll) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { - Quaternion q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); + var q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); return CreateFromQuaternion(q); } @@ -175,12 +167,12 @@ public static Matrix3X3 CreateFromYawPitchRoll(T yaw, T pitch, T roll) /// The amount, in radians, by which to rotate around the X-axis. /// The rotation matrix. public static Matrix3X3 CreateRotationX(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix3X3 result = Matrix3X3.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); // [ 1 0 0 0 ] // [ 0 c s 0 ] @@ -189,7 +181,7 @@ public static Matrix3X3 CreateRotationX(T radians) result.M22 = c; result.M23 = s; - result.M32 = Scalar.Negate(s); + result.M32 = -s; result.M33 = c; return result; @@ -199,19 +191,19 @@ public static Matrix3X3 CreateRotationX(T radians) /// The amount, in radians, by which to rotate around the Y-axis. /// The rotation matrix. public static Matrix3X3 CreateRotationY(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix3X3 result = Matrix3X3.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); // [ c 0 -s 0 ] // [ 0 1 0 0 ] // [ s 0 c 0 ] // [ 0 0 0 1 ] result.M11 = c; - result.M13 = Scalar.Negate(s); + result.M13 = -s; result.M31 = s; result.M33 = c; @@ -222,12 +214,12 @@ public static Matrix3X3 CreateRotationY(T radians) /// The amount, in radians, by which to rotate around the Z-axis. /// The rotation matrix. public static Matrix3X3 CreateRotationZ(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix3X3 result = Matrix3X3.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); // [ c s 0 0 ] // [ -s c 0 0 ] @@ -235,7 +227,7 @@ public static Matrix3X3 CreateRotationZ(T radians) // [ 0 0 0 1 ] result.M11 = c; result.M12 = s; - result.M21 = Scalar.Negate(s); + result.M21 = -s; result.M22 = c; return result; @@ -247,7 +239,7 @@ public static Matrix3X3 CreateRotationZ(T radians) /// Value to scale by on the Z-axis. /// The scaling matrix. public static Matrix3X3 CreateScale(T xScale, T yScale, T zScale) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X3 result = Matrix3X3.Identity; result.M11 = xScale; @@ -260,7 +252,7 @@ public static Matrix3X3 CreateScale(T xScale, T yScale, T zScale) /// The vector containing the amount to scale by on each axis. /// The scaling matrix. public static Matrix3X3 CreateScale(Vector3D scales) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X3 result = Matrix3X3.Identity; result.M11 = scales.X; @@ -273,7 +265,7 @@ public static Matrix3X3 CreateScale(Vector3D scales) /// The uniform scaling factor. /// The scaling matrix. public static Matrix3X3 CreateScale(T scale) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix3X3 result = Matrix3X3.Identity; @@ -284,97 +276,15 @@ public static Matrix3X3 CreateScale(T scale) return result; } - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Multiply(Matrix3X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X3 Multiply(Matrix2X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Multiply(Matrix3X3 value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Multiply(Matrix4X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Multiply(Matrix3X3 value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Multiply(Matrix3X3 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector3D value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Negate(Matrix3X3 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Subtract(Matrix3X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - + /* /// Attempts to extract the scale, translation, and rotation components from the given scale/rotation/translation matrix. /// If successful, the out parameters will contained the extracted values. /// The source matrix. /// The scaling component of the transformation matrix. /// The rotation component of the transformation matrix. /// True if the source matrix was successfully decomposed; False otherwise. - public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable + public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out Silk.NET.Maths.Legacy.Quaternion rotation) + where T : INumberBase { bool result = true; @@ -392,17 +302,17 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out CanonicalBasis canonicalBasis = default; Vector3D* pCanonicalBasis = &canonicalBasis.Row0; - canonicalBasis.Row0 = new Vector3D(Scalar.One, Scalar.Zero, Scalar.Zero); - canonicalBasis.Row1 = new Vector3D(Scalar.Zero, Scalar.One, Scalar.Zero); - canonicalBasis.Row2 = new Vector3D(Scalar.Zero, Scalar.Zero, Scalar.One); + canonicalBasis.Row0 = new Vector3D(T.One, T.Zero, T.Zero); + canonicalBasis.Row1 = new Vector3D(T.Zero, T.One, T.Zero); + canonicalBasis.Row2 = new Vector3D(T.Zero, T.Zero, T.One); pVectorBasis[0] = &matTemp.Row1; pVectorBasis[1] = &matTemp.Row2; pVectorBasis[2] = &matTemp.Row3; - *(pVectorBasis[0]) = new Vector3D(matrix.M11, matrix.M12, matrix.M13); - *(pVectorBasis[1]) = new Vector3D(matrix.M21, matrix.M22, matrix.M23); - *(pVectorBasis[2]) = new Vector3D(matrix.M31, matrix.M32, matrix.M33); + *pVectorBasis[0] = new Vector3D(matrix.M11, matrix.M12, matrix.M13); + *pVectorBasis[1] = new Vector3D(matrix.M21, matrix.M22, matrix.M23); + *pVectorBasis[2] = new Vector3D(matrix.M31, matrix.M32, matrix.M33); scale.X = pVectorBasis[0]->Length; scale.Y = pVectorBasis[1]->Length; @@ -411,9 +321,9 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out uint a, b, c; #region Ranking T x = pfScales[0], y = pfScales[1], z = pfScales[2]; - if (!Scalar.GreaterThanOrEqual(x, y)) + if (!(x >= y)) { - if (!Scalar.GreaterThanOrEqual(y, z)) + if (!(y >= z)) { a = 2; b = 1; @@ -423,7 +333,7 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out { a = 1; - if (!Scalar.GreaterThanOrEqual(x, z)) + if (!(x >= z)) { b = 2; c = 0; @@ -437,7 +347,7 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out } else { - if (!Scalar.GreaterThanOrEqual(x, z)) + if (!(x >= z)) { a = 2; b = 0; @@ -447,7 +357,7 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out { a = 0; - if (!Scalar.GreaterThanOrEqual(y, z)) + if (!(y >= z)) { b = 2; c = 1; @@ -461,32 +371,32 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out } #endregion - if (!Scalar.GreaterThanOrEqual(pfScales[a], Scalar.As(DecomposeEpsilon))) + if (!(pfScales[a] >= T.CreateTruncating(DecomposeEpsilon))) { *(pVectorBasis[a]) = pCanonicalBasis[a]; } *pVectorBasis[a] = Vector3D.Normalize(*pVectorBasis[a]); - if (!Scalar.GreaterThanOrEqual(pfScales[b], Scalar.As(DecomposeEpsilon))) + if (!(pfScales[b] >= T.CreateTruncating(DecomposeEpsilon))) { uint cc; T fAbsX, fAbsY, fAbsZ; - fAbsX = Scalar.Abs(pVectorBasis[a]->X); - fAbsY = Scalar.Abs(pVectorBasis[a]->Y); - fAbsZ = Scalar.Abs(pVectorBasis[a]->Z); + fAbsX = T.Abs(pVectorBasis[a]->X); + fAbsY = T.Abs(pVectorBasis[a]->Y); + fAbsZ = T.Abs(pVectorBasis[a]->Z); #region Ranking - if (!Scalar.GreaterThanOrEqual(fAbsX, fAbsY)) + if (!(fAbsX >= fAbsY)) { - if (!Scalar.GreaterThanOrEqual(fAbsY, fAbsZ)) + if (!(fAbsY >= fAbsZ)) { cc = 0; } else { - if (!Scalar.GreaterThanOrEqual(fAbsX, fAbsZ)) + if (!(fAbsX >= fAbsZ)) { cc = 0; } @@ -498,13 +408,13 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out } else { - if (!Scalar.GreaterThanOrEqual(fAbsX, fAbsZ)) + if (!(fAbsX >= fAbsZ)) { cc = 1; } else { - if (!Scalar.GreaterThanOrEqual(fAbsY, fAbsZ)) + if (!(fAbsY >= fAbsZ)) { cc = 1; } @@ -521,7 +431,7 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out *pVectorBasis[b] = Vector3D.Normalize(*pVectorBasis[b]); - if (!Scalar.GreaterThanOrEqual(pfScales[c], Scalar.As(DecomposeEpsilon))) + if (!(pfScales[c] >= T.CreateTruncating(DecomposeEpsilon))) { *pVectorBasis[c] = Vector3D.Cross(*pVectorBasis[a], *pVectorBasis[b]); } @@ -531,98 +441,84 @@ public static bool Decompose(Matrix3X3 matrix, out Vector3D scale, out det = matTemp.GetDeterminant(); // use Kramer's rule to check for handedness of coordinate system - if (!Scalar.GreaterThanOrEqual(det, Scalar.Zero)) + if (!(det >= T.Zero)) { // switch coordinate system by negating the scale and inverting the basis vector on the x-axis - pfScales[a] = Scalar.Negate(pfScales[a]); + pfScales[a] = -pfScales[a]; *pVectorBasis[a] = -(*pVectorBasis[a]); - det = Scalar.Negate(det); + det = -det; } - det = Scalar.Subtract(det, Scalar.One); - det = Scalar.Multiply(det, det); + det = det - T.One; + det = det * det; - if (!Scalar.GreaterThanOrEqual(Scalar.As(DecomposeEpsilon), det)) + if (!(T.CreateTruncating(DecomposeEpsilon) >= det)) { // Non-SRT matrix encountered - rotation = Quaternion.Identity; + rotation = Legacy.Quaternion.Identity; result = false; } else { // generate the quaternion from the matrix - rotation = Quaternion.CreateFromRotationMatrix(matTemp); + rotation = Legacy.Quaternion.CreateFromRotationMatrix(matTemp); } } } return result; } - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix3X3 Lerp(Matrix3X3 matrix1, Matrix3X3 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Vector3D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector3D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector3D.Lerp(matrix1.Row3, matrix2.Row3, amount) - ); - } + */ /// Transforms the given matrix by applying the given Quaternion rotation. /// The source matrix to transform. /// The rotation to apply. /// The transformed matrix. public static Matrix3X3 Transform(Matrix3X3 value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { // Compute rotation matrix. - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - T q11 = Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2); - T q21 = Scalar.Subtract(xy2, wz2); - T q31 = Scalar.Add(xz2, wy2); - - T q12 = Scalar.Add(xy2, wz2); - T q22 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2); - T q32 = Scalar.Subtract(yz2, wx2); - - T q13 = Scalar.Subtract(xz2, wy2); - T q23 = Scalar.Add(yz2, wx2); - T q33 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2); + T x2 = rotation.X + rotation.X; + T y2 = rotation.Y + rotation.Y; + T z2 = rotation.Z + rotation.Z; + + T wx2 = rotation.W * x2; + T wy2 = rotation.W * y2; + T wz2 = rotation.W * z2; + T xx2 = rotation.X * x2; + T xy2 = rotation.X * y2; + T xz2 = rotation.X * z2; + T yy2 = rotation.Y * y2; + T yz2 = rotation.Y * z2; + T zz2 = rotation.Z * z2; + + T q11 = T.One - yy2 - zz2; + T q21 = xy2 - wz2; + T q31 = xz2 + wy2; + + T q12 = xy2 + wz2; + T q22 = T.One - xx2 - zz2; + T q32 = yz2 - wx2; + + T q13 = xz2 - wy2; + T q23 = yz2 + wx2; + T q33 = T.One - xx2 - yy2; var q1 = new Vector3D(q11, q12, q13); var q2 = new Vector3D(q21, q22, q23); var q3 = new Vector3D(q31, q32, q33); - return new(value.M11 * q1 + value.M12 * q2 + value.M13 * q3, value.M21 * q1 + value.M22 * q2 + value.M23 * q3, value.M31 * q1 + value.M32 * q2 + value.M33 * q3); + return new((value.M11 * q1) + (value.M12 * q2) + (value.M13 * q3), (value.M21 * q1) + (value.M22 * q2) + (value.M23 * q3), (value.M31 * q1) + (value.M32 * q2) + (value.M33 * q3)); } /// Transposes the rows and columns of a matrix. /// The source matrix. /// The transposed matrix. public static unsafe Matrix3X3 Transpose(Matrix3X3 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { return new(matrix.Column1, matrix.Column2, matrix.Column3); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Matrix3X3.Ops.gen.cs b/sources/Maths/Maths/Matrix3X3.Ops.gen.cs new file mode 100644 index 0000000000..5d0b5e91c9 --- /dev/null +++ b/sources/Maths/Maths/Matrix3X3.Ops.gen.cs @@ -0,0 +1,119 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix3X3 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix3X3 Lerp(Matrix3X3 value1, Matrix3X3 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector3D.Lerp(value1.Row1, value2.Row1, amount), + Vector3D.Lerp(value1.Row2, value2.Row2, amount), + Vector3D.Lerp(value1.Row3, value2.Row3, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix3X3 Add(Matrix3X3 left, Matrix3X3 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix3X3 Negate(Matrix3X3 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix3X3 Subtract(Matrix3X3 left, Matrix3X3 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix3X3 Multiply(Matrix3X3 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix3X3 Multiply(T left, Matrix3X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector3D Multiply(Vector3D rowVector, Matrix3X3 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector3D Multiply(Matrix3X3 matrix, Vector3D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 Multiply(Matrix2X3 left, Matrix3X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 Multiply(Matrix3X3 left, Matrix3X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 Multiply(Matrix3X3 left, Matrix3X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 Multiply(Matrix3X3 left, Matrix3X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 Multiply(Matrix4X3 left, Matrix3X3 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix3X3.cs b/sources/Maths/Maths/Matrix3X3.cs index 755697a772..30f4f53403 100644 --- a/sources/Maths/Maths/Matrix3X3.cs +++ b/sources/Maths/Maths/Matrix3X3.cs @@ -1,196 +1,17 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - namespace Silk.NET.Maths { - /// A structure encapsulating a 3x3 matrix. - [Serializable] - [DataContract] - public struct Matrix3X3 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix3X3 { - private static readonly Matrix3X3 _identity = new - ( - Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.One - ); - - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row2; - - /// - /// Row 3 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row3; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column1 => new(Row1.X, Row2.X, Row3.X); - - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column2 => new(Row1.Y, Row2.Y, Row3.Y); - - - /// - /// Column 3 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column3 => new(Row1.Z, Row2.Z, Row3.Z); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// Value at row 3, column 1 of the matrix. - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// Value at row 3, column 2 of the matrix. - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// Value at row 3, column 3 of the matrix. - [DataMember] - public T M33 - { - readonly get => Row3.Z; - set => Row3.Z = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector3D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 2 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int i] - { - get - { - var row = this[x]; - return row[i]; - } - } - - /// - /// Constructs a from the given rows. - /// - public Matrix3X3(Vector3D row1, Vector3D row2, Vector3D row3) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - } - - /// Constructs a from the given components. - public Matrix3X3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33) - { - Row1 = new(m11, m12, m13); - Row2 = new(m21, m22, m23); - Row3 = new(m31, m32, m33); - } - /// Constructs a from the given . /// The source . public Matrix3X3(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default); - Row2 = new(value.M21, value.M22, default); - Row3 = new(value.M31, value.M32, Scalar.One); + Row1 = new(value.M11, value.M12, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero); + Row3 = new(value.M31, value.M32, T.One); } /// Constructs a from the given . @@ -233,9 +54,9 @@ public Matrix3X3(Matrix2X4 value) /// The source . public Matrix3X3(Matrix4X2 value) { - Row1 = new(value.M11, value.M12, default); - Row2 = new(value.M21, value.M22, default); - Row3 = new(value.M31, value.M32, Scalar.One); + Row1 = new(value.M11, value.M12, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero); + Row3 = new(value.M31, value.M32, T.One); } /// Constructs a from the given . @@ -247,115 +68,6 @@ public Matrix3X3(Matrix4X4 value) Row3 = new(value.M31, value.M32, value.M33); } - /// Returns the multiplicative identity matrix. - public static Matrix3X3 Identity => _identity; - - /// Returns whether the matrix is the identity matrix. - [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && Scalar.Equal(M22, Scalar.One) && - Scalar.Equal(M33, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M21, Scalar.Zero) && Scalar.Equal(M23, Scalar.Zero) && - Scalar.Equal(M31, Scalar.Zero) && Scalar.Equal(M32, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix3X3 operator +(Matrix3X3 value1, Matrix3X3 value2) - { - return new(value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix3X3 value1, Matrix3X3 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - Scalar.Equal(value1.M33, value2.M33) && - // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M21, value2.M21) && Scalar.Equal(value1.M23, value2.M23) && - Scalar.Equal(value1.M31, value2.M31) && Scalar.Equal(value1.M32, value2.M32); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix3X3 value1, Matrix3X3 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || Scalar.NotEqual(value1.M22, value2.M22) || - Scalar.NotEqual(value1.M33, value2.M33) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M21, value2.M21) || Scalar.NotEqual(value1.M23, value2.M23) || - Scalar.NotEqual(value1.M31, value2.M31) || Scalar.NotEqual(value1.M32, value2.M32); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X3 operator *(Matrix3X3 value1, Matrix3X3 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector3D operator *(Vector3D value1, Matrix3X3 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3; - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix3X3 operator *(Matrix3X3 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2, value1.Row3 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix3X3 operator -(Matrix3X3 value1, Matrix3X3 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2, value1.Row3 - value2.Row3); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix3X3 operator -(Matrix3X3 value) - { - return new(-value.Row1, -value.Row2, -value.Row3); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix3X3 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix3X3 other) - => this == other; - /// Calculates the determinant of the matrix. /// The determinant of the matrix. public readonly T GetDeterminant() @@ -364,186 +76,11 @@ public readonly T GetDeterminant() // | d e f | = ( a ( ei - fh ) - b ( di - fg ) + c ( dh - eg ) ) // | g h i | - T a = M11, b = M12, c = M13; - T d = M21, e = M22, f = M23; - T g = M31, h = M32, i = M33; - - return Scalar.Add( - Scalar.Subtract( - Scalar.Multiply(a, Scalar.Subtract(Scalar.Multiply(e, i), Scalar.Multiply(f, h))), - Scalar.Multiply(b, Scalar.Subtract(Scalar.Multiply(d, i), Scalar.Multiply(f, g)))), - Scalar.Multiply(c, Scalar.Subtract(Scalar.Multiply(d, h), Scalar.Multiply(e, g)))); - } - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - - hash.Add(M31); - hash.Add(M32); - hash.Add(M33); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2} }} {{M21:{3} M22:{4} M23:{5} }} {{M31:{6} M32:{7} M33:{8}}} }}", - M11, M12, M13, - M21, M22, M23, - M31, M32, M33); - } + T a = Row1.X, b = Row1.Y, c = Row1.Z; + T d = Row2.X, e = Row2.Y, f = Row2.Z; + T g = Row3.X, h = Row3.Y, i = Row3.Z; - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), - Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), - Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), - Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X3(Matrix3X3 from) - => new(Scalar.As(from.M11), Scalar.As(from.M12), Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), Scalar.As(from.M33)); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix3X3 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As()); + return (a * ((e * i) - (f * h))) - (b * ((d * i) - (f * g))) + (c * ((d * h) - (e * g))); } } } diff --git a/sources/Maths/Maths/Matrix3X3.gen.cs b/sources/Maths/Maths/Matrix3X3.gen.cs new file mode 100644 index 0000000000..37afef295b --- /dev/null +++ b/sources/Maths/Maths/Matrix3X3.gen.cs @@ -0,0 +1,541 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 3x3 matrix. + [Serializable] + [DataContract] + public partial struct Matrix3X3 : + IEquatable> + where T : INumberBase + { + /// Gets the multiplicative identity matrix of size 3x3. + public static Matrix3X3 Identity { get; } = new( + new(T.One, T.Zero, T.Zero), + new(T.Zero, T.One, T.Zero), + new(T.Zero, T.Zero, T.One)); + + /// Returns whether the matrix is the identity matrix. + [IgnoreDataMember] + public readonly bool IsIdentity => this == Identity; + + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row3; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column1 => new(Row1.X, Row2.X, Row3.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column2 => new(Row1.Y, Row2.Y, Row3.Y); + + /// The 3rd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column3 => new(Row1.Z, Row2.Z, Row3.Z); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// Gets the element in the 3rd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M33 => ref Row3.Z; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector3D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix3X3(Vector3D row1, Vector3D row2, Vector3D row3) => + (Row1, Row2, Row3) = (row1, row2, row3); + + /// Constructs a from the given components. + public Matrix3X3( + T m11, T m12, T m13, + T m21, T m22, T m23, + T m31, T m32, T m33) + { + Row1 = new(m11, m12, m13); + Row2 = new(m21, m22, m23); + Row3 = new(m31, m32, m33); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2}}} {{M21:{3} M22:{4} M23:{5}}} {{M31:{6} M32:{7} M33:{8}}} }}", + Row1.X, Row1.Y, Row1.Z, + Row2.X, Row2.Y, Row2.Z, + Row3.X, Row3.Y, Row3.Z); + + /// + public override bool Equals(object? obj) => obj is Matrix3X3 other && Equals(other); + + /// + public bool Equals(Matrix3X3 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3); + + /// Converts the components of this matrix to another type. + public static Matrix3X3 CreateChecked(Matrix3X3 other) + where TOther : INumberBase => + new(Vector3D.CreateChecked(other.Row1), Vector3D.CreateChecked(other.Row2), Vector3D.CreateChecked(other.Row3)); + + /// Converts the components of this matrix to another type. + public static Matrix3X3 CreateSaturating(Matrix3X3 other) + where TOther : INumberBase => + new(Vector3D.CreateSaturating(other.Row1), Vector3D.CreateSaturating(other.Row2), Vector3D.CreateSaturating(other.Row3)); + + /// Converts the components of this matrix to another type. + public static Matrix3X3 CreateTruncating(Matrix3X3 other) + where TOther : INumberBase => + new(Vector3D.CreateTruncating(other.Row1), Vector3D.CreateTruncating(other.Row2), Vector3D.CreateTruncating(other.Row3)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix3X3 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As()); + + /// Converts the components of this matrix to another type. + public Matrix3X3 AsChecked() + where TOther : INumberBase => + Matrix3X3.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix3X3 AsSaturating() + where TOther : INumberBase => + Matrix3X3.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix3X3 AsTruncating() + where TOther : INumberBase => + Matrix3X3.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix3X3 Transpose() => + new(Column1, + Column2, + Column3); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix3X3 left, Matrix3X3 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix3X3 left, Matrix3X3 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix3X3 operator +(Matrix3X3 left, Matrix3X3 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix3X3 operator -(Matrix3X3 left, Matrix3X3 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix3X3 operator -(Matrix3X3 value) => + new(-value.Row1, + -value.Row2, + -value.Row3); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix3X3 operator *(T left, Matrix3X3 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix3X3 operator *(Matrix3X3 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector3D operator *(Vector3D rowVector, Matrix3X3 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2 + rowVector.Z * matrix.Row3; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector3D operator *(Matrix3X3 matrix, Vector3D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y + matrix.Column3 * columnVector.Z; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 operator *(Matrix2X3 left, Matrix3X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 operator *(Matrix3X3 left, Matrix3X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 operator *(Matrix3X3 left, Matrix3X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X3(Matrix3X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3)); + } +} diff --git a/sources/Maths/Maths/Matrix3X4.Ops.cs b/sources/Maths/Maths/Matrix3X4.Ops.cs deleted file mode 100644 index 3c9c07af8a..0000000000 --- a/sources/Maths/Maths/Matrix3X4.Ops.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - /// - /// Methods for working with - /// - public static class Matrix3X4 - { - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Add(Matrix3X4 value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Multiply(Matrix3X4 value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Multiply(Matrix3X4 value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Multiply(Matrix3X3 value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Multiply(Matrix4X3 value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Multiply(Matrix3X4 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector3D value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Negate(Matrix3X4 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X4 Subtract(Matrix3X4 value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix3X4 Lerp(Matrix3X4 matrix1, Matrix3X4 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Vector4D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector4D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector4D.Lerp(matrix1.Row3, matrix2.Row3, amount) - ); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Matrix3X4.Ops.gen.cs b/sources/Maths/Maths/Matrix3X4.Ops.gen.cs new file mode 100644 index 0000000000..2adf914ae2 --- /dev/null +++ b/sources/Maths/Maths/Matrix3X4.Ops.gen.cs @@ -0,0 +1,127 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix3X4 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix3X4 Lerp(Matrix3X4 value1, Matrix3X4 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector4D.Lerp(value1.Row1, value2.Row1, amount), + Vector4D.Lerp(value1.Row2, value2.Row2, amount), + Vector4D.Lerp(value1.Row3, value2.Row3, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix3X4 Add(Matrix3X4 left, Matrix3X4 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix3X4 Negate(Matrix3X4 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix3X4 Subtract(Matrix3X4 left, Matrix3X4 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix3X4 Multiply(Matrix3X4 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix3X4 Multiply(T left, Matrix3X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector4D Multiply(Vector3D rowVector, Matrix3X4 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector3D Multiply(Matrix3X4 matrix, Vector4D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 Multiply(Matrix2X3 left, Matrix3X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 Multiply(Matrix3X3 left, Matrix3X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 Multiply(Matrix3X4 left, Matrix4X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 Multiply(Matrix3X4 left, Matrix4X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 Multiply(Matrix3X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 Multiply(Matrix4X3 left, Matrix3X4 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix3X4.cs b/sources/Maths/Maths/Matrix3X4.cs index ee466c0958..9382287017 100644 --- a/sources/Maths/Maths/Matrix3X4.cs +++ b/sources/Maths/Maths/Matrix3X4.cs @@ -1,236 +1,35 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 3x4 matrix. - [Serializable] - [DataContract] - public struct Matrix3X4 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix3X4 { private static readonly Matrix3X4 _identity = new ( - Scalar.One, Scalar.Zero, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.One, Scalar.Zero + T.One, T.Zero, T.Zero, T.Zero, + T.Zero, T.One, T.Zero, T.Zero, + T.Zero, T.Zero, T.One, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row2; - - /// - /// Row 3 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row3; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column1 => new(Row1.X, Row2.X, Row3.X); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column2 => new(Row1.Y, Row2.Y, Row3.Y); - - /// - /// Column 3 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column3 => new(Row1.Z, Row2.Z, Row3.Z); - - /// - /// Column 4 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Column4 => new(Row1.W, Row2.W, Row3.W); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 1, column 4 of the matrix. - [DataMember] - public T M14 - { - readonly get => Row1.W; - set => Row1.W = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// Value at row 2, column 4 of the matrix. - [DataMember] - public T M24 - { - readonly get => Row2.W; - set => Row2.W = value; - } - - /// Value at row 3, column 1 of the matrix. - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// Value at row 3, column 2 of the matrix. - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// Value at row 3, column 3 of the matrix. - [DataMember] - public T M33 - { - readonly get => Row3.Z; - set => Row3.Z = value; - } - - /// Value at row 3, column 4 of the matrix. - [DataMember] - public T M34 - { - readonly get => Row3.W; - set => Row3.W = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector4D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 2 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// - /// Constructs a from the given rows. - /// - /// - /// - /// - public Matrix3X4(Vector4D row1, Vector4D row2, Vector4D row3) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - } - - /// Constructs a from the given components. - public Matrix3X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34) - { - Row1 = new(m11, m12, m13, m14); - Row2 = new(m21, m22, m23, m24); - Row3 = new(m31, m32, m33, m34); - } - /// Constructs a from the given . /// The source . public Matrix3X4(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); - Row3 = new(value.M31, value.M32, Scalar.One, default); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); + Row3 = new(value.M31, value.M32, T.One, T.Zero); } /// Constructs a from the given . /// The source . public Matrix3X4(Matrix4X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); - Row3 = new(value.M31, value.M32, value.M33, default); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); + Row3 = new(value.M31, value.M32, value.M33, T.Zero); } /// Constructs a from the given . @@ -246,9 +45,9 @@ public Matrix3X4(Matrix3X4 value) /// The source . public Matrix3X4(Matrix3X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); - Row3 = new(value.M31, value.M32, value.M33, default); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); + Row3 = new(value.M31, value.M32, value.M33, T.Zero); } /// Constructs a from the given . @@ -264,9 +63,9 @@ public Matrix3X4(Matrix2X4 value) /// The source . public Matrix3X4(Matrix4X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); - Row3 = new(value.M31, value.M32, Scalar.One, default); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); + Row3 = new(value.M31, value.M32, T.One, T.Zero); } /// Returns the multiplicative identity matrix. @@ -274,362 +73,6 @@ public Matrix3X4(Matrix4X2 value) /// Returns whether the matrix is the identity matrix. [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && Scalar.Equal(M22, Scalar.One) && - Scalar.Equal(M33, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M14, Scalar.Zero) && Scalar.Equal(M21, Scalar.Zero) && - Scalar.Equal(M23, Scalar.Zero) && Scalar.Equal(M24, Scalar.Zero) && - Scalar.Equal(M31, Scalar.Zero) && Scalar.Equal(M32, Scalar.Zero) && - Scalar.Equal(M34, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix3X4 operator +(Matrix3X4 value1, Matrix3X4 value2) - { - return new(value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix3X4 value1, Matrix3X4 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - Scalar.Equal(value1.M33, value2.M33) && // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M14, value2.M14) && Scalar.Equal(value1.M21, value2.M21) && - Scalar.Equal(value1.M23, value2.M23) && Scalar.Equal(value1.M24, value2.M24) && - Scalar.Equal(value1.M31, value2.M31) && Scalar.Equal(value1.M32, value2.M32) && - Scalar.Equal(value1.M34, value2.M34); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix3X4 value1, Matrix3X4 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || Scalar.NotEqual(value1.M22, value2.M22) || - Scalar.NotEqual(value1.M33, value2.M33) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M14, value2.M14) || Scalar.NotEqual(value1.M21, value2.M21) || - Scalar.NotEqual(value1.M23, value2.M23) || Scalar.NotEqual(value1.M24, value2.M24) || - Scalar.NotEqual(value1.M31, value2.M31) || Scalar.NotEqual(value1.M32, value2.M32) || - Scalar.NotEqual(value1.M34, value2.M34); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X3 operator *(Matrix3X4 value1, Matrix4X3 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 + value1.M34 * value2.Row4 - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector4D operator *(Vector3D value1, Matrix3X4 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X4 operator *(Matrix3X3 value1, Matrix3X4 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 - ); - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix3X4 operator *(Matrix3X4 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2, value1.Row3 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix3X4 operator -(Matrix3X4 value1, Matrix3X4 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2, value1.Row3 - value2.Row3); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix3X4 operator -(Matrix3X4 value) - { - return new(-value.Row1, -value.Row2, -value.Row3); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix3X4 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix3X4 other) - => this == other; - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - hash.Add(M14); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - hash.Add(M24); - - hash.Add(M31); - hash.Add(M32); - hash.Add(M33); - hash.Add(M34); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} }}", - M11, M12, M13, M14, - M21, M22, M23, M24, - M31, M32, M33, M34); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix3X4(Matrix3X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix3X4 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As()); - } + public readonly bool IsIdentity => this == Identity; } } diff --git a/sources/Maths/Maths/Matrix3X4.gen.cs b/sources/Maths/Maths/Matrix3X4.gen.cs new file mode 100644 index 0000000000..68495939a2 --- /dev/null +++ b/sources/Maths/Maths/Matrix3X4.gen.cs @@ -0,0 +1,560 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 3x4 matrix. + [Serializable] + [DataContract] + public partial struct Matrix3X4 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row3; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column1 => new(Row1.X, Row2.X, Row3.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column2 => new(Row1.Y, Row2.Y, Row3.Y); + + /// The 3rd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column3 => new(Row1.Z, Row2.Z, Row3.Z); + + /// The 4th column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Column4 => new(Row1.W, Row2.W, Row3.W); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 1st row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M14 => ref Row1.W; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// Gets the element in the 2nd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M24 => ref Row2.W; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// Gets the element in the 3rd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M33 => ref Row3.Z; + + /// Gets the element in the 3rd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M34 => ref Row3.W; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector4D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix3X4(Vector4D row1, Vector4D row2, Vector4D row3) => + (Row1, Row2, Row3) = (row1, row2, row3); + + /// Constructs a from the given components. + public Matrix3X4( + T m11, T m12, T m13, T m14, + T m21, T m22, T m23, T m24, + T m31, T m32, T m33, T m34) + { + Row1 = new(m11, m12, m13, m14); + Row2 = new(m21, m22, m23, m24); + Row3 = new(m31, m32, m33, m34); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} }}", + Row1.X, Row1.Y, Row1.Z, Row1.W, + Row2.X, Row2.Y, Row2.Z, Row2.W, + Row3.X, Row3.Y, Row3.Z, Row3.W); + + /// + public override bool Equals(object? obj) => obj is Matrix3X4 other && Equals(other); + + /// + public bool Equals(Matrix3X4 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3); + + /// Converts the components of this matrix to another type. + public static Matrix3X4 CreateChecked(Matrix3X4 other) + where TOther : INumberBase => + new(Vector4D.CreateChecked(other.Row1), Vector4D.CreateChecked(other.Row2), Vector4D.CreateChecked(other.Row3)); + + /// Converts the components of this matrix to another type. + public static Matrix3X4 CreateSaturating(Matrix3X4 other) + where TOther : INumberBase => + new(Vector4D.CreateSaturating(other.Row1), Vector4D.CreateSaturating(other.Row2), Vector4D.CreateSaturating(other.Row3)); + + /// Converts the components of this matrix to another type. + public static Matrix3X4 CreateTruncating(Matrix3X4 other) + where TOther : INumberBase => + new(Vector4D.CreateTruncating(other.Row1), Vector4D.CreateTruncating(other.Row2), Vector4D.CreateTruncating(other.Row3)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix3X4 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As()); + + /// Converts the components of this matrix to another type. + public Matrix3X4 AsChecked() + where TOther : INumberBase => + Matrix3X4.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix3X4 AsSaturating() + where TOther : INumberBase => + Matrix3X4.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix3X4 AsTruncating() + where TOther : INumberBase => + Matrix3X4.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix4X3 Transpose() => + new(Column1, + Column2, + Column3, + Column4); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix3X4 left, Matrix3X4 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix3X4 left, Matrix3X4 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix3X4 operator +(Matrix3X4 left, Matrix3X4 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix3X4 operator -(Matrix3X4 left, Matrix3X4 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix3X4 operator -(Matrix3X4 value) => + new(-value.Row1, + -value.Row2, + -value.Row3); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix3X4 operator *(T left, Matrix3X4 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix3X4 operator *(Matrix3X4 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector4D operator *(Vector3D rowVector, Matrix3X4 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2 + rowVector.Z * matrix.Row3; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector3D operator *(Matrix3X4 matrix, Vector4D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y + matrix.Column3 * columnVector.Z + matrix.Column4 * columnVector.W; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 operator *(Matrix2X3 left, Matrix3X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 operator *(Matrix3X3 left, Matrix3X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 operator *(Matrix3X4 left, Matrix4X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 operator *(Matrix3X4 left, Matrix4X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix3X4(Matrix3X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3)); + } +} diff --git a/sources/Maths/Maths/Matrix4X2.Ops.cs b/sources/Maths/Maths/Matrix4X2.Ops.cs index 3fa4c29020..d6a6d59f00 100644 --- a/sources/Maths/Maths/Matrix4X2.Ops.cs +++ b/sources/Maths/Maths/Matrix4X2.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -9,102 +10,11 @@ namespace Silk.NET.Maths /// /// Methods for working with /// - public static class Matrix4X2 + public static partial class Matrix4X2 { - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X2 Add(Matrix4X2 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X2 Multiply(Matrix4X2 value1, Matrix2X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Multiply(Matrix4X2 value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Multiply(Matrix4X2 value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X2 Multiply(Matrix2X4 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X2 Multiply(Matrix3X4 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector4D value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X2 Multiply(Matrix4X4 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X2 Negate(Matrix4X2 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X2 Subtract(Matrix4X2 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - /*[MethodImpl((MethodImplOptions)768)] private static Vector128 Permute(Vector128 value, byte control) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { if (Avx.IsSupported) { @@ -120,23 +30,5 @@ private static Vector128 Permute(Vector128 value, byte control) throw new PlatformNotSupportedException(); } }*/ - - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix4X2 Lerp(Matrix4X2 matrix1, Matrix4X2 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new - ( - Vector2D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector2D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector2D.Lerp(matrix1.Row3, matrix2.Row3, amount), - Vector2D.Lerp(matrix1.Row4, matrix2.Row4, amount) - ); - } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Matrix4X2.Ops.gen.cs b/sources/Maths/Maths/Matrix4X2.Ops.gen.cs new file mode 100644 index 0000000000..5e19cc085d --- /dev/null +++ b/sources/Maths/Maths/Matrix4X2.Ops.gen.cs @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix4X2 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix4X2 Lerp(Matrix4X2 value1, Matrix4X2 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector2D.Lerp(value1.Row1, value2.Row1, amount), + Vector2D.Lerp(value1.Row2, value2.Row2, amount), + Vector2D.Lerp(value1.Row3, value2.Row3, amount), + Vector2D.Lerp(value1.Row4, value2.Row4, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix4X2 Add(Matrix4X2 left, Matrix4X2 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix4X2 Negate(Matrix4X2 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4X2 Subtract(Matrix4X2 left, Matrix4X2 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4X2 Multiply(Matrix4X2 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix4X2 Multiply(T left, Matrix4X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector2D Multiply(Vector4D rowVector, Matrix4X2 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector4D Multiply(Matrix4X2 matrix, Vector2D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X2 Multiply(Matrix2X4 left, Matrix4X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X2 Multiply(Matrix3X4 left, Matrix4X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 Multiply(Matrix4X2 left, Matrix2X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 Multiply(Matrix4X2 left, Matrix2X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 Multiply(Matrix4X2 left, Matrix2X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 Multiply(Matrix4X4 left, Matrix4X2 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix4X2.cs b/sources/Maths/Maths/Matrix4X2.cs index ca60eb79d5..8208c94bbe 100644 --- a/sources/Maths/Maths/Matrix4X2.cs +++ b/sources/Maths/Maths/Matrix4X2.cs @@ -1,185 +1,20 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Diagnostics; -using System.Globalization; -using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 4x2 matrix. - [Serializable] - [DataContract] - public struct Matrix4X2 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix4X2 { private static readonly Matrix4X2 _identity = new ( - Scalar.One, Scalar.Zero, - Scalar.Zero, Scalar.One, - Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.Zero + T.One, T.Zero, + T.Zero, T.One, + T.Zero, T.Zero, + T.Zero, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector2D Row1; - - /// - /// Row 2 of the matrix - /// - [IgnoreDataMember] - public Vector2D Row2; - - /// - /// Row 3 of the matrix - /// - [IgnoreDataMember] - public Vector2D Row3; - - /// - /// Row 4 of the matrix - /// - [IgnoreDataMember] - public Vector2D Row4; - - - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column1 => new(Row1.X, Row2.X, Row3.X, Row4.X); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column2 => new(Row1.Y, Row2.Y, Row3.X, Row4.X); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 3, column 1 of the matrix. - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// Value at row 3, column 2 of the matrix. - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// Value at row 4, column 1 of the matrix. - [DataMember] - public T M41 - { - readonly get => Row4.X; - set => Row4.X = value; - } - - /// Value at row 4, column 2 of the matrix. - [DataMember] - public T M42 - { - readonly get => Row4.Y; - set => Row4.Y = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector2D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 3 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// - /// Constructs a from the given rows. - /// - public Matrix4X2(Vector2D row1, Vector2D row2, Vector2D row3, Vector2D row4) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - Row4 = row4; - } - - /// Constructs a from the given components. - public Matrix4X2(T m11, T m12, T m21, T m22, T m31, T m32, T m41, T m42) - { - Row1 = new(m11, m12); - Row2 = new(m21, m22); - Row3 = new(m31, m32); - Row4 = new(m41, m42); - } - /// Constructs a from the given . /// The source . public Matrix4X2(Matrix3X2 value) @@ -235,389 +70,6 @@ public Matrix4X2(Matrix2X4 value) /// Returns whether the matrix is the identity matrix. [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && - Scalar.Equal(M22, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M21, Scalar.Zero) && - Scalar.Equal(M31, Scalar.Zero) && Scalar.Equal(M32, Scalar.Zero) && - Scalar.Equal(M41, Scalar.Zero) && Scalar.Equal(M42, Scalar.Zero); - - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix4X2 operator +(Matrix4X2 value1, Matrix4X2 value2) - { - return new - ( - value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3, - value1.Row4 + value2.Row4 - ); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix4X2 value1, Matrix4X2 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M21, value2.M21) && - Scalar.Equal(value1.M31, value2.M31) && Scalar.Equal(value1.M32, value2.M32) && - Scalar.Equal(value1.M41, value2.M41) && Scalar.Equal(value1.M42, value2.M42); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix4X2 value1, Matrix4X2 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || Scalar.NotEqual(value1.M22, value2.M22) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M21, value2.M21) || - Scalar.NotEqual(value1.M31, value2.M31) || Scalar.NotEqual(value1.M32, value2.M32) || - Scalar.NotEqual(value1.M41, value2.M41) || Scalar.NotEqual(value1.M42, value2.M42); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X2 operator *(Matrix4X2 value1, Matrix2X2 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X3 operator *(Matrix4X2 value1, Matrix2X3 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X4 operator *(Matrix4X2 value1, Matrix2X4 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix2X2 operator *(Matrix2X4 value1, Matrix4X2 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X2 operator *(Matrix3X4 value1, Matrix4X2 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X2 operator *(Matrix4X4 value1, Matrix4X2 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 + value1.M34 * value2.Row4, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 + value1.M43 * value2.Row3 + value1.M44 * value2.Row4 - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector2D operator *(Vector4D value1, Matrix4X2 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3 + value1.W * value2.Row4; - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix4X2 operator *(Matrix4X2 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2, value1.Row3 * value2, value1.Row4 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix4X2 operator -(Matrix4X2 value1, Matrix4X2 value2) - { - return new(value1.Row1 - value2.Row1, value1.Row2 - value2.Row2, value1.Row3 - value2.Row3, value1.Row4 - value2.Row4); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix4X2 operator -(Matrix4X2 value) - { - return new(-value.Row1, -value.Row2, -value.Row3, -value.Row4); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix4X2 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix4X2 other) - => this == other; - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - - hash.Add(M21); - hash.Add(M22); - - hash.Add(M31); - hash.Add(M32); - - hash.Add(M41); - hash.Add(M42); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} {{M31:{4} M32:{5}}} {{M41:{6} M42:{7}}} }}", - M11, M12, - M21, M22, - M31, M32, - M41, M42); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X2(Matrix4X2 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M41), Scalar.As(from.M42) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix4X2 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As(), Row4.As()); - } + public readonly bool IsIdentity => this == Identity; } } diff --git a/sources/Maths/Maths/Matrix4X2.gen.cs b/sources/Maths/Maths/Matrix4X2.gen.cs new file mode 100644 index 0000000000..45879c2005 --- /dev/null +++ b/sources/Maths/Maths/Matrix4X2.gen.cs @@ -0,0 +1,564 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 4x2 matrix. + [Serializable] + [DataContract] + public partial struct Matrix4X2 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row3; + + /// The 4th row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector2D Row4; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column1 => new(Row1.X, Row2.X, Row3.X, Row4.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column2 => new(Row1.Y, Row2.Y, Row3.Y, Row4.Y); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// Gets the element in the 4th row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M41 => ref Row4.X; + + /// Gets the element in the 4th row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M42 => ref Row4.Y; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector2D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + case 3: + return ref Row4; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix4X2(Vector2D row1, Vector2D row2, Vector2D row3, Vector2D row4) => + (Row1, Row2, Row3, Row4) = (row1, row2, row3, row4); + + /// Constructs a from the given components. + public Matrix4X2( + T m11, T m12, + T m21, T m22, + T m31, T m32, + T m41, T m42) + { + Row1 = new(m11, m12); + Row2 = new(m21, m22); + Row3 = new(m31, m32); + Row4 = new(m41, m42); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1}}} {{M21:{2} M22:{3}}} {{M31:{4} M32:{5}}} {{M41:{6} M42:{7}}} }}", + Row1.X, Row1.Y, + Row2.X, Row2.Y, + Row3.X, Row3.Y, + Row4.X, Row4.Y); + + /// + public override bool Equals(object? obj) => obj is Matrix4X2 other && Equals(other); + + /// + public bool Equals(Matrix4X2 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3, Row4); + + /// Converts the components of this matrix to another type. + public static Matrix4X2 CreateChecked(Matrix4X2 other) + where TOther : INumberBase => + new(Vector2D.CreateChecked(other.Row1), Vector2D.CreateChecked(other.Row2), Vector2D.CreateChecked(other.Row3), Vector2D.CreateChecked(other.Row4)); + + /// Converts the components of this matrix to another type. + public static Matrix4X2 CreateSaturating(Matrix4X2 other) + where TOther : INumberBase => + new(Vector2D.CreateSaturating(other.Row1), Vector2D.CreateSaturating(other.Row2), Vector2D.CreateSaturating(other.Row3), Vector2D.CreateSaturating(other.Row4)); + + /// Converts the components of this matrix to another type. + public static Matrix4X2 CreateTruncating(Matrix4X2 other) + where TOther : INumberBase => + new(Vector2D.CreateTruncating(other.Row1), Vector2D.CreateTruncating(other.Row2), Vector2D.CreateTruncating(other.Row3), Vector2D.CreateTruncating(other.Row4)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix4X2 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As(), Row4.As()); + + /// Converts the components of this matrix to another type. + public Matrix4X2 AsChecked() + where TOther : INumberBase => + Matrix4X2.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix4X2 AsSaturating() + where TOther : INumberBase => + Matrix4X2.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix4X2 AsTruncating() + where TOther : INumberBase => + Matrix4X2.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix2X4 Transpose() => + new(Column1, + Column2); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix4X2 left, Matrix4X2 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3 && + left.Row4 == right.Row4; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix4X2 left, Matrix4X2 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix4X2 operator +(Matrix4X2 left, Matrix4X2 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3, + left.Row4 + right.Row4); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4X2 operator -(Matrix4X2 left, Matrix4X2 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3, + left.Row4 - right.Row4); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix4X2 operator -(Matrix4X2 value) => + new(-value.Row1, + -value.Row2, + -value.Row3, + -value.Row4); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix4X2 operator *(T left, Matrix4X2 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3, + left * right.Row4); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4X2 operator *(Matrix4X2 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right, + left.Row4 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector2D operator *(Vector4D rowVector, Matrix4X2 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2 + rowVector.Z * matrix.Row3 + rowVector.W * matrix.Row4; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector4D operator *(Matrix4X2 matrix, Vector2D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 operator *(Matrix4X2 left, Matrix2X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2, + left.M31 * right.Row1 + left.M32 * right.Row2, + left.M41 * right.Row1 + left.M42 * right.Row2); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 operator *(Matrix4X2 left, Matrix2X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2, + left.M31 * right.Row1 + left.M32 * right.Row2, + left.M41 * right.Row1 + left.M42 * right.Row2); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 operator *(Matrix4X2 left, Matrix2X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2, + left.M21 * right.Row1 + left.M22 * right.Row2, + left.M31 * right.Row1 + left.M32 * right.Row2, + left.M41 * right.Row1 + left.M42 * right.Row2); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateTruncating(from.Row1), + Vector2D.CreateTruncating(from.Row2), + Vector2D.CreateTruncating(from.Row3), + Vector2D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X2(Matrix4X2 from) => + new(Vector2D.CreateChecked(from.Row1), + Vector2D.CreateChecked(from.Row2), + Vector2D.CreateChecked(from.Row3), + Vector2D.CreateChecked(from.Row4)); + } +} diff --git a/sources/Maths/Maths/Matrix4X3.Ops.cs b/sources/Maths/Maths/Matrix4X3.Ops.cs deleted file mode 100644 index 09407f0f98..0000000000 --- a/sources/Maths/Maths/Matrix4X3.Ops.cs +++ /dev/null @@ -1,112 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - /// - /// Methods for working with - /// - public static class Matrix4X3 - { - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Add(Matrix4X3 value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Multiply(Matrix4X3 value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Multiply(Matrix4X3 value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Multiply(Matrix4X4 value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix3X3 Multiply(Matrix3X4 value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Multiply(Matrix4X3 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector4D value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Negate(Matrix4X3 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X3 Subtract(Matrix4X3 value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix4X3 Lerp(Matrix4X3 matrix1, Matrix4X3 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Vector3D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector3D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector3D.Lerp(matrix1.Row3, matrix2.Row3, amount), - Vector3D.Lerp(matrix1.Row4, matrix2.Row4, amount) - ); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Matrix4X3.Ops.gen.cs b/sources/Maths/Maths/Matrix4X3.Ops.gen.cs new file mode 100644 index 0000000000..963cbf4370 --- /dev/null +++ b/sources/Maths/Maths/Matrix4X3.Ops.gen.cs @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix4X3 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix4X3 Lerp(Matrix4X3 value1, Matrix4X3 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector3D.Lerp(value1.Row1, value2.Row1, amount), + Vector3D.Lerp(value1.Row2, value2.Row2, amount), + Vector3D.Lerp(value1.Row3, value2.Row3, amount), + Vector3D.Lerp(value1.Row4, value2.Row4, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix4X3 Add(Matrix4X3 left, Matrix4X3 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix4X3 Negate(Matrix4X3 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4X3 Subtract(Matrix4X3 left, Matrix4X3 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4X3 Multiply(Matrix4X3 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix4X3 Multiply(T left, Matrix4X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector3D Multiply(Vector4D rowVector, Matrix4X3 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector4D Multiply(Matrix4X3 matrix, Vector3D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 Multiply(Matrix2X4 left, Matrix4X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X3 Multiply(Matrix3X4 left, Matrix4X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 Multiply(Matrix4X3 left, Matrix3X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 Multiply(Matrix4X3 left, Matrix3X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 Multiply(Matrix4X3 left, Matrix3X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 Multiply(Matrix4X4 left, Matrix4X3 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix4X3.cs b/sources/Maths/Maths/Matrix4X3.cs index 57088ec556..b86f4bbd79 100644 --- a/sources/Maths/Maths/Matrix4X3.cs +++ b/sources/Maths/Maths/Matrix4X3.cs @@ -1,228 +1,31 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; +using System.Numerics; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 4x3 matrix. - [Serializable] - [DataContract] - public struct Matrix4X3 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix4X3 + : IEquatable> + where T : INumberBase { private static readonly Matrix4X3 _identity = new ( - Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.One, - Scalar.Zero, Scalar.Zero, Scalar.Zero + T.One, T.Zero, T.Zero, + T.Zero, T.One, T.Zero, + T.Zero, T.Zero, T.One, + T.Zero, T.Zero, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row1; - - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row2; - - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row3; - - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector3D Row4; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column1 => new(Row1.X, Row2.X, Row3.X, Row4.X); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column2 => new(Row1.Y, Row2.Y, Row3.Y, Row4.Y); - - /// - /// Column 3 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column3 => new(Row1.Z, Row2.Z, Row3.Z, Row4.Z); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// Value at row 3, column 1 of the matrix. - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// Value at row 3, column 2 of the matrix. - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// Value at row 3, column 3 of the matrix. - [DataMember] - public T M33 - { - readonly get => Row3.Z; - set => Row3.Z = value; - } - - /// Value at row 4, column 1 of the matrix. - [DataMember] - public T M41 - { - readonly get => Row4.X; - set => Row4.X = value; - } - - /// Value at row 4, column 2 of the matrix. - [DataMember] - public T M42 - { - readonly get => Row4.Y; - set => Row4.Y = value; - } - - /// Value at row 4, column 3 of the matrix. - [DataMember] - public T M43 - { - readonly get => Row4.Z; - set => Row4.Z = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector3D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 3 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int i] - { - get - { - var row = this[x]; - return row[i]; - } - } - - /// - /// Constructs a from the given rows. - /// - public Matrix4X3(Vector3D row1, Vector3D row2, Vector3D row3, Vector3D row4) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - Row4 = row4; - } - - /// Constructs a from the given components. - public Matrix4X3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33, T m41, T m42, T m43) - { - Row1 = new(m11, m12, m13); - Row2 = new(m21, m22, m23); - Row3 = new(m31, m32, m33); - Row4 = new(m41, m42, m43); - } - /// Constructs a from the given . /// The source . public Matrix4X3(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default); - Row2 = new(value.M21, value.M22, default); + Row1 = new(value.M11, value.M12, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero); Row3 = Vector3D.UnitZ; - Row4 = new(value.M31, value.M32, default); + Row4 = new(value.M31, value.M32, T.Zero); } /// Constructs a from the given . @@ -269,10 +72,10 @@ public Matrix4X3(Matrix2X4 value) /// The source . public Matrix4X3(Matrix4X2 value) { - Row1 = new(value.M11, value.M12, default); - Row2 = new(value.M21, value.M22, default); - Row3 = new(value.M31, value.M32, default); - Row4 = new(value.M41, value.M42, Scalar.One); + Row1 = new(value.M11, value.M12, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero); + Row3 = new(value.M31, value.M32, T.Zero); + Row4 = new(value.M41, value.M42, T.One); } /// Constructs a from the given . @@ -290,395 +93,6 @@ public Matrix4X3(Matrix4X4 value) /// Returns whether the matrix is the identity matrix. [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && Scalar.Equal(M22, Scalar.One) && - Scalar.Equal(M33, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M21, Scalar.Zero) && Scalar.Equal(M23, Scalar.Zero) && - Scalar.Equal(M31, Scalar.Zero) && Scalar.Equal(M32, Scalar.Zero) && - Scalar.Equal(M41, Scalar.Zero) && Scalar.Equal(M42, Scalar.Zero) && - Scalar.Equal(M43, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix4X3 operator +(Matrix4X3 value1, Matrix4X3 value2) - { - return new(value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3, value1.Row4 + value2.Row4); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix4X3 value1, Matrix4X3 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - Scalar.Equal(value1.M33, value2.M33) && // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M21, value2.M21) && Scalar.Equal(value1.M23, value2.M23) && - Scalar.Equal(value1.M31, value2.M31) && Scalar.Equal(value1.M32, value2.M32) && - Scalar.Equal(value1.M41, value2.M41) && Scalar.Equal(value1.M42, value2.M42) && - Scalar.Equal(value1.M43, value2.M43); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix4X3 value1, Matrix4X3 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || Scalar.NotEqual(value1.M22, value2.M22) || - Scalar.NotEqual(value1.M33, value2.M33) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M21, value2.M21) || Scalar.NotEqual(value1.M23, value2.M23) || - Scalar.NotEqual(value1.M31, value2.M31) || Scalar.NotEqual(value1.M32, value2.M32) || - Scalar.NotEqual(value1.M41, value2.M41) || Scalar.NotEqual(value1.M42, value2.M42) || - Scalar.NotEqual(value1.M43, value2.M43); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X4 operator *(Matrix4X3 value1, Matrix3X4 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 + value1.M43 * value2.Row3 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X3 operator *(Matrix4X3 value1, Matrix3X3 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 + value1.M43 * value2.Row3 - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector3D operator *(Vector4D value1, Matrix4X3 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3 + value1.W * value2.Row4; - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix4X3 operator *(Matrix4X3 value1, T value2) - { - return new(value1.Row1 * value2, value1.Row2 * value2, value1.Row3 * value2, value1.Row4 * value2); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix4X3 operator -(Matrix4X3 value1, Matrix4X3 value2) - { - return new( - value1.Row1 - value2.Row1, - value1.Row2 - value2.Row2, - value1.Row3 - value2.Row3, - value1.Row4 - value2.Row4 - ); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix4X3 operator -(Matrix4X3 value) - { - return new(-value.Row1, -value.Row2, -value.Row3, -value.Row4); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix4X3 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix4X3 other) - => this == other; - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - - hash.Add(M31); - hash.Add(M32); - hash.Add(M33); - - hash.Add(M41); - hash.Add(M42); - hash.Add(M43); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2}}} {{M21:{3} M22:{4} M23:{5}}} {{M31:{6} M32:{7} M33:{8}}} {{M41:{9} M42:{10} M43:{11}}} }}", - M11, M12, M13, - M21, M22, M23, - M31, M32, M33, - M41, M42, M43); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X3(Matrix4X3 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix4X3 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As(), Row4.As()); - } + public readonly bool IsIdentity => this == Identity; } } diff --git a/sources/Maths/Maths/Matrix4X3.gen.cs b/sources/Maths/Maths/Matrix4X3.gen.cs new file mode 100644 index 0000000000..862eb3256c --- /dev/null +++ b/sources/Maths/Maths/Matrix4X3.gen.cs @@ -0,0 +1,597 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 4x3 matrix. + [Serializable] + [DataContract] + public partial struct Matrix4X3 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row3; + + /// The 4th row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector3D Row4; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column1 => new(Row1.X, Row2.X, Row3.X, Row4.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column2 => new(Row1.Y, Row2.Y, Row3.Y, Row4.Y); + + /// The 3rd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column3 => new(Row1.Z, Row2.Z, Row3.Z, Row4.Z); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// Gets the element in the 3rd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M33 => ref Row3.Z; + + /// Gets the element in the 4th row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M41 => ref Row4.X; + + /// Gets the element in the 4th row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M42 => ref Row4.Y; + + /// Gets the element in the 4th row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M43 => ref Row4.Z; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector3D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + case 3: + return ref Row4; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix4X3(Vector3D row1, Vector3D row2, Vector3D row3, Vector3D row4) => + (Row1, Row2, Row3, Row4) = (row1, row2, row3, row4); + + /// Constructs a from the given components. + public Matrix4X3( + T m11, T m12, T m13, + T m21, T m22, T m23, + T m31, T m32, T m33, + T m41, T m42, T m43) + { + Row1 = new(m11, m12, m13); + Row2 = new(m21, m22, m23); + Row3 = new(m31, m32, m33); + Row4 = new(m41, m42, m43); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2}}} {{M21:{3} M22:{4} M23:{5}}} {{M31:{6} M32:{7} M33:{8}}} {{M41:{9} M42:{10} M43:{11}}} }}", + Row1.X, Row1.Y, Row1.Z, + Row2.X, Row2.Y, Row2.Z, + Row3.X, Row3.Y, Row3.Z, + Row4.X, Row4.Y, Row4.Z); + + /// + public override bool Equals(object? obj) => obj is Matrix4X3 other && Equals(other); + + /// + public bool Equals(Matrix4X3 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3, Row4); + + /// Converts the components of this matrix to another type. + public static Matrix4X3 CreateChecked(Matrix4X3 other) + where TOther : INumberBase => + new(Vector3D.CreateChecked(other.Row1), Vector3D.CreateChecked(other.Row2), Vector3D.CreateChecked(other.Row3), Vector3D.CreateChecked(other.Row4)); + + /// Converts the components of this matrix to another type. + public static Matrix4X3 CreateSaturating(Matrix4X3 other) + where TOther : INumberBase => + new(Vector3D.CreateSaturating(other.Row1), Vector3D.CreateSaturating(other.Row2), Vector3D.CreateSaturating(other.Row3), Vector3D.CreateSaturating(other.Row4)); + + /// Converts the components of this matrix to another type. + public static Matrix4X3 CreateTruncating(Matrix4X3 other) + where TOther : INumberBase => + new(Vector3D.CreateTruncating(other.Row1), Vector3D.CreateTruncating(other.Row2), Vector3D.CreateTruncating(other.Row3), Vector3D.CreateTruncating(other.Row4)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix4X3 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As(), Row4.As()); + + /// Converts the components of this matrix to another type. + public Matrix4X3 AsChecked() + where TOther : INumberBase => + Matrix4X3.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix4X3 AsSaturating() + where TOther : INumberBase => + Matrix4X3.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix4X3 AsTruncating() + where TOther : INumberBase => + Matrix4X3.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix3X4 Transpose() => + new(Column1, + Column2, + Column3); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix4X3 left, Matrix4X3 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3 && + left.Row4 == right.Row4; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix4X3 left, Matrix4X3 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix4X3 operator +(Matrix4X3 left, Matrix4X3 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3, + left.Row4 + right.Row4); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4X3 operator -(Matrix4X3 left, Matrix4X3 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3, + left.Row4 - right.Row4); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix4X3 operator -(Matrix4X3 value) => + new(-value.Row1, + -value.Row2, + -value.Row3, + -value.Row4); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix4X3 operator *(T left, Matrix4X3 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3, + left * right.Row4); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4X3 operator *(Matrix4X3 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right, + left.Row4 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector3D operator *(Vector4D rowVector, Matrix4X3 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2 + rowVector.Z * matrix.Row3 + rowVector.W * matrix.Row4; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector4D operator *(Matrix4X3 matrix, Vector3D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y + matrix.Column3 * columnVector.Z; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X3 operator *(Matrix2X4 left, Matrix4X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 operator *(Matrix4X3 left, Matrix3X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 operator *(Matrix4X3 left, Matrix3X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 operator *(Matrix4X3 left, Matrix3X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateTruncating(from.Row1), + Vector3D.CreateTruncating(from.Row2), + Vector3D.CreateTruncating(from.Row3), + Vector3D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X3(Matrix4X3 from) => + new(Vector3D.CreateChecked(from.Row1), + Vector3D.CreateChecked(from.Row2), + Vector3D.CreateChecked(from.Row3), + Vector3D.CreateChecked(from.Row4)); + } +} diff --git a/sources/Maths/Maths/Matrix4X4.Ops.cs b/sources/Maths/Maths/Matrix4X4.Ops.cs index d27a6128ae..3f4a4b28cc 100644 --- a/sources/Maths/Maths/Matrix4X4.Ops.cs +++ b/sources/Maths/Maths/Matrix4X4.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -9,7 +10,7 @@ namespace Silk.NET.Maths /// /// Methods for working with /// - public static class Matrix4X4 + public static partial class Matrix4X4 { private const float BillboardEpsilon = 1e-4f; #if MATHF @@ -19,8 +20,9 @@ public static class Matrix4X4 #endif private const float DecomposeEpsilon = 0.0001f; + /* private struct CanonicalBasis - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { public Vector3D Row0; public Vector3D Row1; @@ -28,7 +30,7 @@ private struct CanonicalBasis }; private struct VectorBasis - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { #pragma warning disable 649 public unsafe Vector3D* Element0; @@ -36,17 +38,7 @@ private struct VectorBasis public unsafe Vector3D* Element2; #pragma warning restore 649 } - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Add(Matrix4X4 value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } + */ /// Creates a spherical billboard that rotates around a specified object position. /// Position of the object the billboard will rotate around. @@ -55,28 +47,28 @@ public static Matrix4X4 Add(Matrix4X4 value1, Matrix4X4 value2) /// The forward vector of the camera. /// The created billboard matrix public static Matrix4X4 CreateBillboard(Vector3D objectPosition, Vector3D cameraPosition, Vector3D cameraUpVector, Vector3D cameraForwardVector) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { Vector3D zaxis = objectPosition - cameraPosition; var norm = zaxis.LengthSquared; - if (!Scalar.GreaterThanOrEqual(norm, Scalar.As(BillboardEpsilon))) + if (!(norm >= T.CreateTruncating(BillboardEpsilon))) { zaxis = -cameraForwardVector; } else { - zaxis = Vector3D.Multiply(zaxis, Scalar.Reciprocal(Scalar.Sqrt(norm))); + zaxis = Vector3D.Multiply(zaxis, T.One / T.Sqrt(norm)); } Vector3D xaxis = Vector3D.Normalize(Vector3D.Cross(cameraUpVector, zaxis)); Vector3D yaxis = Vector3D.Cross(zaxis, xaxis); return new( - new(xaxis, default), - new(yaxis, default), - new(zaxis, default), - new(objectPosition, Scalar.One)); + new(xaxis, T.Zero), + new(yaxis, T.Zero), + new(zaxis, T.Zero), + new(objectPosition, T.One)); } /// Creates a cylindrical billboard that rotates around a specified axis. @@ -87,19 +79,19 @@ public static Matrix4X4 CreateBillboard(Vector3D objectPosition, Vector /// Forward vector of the object. /// The created billboard matrix. public static Matrix4X4 CreateConstrainedBillboard(Vector3D objectPosition, Vector3D cameraPosition, Vector3D rotateAxis, Vector3D cameraForwardVector, Vector3D objectForwardVector) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { // Treat the case when object and camera positions are too close. Vector3D faceDir = objectPosition - cameraPosition; T norm = faceDir.LengthSquared; - if (!Scalar.GreaterThanOrEqual(norm, Scalar.As(BillboardEpsilon))) + if (!(norm >= T.CreateTruncating(BillboardEpsilon))) { faceDir = -cameraForwardVector; } else { - faceDir = Vector3D.Multiply(faceDir, Scalar.Reciprocal(Scalar.Sqrt(norm))); + faceDir = Vector3D.Multiply(faceDir, T.One / T.Sqrt(norm)); } Vector3D yaxis = rotateAxis; @@ -109,19 +101,19 @@ public static Matrix4X4 CreateConstrainedBillboard(Vector3D objectPosit // Treat the case when angle between faceDir and rotateAxis is too close to 0. T dot = Vector3D.Dot(rotateAxis, faceDir); - if (Scalar.GreaterThan(Scalar.Abs(dot), Scalar.As(BillboardMinAngle))) + if (T.Abs(dot) > T.CreateTruncating(BillboardMinAngle)) { zaxis = objectForwardVector; // Make sure passed values are useful for compute. dot = Vector3D.Dot(rotateAxis, zaxis); - if (Scalar.GreaterThan(Scalar.Abs(dot), Scalar.As(BillboardMinAngle))) + if (T.Abs(dot) > T.CreateTruncating(BillboardMinAngle)) { zaxis = - Scalar.GreaterThan(Scalar.Abs(rotateAxis.Z), Scalar.As(BillboardMinAngle)) - ? new Vector3D(Scalar.One, Scalar.Zero, Scalar.Zero) - : new Vector3D(Scalar.Zero, Scalar.Zero, Scalar.MinusOne); + T.Abs(rotateAxis.Z) > T.CreateTruncating(BillboardMinAngle) + ? new Vector3D(T.One, T.Zero, T.Zero) + : new Vector3D(T.Zero, T.Zero, -T.One); } xaxis = Vector3D.Normalize(Vector3D.Cross(rotateAxis, zaxis)); @@ -134,10 +126,10 @@ public static Matrix4X4 CreateConstrainedBillboard(Vector3D objectPosit } return new( - new(xaxis, default), - new(yaxis, default), - new(zaxis, default), - new(objectPosition, Scalar.One)); + new(xaxis, T.Zero), + new(yaxis, T.Zero), + new(zaxis, T.Zero), + new(objectPosition, T.One)); } /// Creates a matrix that rotates around an arbitrary vector. @@ -145,7 +137,7 @@ public static Matrix4X4 CreateConstrainedBillboard(Vector3D objectPosit /// The angle to rotate around the given axis, in radians. /// The rotation matrix. public static Matrix4X4 CreateFromAxisAngle(Vector3D axis, T angle) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { // a: angle // x, y, z: unit vector for axis. @@ -173,23 +165,23 @@ public static Matrix4X4 CreateFromAxisAngle(Vector3D axis, T angle) // [ zx-cosa*zx-sina*y zy-cosa*zy+sina*x zz+cosa*(1-zz) ] // T x = axis.X, y = axis.Y, z = axis.Z; - T sa = Scalar.Sin(angle), ca = Scalar.Cos(angle); - T xx = Scalar.Multiply(x, x), yy = Scalar.Multiply(y, y), zz = Scalar.Multiply(z, z); - T xy = Scalar.Multiply(x, y), xz = Scalar.Multiply(x, z), yz = Scalar.Multiply(y, z); + T sa = T.Sin(angle), ca = T.Cos(angle); + T xx = x * x, yy = y * y, zz = z * z; + T xy = x * y, xz = x * z, yz = y * z; Matrix4X4 result = Matrix4X4.Identity; - result.M11 = Scalar.Add(xx, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, xx))); - result.M12 = Scalar.Add(Scalar.Subtract(xy, Scalar.Multiply(ca, xy)), Scalar.Multiply(sa, z)); - result.M13 = Scalar.Subtract(Scalar.Subtract(xz, Scalar.Multiply(ca, xz)), Scalar.Multiply(sa, y)); + result.M11 = xx + (ca * (T.One - xx)); + result.M12 = xy - (ca * xy) + (sa * z); + result.M13 = xz - (ca * xz) - (sa * y); - result.M21 = Scalar.Subtract(Scalar.Subtract(xy, Scalar.Multiply(ca, xy)), Scalar.Multiply(sa, z)); - result.M22 = Scalar.Add(yy, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, yy))); - result.M23 = Scalar.Add(Scalar.Subtract(yz, Scalar.Multiply(ca, yz)), Scalar.Multiply(sa, x)); + result.M21 = xy - (ca * xy) - (sa * z); + result.M22 = yy + (ca * (T.One - yy)); + result.M23 = yz - (ca * yz) + (sa * x); - result.M31 = Scalar.Add(Scalar.Subtract(xz, Scalar.Multiply(ca, xz)), Scalar.Multiply(sa, y)); - result.M32 = Scalar.Subtract(Scalar.Subtract(yz, Scalar.Multiply(ca, yz)), Scalar.Multiply(sa, x)); - result.M33 = Scalar.Add(zz, Scalar.Multiply(ca, Scalar.Subtract(Scalar.One, zz))); + result.M31 = xz - (ca * xz) + (sa * y); + result.M32 = yz - (ca * yz) - (sa * x); + result.M33 = zz + (ca * (T.One - zz)); return result; } @@ -198,32 +190,32 @@ public static Matrix4X4 CreateFromAxisAngle(Vector3D axis, T angle) /// The source Quaternion. /// The rotation matrix. public static Matrix4X4 CreateFromQuaternion(Quaternion quaternion) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T xx = Scalar.Multiply(quaternion.X, quaternion.X); - T yy = Scalar.Multiply(quaternion.Y, quaternion.Y); - T zz = Scalar.Multiply(quaternion.Z, quaternion.Z); + T xx = quaternion.X * quaternion.X; + T yy = quaternion.Y * quaternion.Y; + T zz = quaternion.Z * quaternion.Z; - T xy = Scalar.Multiply(quaternion.X, quaternion.Y); - T wz = Scalar.Multiply(quaternion.Z, quaternion.W); - T xz = Scalar.Multiply(quaternion.Z, quaternion.X); - T wy = Scalar.Multiply(quaternion.Y, quaternion.W); - T yz = Scalar.Multiply(quaternion.Y, quaternion.Z); - T wx = Scalar.Multiply(quaternion.X, quaternion.W); + T xy = quaternion.X * quaternion.Y; + T wz = quaternion.Z * quaternion.W; + T xz = quaternion.Z * quaternion.X; + T wy = quaternion.Y * quaternion.W; + T yz = quaternion.Y * quaternion.Z; + T wx = quaternion.X * quaternion.W; - result.M11 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(yy, zz))); - result.M12 = Scalar.Multiply(Scalar.Two, Scalar.Add(xy, wz)); - result.M13 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(xz, wy)); + result.M11 = T.One - (T.CreateTruncating(2) * (yy + zz)); + result.M12 = T.CreateTruncating(2) * (xy + wz); + result.M13 = T.CreateTruncating(2) * (xz - wy); - result.M21 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(xy, wz)); - result.M22 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(zz, xx))); - result.M23 = Scalar.Multiply(Scalar.Two, Scalar.Add(yz, wx)); + result.M21 = T.CreateTruncating(2) * (xy - wz); + result.M22 = T.One - (T.CreateTruncating(2) * (zz + xx)); + result.M23 = T.CreateTruncating(2) * (yz + wx); - result.M31 = Scalar.Multiply(Scalar.Two, Scalar.Add(xz, wy)); - result.M32 = Scalar.Multiply(Scalar.Two, Scalar.Subtract(yz, wx)); - result.M33 = Scalar.Subtract(Scalar.One, Scalar.Multiply(Scalar.Two, Scalar.Add(yy, xx))); + result.M31 = T.CreateTruncating(2) * (xz + wy); + result.M32 = T.CreateTruncating(2) * (yz - wx); + result.M33 = T.One - (T.CreateTruncating(2) * (yy + xx)); return result; } @@ -235,9 +227,9 @@ public static Matrix4X4 CreateFromQuaternion(Quaternion quaternion) /// Angle of rotation, in radians, around the Z-axis. /// The rotation matrix. public static Matrix4X4 CreateFromYawPitchRoll(T yaw, T pitch, T roll) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { - Quaternion q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); + var q = Quaternion.CreateFromYawPitchRoll(yaw, pitch, roll); return CreateFromQuaternion(q); } @@ -247,7 +239,7 @@ public static Matrix4X4 CreateFromYawPitchRoll(T yaw, T pitch, T roll) /// The direction that is "up" from the camera's point of view. /// The view matrix. public static Matrix4X4 CreateLookAt(Vector3D cameraPosition, Vector3D cameraTarget, Vector3D cameraUpVector) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IRootFunctions { Vector3D zaxis = Vector3D.Normalize(cameraPosition - cameraTarget); Vector3D xaxis = Vector3D.Normalize(Vector3D.Cross(cameraUpVector, zaxis)); @@ -267,9 +259,9 @@ public static Matrix4X4 CreateLookAt(Vector3D cameraPosition, Vector3D< result.M32 = yaxis.Z; result.M33 = zaxis.Z; - result.M41 = Scalar.Negate(Vector3D.Dot(xaxis, cameraPosition)); - result.M42 = Scalar.Negate(Vector3D.Dot(yaxis, cameraPosition)); - result.M43 = Scalar.Negate(Vector3D.Dot(zaxis, cameraPosition)); + result.M41 = -Vector3D.Dot(xaxis, cameraPosition); + result.M42 = -Vector3D.Dot(yaxis, cameraPosition); + result.M43 = -Vector3D.Dot(zaxis, cameraPosition); return result; } @@ -281,14 +273,14 @@ public static Matrix4X4 CreateLookAt(Vector3D cameraPosition, Vector3D< /// Maximum Z-value of the view volume. /// The orthographic projection matrix. public static Matrix4X4 CreateOrthographic(T width, T height, T zNearPlane, T zFarPlane) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; - result.M11 = Scalar.Divide(Scalar.Two, width); - result.M22 = Scalar.Divide(Scalar.Two, height); - result.M33 = Scalar.Reciprocal(Scalar.Subtract(zNearPlane, zFarPlane)); - result.M43 = Scalar.Divide(zNearPlane, Scalar.Subtract(zNearPlane, zFarPlane)); + result.M11 = T.CreateTruncating(2) / width; + result.M22 = T.CreateTruncating(2) / height; + result.M33 = T.One / (zNearPlane - zFarPlane); + result.M43 = zNearPlane / (zNearPlane - zFarPlane); return result; } @@ -302,19 +294,19 @@ public static Matrix4X4 CreateOrthographic(T width, T height, T zNearPlane /// Maximum Z-value of the view volume. /// The orthographic projection matrix. public static Matrix4X4 CreateOrthographicOffCenter(T left, T right, T bottom, T top, T zNearPlane, T zFarPlane) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; - result.M11 = Scalar.Divide(Scalar.Two, Scalar.Subtract(right, left)); + result.M11 = T.CreateTruncating(2) / (right - left); - result.M22 = Scalar.Divide(Scalar.Two, Scalar.Subtract(top, bottom)); + result.M22 = T.CreateTruncating(2) / (top - bottom); - result.M33 = Scalar.Reciprocal(Scalar.Subtract(zNearPlane, zFarPlane)); + result.M33 = T.One / (zNearPlane - zFarPlane); - result.M41 = Scalar.Divide(Scalar.Add(left, right), Scalar.Subtract(left, right)); - result.M42 = Scalar.Divide(Scalar.Add(top, bottom), Scalar.Subtract(bottom, top)); - result.M43 = Scalar.Divide(zNearPlane, Scalar.Subtract(zNearPlane, zFarPlane)); + result.M41 = (left + right) / (left - right); + result.M42 = (top + bottom) / (bottom - top); + result.M43 = zNearPlane / (zNearPlane - zFarPlane); return result; } @@ -326,31 +318,31 @@ public static Matrix4X4 CreateOrthographicOffCenter(T left, T right, T bot /// Distance to the far view plane. /// The perspective projection matrix. public static Matrix4X4 CreatePerspective(T width, T height, T nearPlaneDistance, T farPlaneDistance) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { - if (!Scalar.GreaterThan(nearPlaneDistance, Scalar.Zero)) + if (!(nearPlaneDistance > T.Zero)) throw new ArgumentOutOfRangeException(nameof(nearPlaneDistance)); - if (!Scalar.GreaterThan(farPlaneDistance, Scalar.Zero)) + if (!(farPlaneDistance > T.Zero)) throw new ArgumentOutOfRangeException(nameof(farPlaneDistance)); Matrix4X4 result = default; - result.M11 = Scalar.Divide(Scalar.Multiply(Scalar.Two, nearPlaneDistance), width); - result.M12 = result.M13 = result.M14 = Scalar.Zero; + result.M11 = T.CreateTruncating(2) * nearPlaneDistance / width; + result.M12 = result.M13 = result.M14 = T.Zero; - result.M22 = Scalar.Divide(Scalar.Multiply(Scalar.Two, nearPlaneDistance), height); - result.M21 = result.M23 = result.M24 = Scalar.Zero; + result.M22 = T.CreateTruncating(2) * nearPlaneDistance / height; + result.M21 = result.M23 = result.M24 = T.Zero; - T negFarRange = Scalar.IsPositiveInfinity(farPlaneDistance) - ? Scalar.MinusOne - : Scalar.Divide(farPlaneDistance, Scalar.Subtract(nearPlaneDistance, farPlaneDistance)); + T negFarRange = T.IsPositiveInfinity(farPlaneDistance) + ? -T.One + : farPlaneDistance / (nearPlaneDistance - farPlaneDistance); result.M33 = negFarRange; - result.M31 = result.M32 = Scalar.Zero; - result.M34 = Scalar.MinusOne; + result.M31 = result.M32 = T.Zero; + result.M34 = -T.One; - result.M41 = result.M42 = result.M44 = Scalar.Zero; - result.M43 = Scalar.Multiply(nearPlaneDistance, negFarRange); + result.M41 = result.M42 = result.M44 = T.Zero; + result.M43 = nearPlaneDistance * negFarRange; return result; } @@ -362,35 +354,35 @@ public static Matrix4X4 CreatePerspective(T width, T height, T nearPlaneDi /// Distance to the far view plane. /// The perspective projection matrix. public static Matrix4X4 CreatePerspectiveFieldOfView(T fieldOfView, T aspectRatio, T nearPlaneDistance, T farPlaneDistance) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, ITrigonometricFunctions { - if (!Scalar.GreaterThan(fieldOfView, Scalar.Zero) || Scalar.GreaterThanOrEqual(fieldOfView, Scalar.Pi)) + if (!(fieldOfView > T.Zero) || (fieldOfView >= T.Pi)) throw new ArgumentOutOfRangeException(nameof(fieldOfView)); - if (!Scalar.GreaterThan(nearPlaneDistance, Scalar.Zero)) + if (!(nearPlaneDistance > T.Zero)) throw new ArgumentOutOfRangeException(nameof(nearPlaneDistance)); - if (!Scalar.GreaterThan(farPlaneDistance, Scalar.Zero)) + if (!(farPlaneDistance > T.Zero)) throw new ArgumentOutOfRangeException(nameof(farPlaneDistance)); - T yScale = Scalar.Reciprocal(Scalar.Tan(Scalar.Divide(fieldOfView, Scalar.Two))); - T xScale = Scalar.Divide(yScale, aspectRatio); + T yScale = T.One / T.Tan(fieldOfView / T.CreateTruncating(2)); + T xScale = yScale / aspectRatio; Matrix4X4 result = default; result.M11 = xScale; - result.M12 = result.M13 = result.M14 = Scalar.Zero; + result.M12 = result.M13 = result.M14 = T.Zero; result.M22 = yScale; - result.M21 = result.M23 = result.M24 = Scalar.Zero; + result.M21 = result.M23 = result.M24 = T.Zero; - result.M31 = result.M32 = Scalar.Zero; - T negFarRange = Scalar.IsPositiveInfinity(farPlaneDistance) ? Scalar.MinusOne : Scalar.Divide(farPlaneDistance, Scalar.Subtract(nearPlaneDistance, farPlaneDistance)); + result.M31 = result.M32 = T.Zero; + T negFarRange = T.IsPositiveInfinity(farPlaneDistance) ? -T.One : farPlaneDistance / (nearPlaneDistance - farPlaneDistance); result.M33 = negFarRange; - result.M34 = Scalar.MinusOne; + result.M34 = -T.One; - result.M41 = result.M42 = result.M44 = Scalar.Zero; - result.M43 = Scalar.Multiply(nearPlaneDistance, negFarRange); + result.M41 = result.M42 = result.M44 = T.Zero; + result.M43 = nearPlaneDistance * negFarRange; return result; } @@ -404,30 +396,30 @@ public static Matrix4X4 CreatePerspectiveFieldOfView(T fieldOfView, T aspe /// Distance to of the far view plane. /// The perspective projection matrix. public static Matrix4X4 CreatePerspectiveOffCenter(T left, T right, T bottom, T top, T nearPlaneDistance, T farPlaneDistance) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { - if (!Scalar.GreaterThan(nearPlaneDistance, Scalar.Zero)) + if (!(nearPlaneDistance > T.Zero)) throw new ArgumentOutOfRangeException(nameof(nearPlaneDistance)); - if (!Scalar.GreaterThan(farPlaneDistance, Scalar.Zero)) + if (!(farPlaneDistance > T.Zero)) throw new ArgumentOutOfRangeException(nameof(farPlaneDistance)); Matrix4X4 result = default; - result.M11 = Scalar.Divide(Scalar.Multiply(Scalar.Two, nearPlaneDistance), Scalar.Subtract(right, left)); - result.M12 = result.M13 = result.M14 = Scalar.Zero; + result.M11 = T.CreateTruncating(2) * nearPlaneDistance / (right - left); + result.M12 = result.M13 = result.M14 = T.Zero; - result.M22 = Scalar.Divide(Scalar.Multiply(Scalar.Two, nearPlaneDistance), Scalar.Subtract(top, bottom)); - result.M21 = result.M23 = result.M24 = Scalar.Zero; + result.M22 = T.CreateTruncating(2) * nearPlaneDistance / (top - bottom); + result.M21 = result.M23 = result.M24 = T.Zero; - result.M31 = Scalar.Divide(Scalar.Add(left, right), Scalar.Subtract(right, left)); - result.M32 = Scalar.Divide(Scalar.Add(top, bottom), Scalar.Subtract(top, bottom)); - T negFarRange = Scalar.IsPositiveInfinity(farPlaneDistance) ? Scalar.MinusOne : Scalar.Divide(farPlaneDistance, Scalar.Subtract(nearPlaneDistance, farPlaneDistance)); + result.M31 = (left + right) / (right - left); + result.M32 = (top + bottom) / (top - bottom); + T negFarRange = T.IsPositiveInfinity(farPlaneDistance) ? -T.One : farPlaneDistance / (nearPlaneDistance - farPlaneDistance); result.M33 = negFarRange; - result.M34 = Scalar.MinusOne; + result.M34 = -T.One; - result.M43 = Scalar.Multiply(nearPlaneDistance, negFarRange); - result.M41 = result.M42 = result.M44 = Scalar.Zero; + result.M43 = nearPlaneDistance * negFarRange; + result.M41 = result.M42 = result.M44 = T.Zero; return result; } @@ -436,7 +428,7 @@ public static Matrix4X4 CreatePerspectiveOffCenter(T left, T right, T bott /// The Plane about which to create a reflection. /// A new matrix expressing the reflection. public static Matrix4X4 CreateReflection(Plane value) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { value = Plane.Normalize(value); @@ -444,27 +436,27 @@ public static Matrix4X4 CreateReflection(Plane value) T b = value.Normal.Y; T c = value.Normal.Z; - T fa = Scalar.Multiply(Scalar.MinusTwo, a); - T fb = Scalar.Multiply(Scalar.MinusTwo, b); - T fc = Scalar.Multiply(Scalar.MinusTwo, c); + T fa = -T.CreateTruncating(2) * a; + T fb = -T.CreateTruncating(2) * b; + T fc = -T.CreateTruncating(2) * c; Matrix4X4 result = Matrix4X4.Identity; - result.M11 = Scalar.Add(Scalar.Multiply(fa, a), Scalar.One); - result.M12 = Scalar.Multiply(fb, a); - result.M13 = Scalar.Multiply(fc, a); + result.M11 = (fa * a) + T.One; + result.M12 = fb * a; + result.M13 = fc * a; - result.M21 = Scalar.Multiply(fa, b); - result.M22 = Scalar.Add(Scalar.Multiply(fb, b), Scalar.One); - result.M23 = Scalar.Multiply(fc, b); + result.M21 = fa * b; + result.M22 = (fb * b) + T.One; + result.M23 = fc * b; - result.M31 = Scalar.Multiply(fa, c); - result.M32 = Scalar.Multiply(fb, c); - result.M33 = Scalar.Add(Scalar.Multiply(fc, c), Scalar.One); + result.M31 = fa * c; + result.M32 = fb * c; + result.M33 = (fc * c) + T.One; - result.M41 = Scalar.Multiply(fa, value.Distance); - result.M42 = Scalar.Multiply(fb, value.Distance); - result.M43 = Scalar.Multiply(fc, value.Distance); + result.M41 = fa * value.Distance; + result.M42 = fb * value.Distance; + result.M43 = fc * value.Distance; return result; } @@ -473,12 +465,12 @@ public static Matrix4X4 CreateReflection(Plane value) /// The amount, in radians, by which to rotate around the X-axis. /// The rotation matrix. public static Matrix4X4 CreateRotationX(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); // [ 1 0 0 0 ] // [ 0 c s 0 ] @@ -487,7 +479,7 @@ public static Matrix4X4 CreateRotationX(T radians) result.M22 = c; result.M23 = s; - result.M32 = Scalar.Negate(s); + result.M32 = -s; result.M33 = c; return result; @@ -498,15 +490,15 @@ public static Matrix4X4 CreateRotationX(T radians) /// The center point. /// The rotation matrix. public static Matrix4X4 CreateRotationX(T radians, Vector3D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); - T y = Scalar.Add(Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.Z, s)); - T z = Scalar.Subtract(Scalar.Multiply(centerPoint.Z, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.Y, s)); + T y = (centerPoint.Y * (T.One - c)) + (centerPoint.Z * s); + T z = (centerPoint.Z * (T.One - c)) - (centerPoint.Y * s); // [ 1 0 0 0 ] // [ 0 c s 0 ] @@ -515,7 +507,7 @@ public static Matrix4X4 CreateRotationX(T radians, Vector3D centerPoint result.M22 = c; result.M23 = s; - result.M32 = Scalar.Negate(s); + result.M32 = -s; result.M33 = c; result.M42 = y; result.M43 = z; @@ -527,19 +519,19 @@ public static Matrix4X4 CreateRotationX(T radians, Vector3D centerPoint /// The amount, in radians, by which to rotate around the Y-axis. /// The rotation matrix. public static Matrix4X4 CreateRotationY(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); // [ c 0 -s 0 ] // [ 0 1 0 0 ] // [ s 0 c 0 ] // [ 0 0 0 1 ] result.M11 = c; - result.M13 = Scalar.Negate(s); + result.M13 = -s; result.M31 = s; result.M33 = c; @@ -551,22 +543,22 @@ public static Matrix4X4 CreateRotationY(T radians) /// The center point. /// The rotation matrix. public static Matrix4X4 CreateRotationY(T radians, Vector3D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); - T x = Scalar.Subtract(Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.Z, s)); - T z = Scalar.Add(Scalar.Multiply(centerPoint.Z, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.X, s)); + T x = (centerPoint.X * (T.One - c)) - (centerPoint.Z * s); + T z = (centerPoint.Z * (T.One - c)) + (centerPoint.X * s); // [ c 0 -s 0 ] // [ 0 1 0 0 ] // [ s 0 c 0 ] // [ x 0 z 1 ] result.M11 = c; - result.M13 = Scalar.Negate(s); + result.M13 = -s; result.M31 = s; result.M33 = c; result.M41 = x; @@ -579,12 +571,12 @@ public static Matrix4X4 CreateRotationY(T radians, Vector3D centerPoint /// The amount, in radians, by which to rotate around the Z-axis. /// The rotation matrix. public static Matrix4X4 CreateRotationZ(T radians) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); // [ c s 0 0 ] // [ -s c 0 0 ] @@ -592,7 +584,7 @@ public static Matrix4X4 CreateRotationZ(T radians) // [ 0 0 0 1 ] result.M11 = c; result.M12 = s; - result.M21 = Scalar.Negate(s); + result.M21 = -s; result.M22 = c; return result; @@ -603,15 +595,15 @@ public static Matrix4X4 CreateRotationZ(T radians) /// The center point. /// The rotation matrix. public static Matrix4X4 CreateRotationZ(T radians, Vector3D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : ITrigonometricFunctions { Matrix4X4 result = Matrix4X4.Identity; - T c = Scalar.Cos(radians); - T s = Scalar.Sin(radians); + T c = T.Cos(radians); + T s = T.Sin(radians); - T x = Scalar.Add(Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.Y, s)); - T y = Scalar.Subtract(Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, c)), Scalar.Multiply(centerPoint.X, s)); + T x = (centerPoint.X * (T.One - c)) + (centerPoint.Y * s); + T y = (centerPoint.Y * (T.One - c)) - (centerPoint.X * s); // [ c s 0 0 ] // [ -s c 0 0 ] @@ -619,7 +611,7 @@ public static Matrix4X4 CreateRotationZ(T radians, Vector3D centerPoint // [ x y 0 1 ] result.M11 = c; result.M12 = s; - result.M21 = Scalar.Negate(s); + result.M21 = -s; result.M22 = c; result.M41 = x; result.M42 = y; @@ -633,7 +625,7 @@ public static Matrix4X4 CreateRotationZ(T radians, Vector3D centerPoint /// Value to scale by on the Z-axis. /// The scaling matrix. public static Matrix4X4 CreateScale(T xScale, T yScale, T zScale) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; result.M11 = xScale; @@ -649,13 +641,13 @@ public static Matrix4X4 CreateScale(T xScale, T yScale, T zScale) /// The center point. /// The scaling matrix. public static Matrix4X4 CreateScale(T xScale, T yScale, T zScale, Vector3D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; - T tx = Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, xScale)); - T ty = Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, yScale)); - T tz = Scalar.Multiply(centerPoint.Z, Scalar.Subtract(Scalar.One, zScale)); + T tx = centerPoint.X * (T.One - xScale); + T ty = centerPoint.Y * (T.One - yScale); + T tz = centerPoint.Z * (T.One - zScale); result.M11 = xScale; result.M22 = yScale; @@ -670,7 +662,7 @@ public static Matrix4X4 CreateScale(T xScale, T yScale, T zScale, Vector3D /// The vector containing the amount to scale by on each axis. /// The scaling matrix. public static Matrix4X4 CreateScale(Vector3D scales) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; result.M11 = scales.X; @@ -684,13 +676,13 @@ public static Matrix4X4 CreateScale(Vector3D scales) /// The center point. /// The scaling matrix. public static Matrix4X4 CreateScale(Vector3D scales, Vector3D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; - T tx = Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, scales.X)); - T ty = Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, scales.Y)); - T tz = Scalar.Multiply(centerPoint.Z, Scalar.Subtract(Scalar.One, scales.Z)); + T tx = centerPoint.X * (T.One - scales.X); + T ty = centerPoint.Y * (T.One - scales.Y); + T tz = centerPoint.Z * (T.One - scales.Z); result.M11 = scales.X; result.M22 = scales.Y; @@ -705,7 +697,7 @@ public static Matrix4X4 CreateScale(Vector3D scales, Vector3D center /// The uniform scaling factor. /// The scaling matrix. public static Matrix4X4 CreateScale(T scale) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; @@ -721,13 +713,13 @@ public static Matrix4X4 CreateScale(T scale) /// The center point. /// The scaling matrix. public static Matrix4X4 CreateScale(T scale, Vector3D centerPoint) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; - T tx = Scalar.Multiply(centerPoint.X, Scalar.Subtract(Scalar.One, scale)); - T ty = Scalar.Multiply(centerPoint.Y, Scalar.Subtract(Scalar.One, scale)); - T tz = Scalar.Multiply(centerPoint.Z, Scalar.Subtract(Scalar.One, scale)); + T tx = centerPoint.X * (T.One - scale); + T ty = centerPoint.Y * (T.One - scale); + T tz = centerPoint.Z * (T.One - scale); result.M11 = scale; result.M22 = scale; @@ -745,32 +737,32 @@ public static Matrix4X4 CreateScale(T scale, Vector3D centerPoint) /// The Plane onto which the new matrix should flatten geometry so as to cast a shadow. /// A new Matrix that can be used to flatten geometry onto the specified plane from the specified direction. public static Matrix4X4 CreateShadow(Vector3D lightDirection, Plane plane) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { Plane p = Plane.Normalize(plane); - T dot = Scalar.Add(Scalar.Add(Scalar.Multiply(p.Normal.X, lightDirection.X), Scalar.Multiply(p.Normal.Y, lightDirection.Y)), Scalar.Multiply(p.Normal.Z, lightDirection.Z)); - T a = Scalar.Negate(p.Normal.X); - T b = Scalar.Negate(p.Normal.Y); - T c = Scalar.Negate(p.Normal.Z); - T d = Scalar.Negate(p.Distance); + T dot = (p.Normal.X * lightDirection.X) + (p.Normal.Y * lightDirection.Y) + (p.Normal.Z * lightDirection.Z); + T a = -p.Normal.X; + T b = -p.Normal.Y; + T c = -p.Normal.Z; + T d = -p.Distance; Matrix4X4 result = Matrix4X4.Identity; - result.M11 = Scalar.Add(Scalar.Multiply(a, lightDirection.X), dot); - result.M21 = Scalar.Multiply(b, lightDirection.X); - result.M31 = Scalar.Multiply(c, lightDirection.X); - result.M41 = Scalar.Multiply(d, lightDirection.X); + result.M11 = (a * lightDirection.X) + dot; + result.M21 = b * lightDirection.X; + result.M31 = c * lightDirection.X; + result.M41 = d * lightDirection.X; - result.M12 = Scalar.Multiply(a, lightDirection.Y); - result.M22 = Scalar.Add(Scalar.Multiply(b, lightDirection.Y), dot); - result.M32 = Scalar.Multiply(c, lightDirection.Y); - result.M42 = Scalar.Multiply(d, lightDirection.Y); + result.M12 = a * lightDirection.Y; + result.M22 = (b * lightDirection.Y) + dot; + result.M32 = c * lightDirection.Y; + result.M42 = d * lightDirection.Y; - result.M13 = Scalar.Multiply(a, lightDirection.Z); - result.M23 = Scalar.Multiply(b, lightDirection.Z); - result.M33 = Scalar.Add(Scalar.Multiply(c, lightDirection.Z), dot); - result.M43 = Scalar.Multiply(d, lightDirection.Z); + result.M13 = a * lightDirection.Z; + result.M23 = b * lightDirection.Z; + result.M33 = (c * lightDirection.Z) + dot; + result.M43 = d * lightDirection.Z; result.M44 = dot; @@ -781,7 +773,7 @@ public static Matrix4X4 CreateShadow(Vector3D lightDirection, Plane /// The amount to translate in each axis. /// The translation matrix. public static Matrix4X4 CreateTranslation(Vector3D position) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { Matrix4X4 result = Matrix4X4.Identity; result.M41 = position.X; @@ -796,9 +788,9 @@ public static Matrix4X4 CreateTranslation(Vector3D position) /// The amount to translate on the Z-axis. /// The translation matrix. public static Matrix4X4 CreateTranslation(T xPosition, T yPosition, T zPosition) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { - Matrix4X4 result = Matrix4X4.Identity; ; + Matrix4X4 result = Matrix4X4.Identity; result.M41 = xPosition; result.M42 = yPosition; result.M43 = zPosition; @@ -811,7 +803,7 @@ public static Matrix4X4 CreateTranslation(T xPosition, T yPosition, T zPos /// Upward direction of the object; usually [0, 1, 0]. /// The world matrix. public static Matrix4X4 CreateWorld(Vector3D position, Vector3D forward, Vector3D up) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IRootFunctions { Vector3D zaxis = Vector3D.Normalize(-forward); Vector3D xaxis = Vector3D.Normalize(Vector3D.Cross(up, zaxis)); @@ -843,9 +835,9 @@ public static Matrix4X4 CreateWorld(Vector3D position, Vector3D forw /// If successful, contains the inverted matrix. /// True if the source matrix could be inverted; False otherwise. /// - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static unsafe bool Invert(Matrix4X4 matrix, out Matrix4X4 result) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IFloatingPointIeee754 { // This implementation is based on the DirectX Math Library XMMatrixInverse method // https://github.com/microsoft/DirectXMath/blob/master/Inc/DirectXMathMatrix.inl @@ -1123,134 +1115,72 @@ static bool SoftwareFallback(Matrix4X4 matrix, out Matrix4X4 result) T i = matrix.M31, j = matrix.M32, k = matrix.M33, l = matrix.M34; T m = matrix.M41, n = matrix.M42, o = matrix.M43, p = matrix.M44; - T kp_lo = Scalar.Subtract(Scalar.Multiply(k, p), Scalar.Multiply(l, o)); - T jp_ln = Scalar.Subtract(Scalar.Multiply(j, p), Scalar.Multiply(l, n)); - T jo_kn = Scalar.Subtract(Scalar.Multiply(j, o), Scalar.Multiply(k, n)); - T ip_lm = Scalar.Subtract(Scalar.Multiply(i, p), Scalar.Multiply(l, m)); - T io_km = Scalar.Subtract(Scalar.Multiply(i, o), Scalar.Multiply(k, m)); - T in_jm = Scalar.Subtract(Scalar.Multiply(i, n), Scalar.Multiply(j, m)); + T kp_lo = (k * p) - (l * o); + T jp_ln = (j * p) - (l * n); + T jo_kn = (j * o) - (k * n); + T ip_lm = (i * p) - (l * m); + T io_km = (i * o) - (k * m); + T in_jm = (i * n) - (j * m); - T a11 = Scalar.Add(Scalar.Subtract(Scalar.Multiply(f, kp_lo), Scalar.Multiply(g, jp_ln)), Scalar.Multiply(h, jo_kn)); - T a12 = Scalar.Negate(Scalar.Add(Scalar.Subtract(Scalar.Multiply(e, kp_lo), Scalar.Multiply(g, ip_lm)), Scalar.Multiply(h, io_km))); - T a13 = Scalar.Add(Scalar.Subtract(Scalar.Multiply(e, jp_ln), Scalar.Multiply(f, ip_lm)), Scalar.Multiply(h, in_jm)); - T a14 = Scalar.Negate(Scalar.Add(Scalar.Subtract(Scalar.Multiply(e, jo_kn), Scalar.Multiply(f, io_km)), Scalar.Multiply(g, in_jm))); + T a11 = (f * kp_lo) - (g * jp_ln) + (h * jo_kn); + T a12 = -((e * kp_lo) - (g * ip_lm) + (h * io_km)); + T a13 = (e * jp_ln) - (f * ip_lm) + (h * in_jm); + T a14 = -((e * jo_kn) - (f * io_km) + (g * in_jm)); - T det = Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(a, a11), Scalar.Multiply(b, a12)), Scalar.Multiply(c, a13)), Scalar.Multiply(d, a14)); + T det = (a * a11) + (b * a12) + (c * a13) + (d * a14); - if (!Scalar.GreaterThanOrEqual(Scalar.Abs(det), Scalar.Epsilon)) + if (!(T.Abs(det) >= T.Epsilon)) { - result = new Matrix4X4(Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN, - Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN, - Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN, - Scalar.NaN, Scalar.NaN, Scalar.NaN, Scalar.NaN); + result = new Matrix4X4(T.NaN, T.NaN, T.NaN, T.NaN, + T.NaN, T.NaN, T.NaN, T.NaN, + T.NaN, T.NaN, T.NaN, T.NaN, + T.NaN, T.NaN, T.NaN, T.NaN); return false; } - T invDet = Scalar.Reciprocal(det); + T invDet = T.One / det; // TODO: Vectorize result = default; - result.M11 = Scalar.Multiply(a11, invDet); - result.M21 = Scalar.Multiply(a12, invDet); - result.M31 = Scalar.Multiply(a13, invDet); - result.M41 = Scalar.Multiply(a14, invDet); - - result.M12 = Scalar.Negate(Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(b, kp_lo), Scalar.Multiply(c, jp_ln)), Scalar.Multiply(d, jo_kn)), invDet)); - result.M22 = Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, kp_lo), Scalar.Multiply(c, ip_lm)), Scalar.Multiply(d, io_km)), invDet); - result.M32 = Scalar.Negate(Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, jp_ln), Scalar.Multiply(b, ip_lm)), Scalar.Multiply(d, in_jm)), invDet)); - result.M42 = Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, jo_kn), Scalar.Multiply(b, io_km)), Scalar.Multiply(c, in_jm)), invDet); - - T gp_ho = Scalar.Subtract(Scalar.Multiply(g, p), Scalar.Multiply(h, o)); - T fp_hn = Scalar.Subtract(Scalar.Multiply(f, p), Scalar.Multiply(h, n)); - T fo_gn = Scalar.Subtract(Scalar.Multiply(f, o), Scalar.Multiply(g, n)); - T ep_hm = Scalar.Subtract(Scalar.Multiply(e, p), Scalar.Multiply(h, m)); - T eo_gm = Scalar.Subtract(Scalar.Multiply(e, o), Scalar.Multiply(g, m)); - T en_fm = Scalar.Subtract(Scalar.Multiply(e, n), Scalar.Multiply(f, m)); - - result.M13 = Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(b, gp_ho), Scalar.Multiply(c, fp_hn)), Scalar.Multiply(d, fo_gn)), invDet); - result.M23 = Scalar.Negate(Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, gp_ho), Scalar.Multiply(c, ep_hm)), Scalar.Multiply(d, eo_gm)), invDet)); - result.M33 = Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, fp_hn), Scalar.Multiply(b, ep_hm)), Scalar.Multiply(d, en_fm)), invDet); - result.M43 = Scalar.Negate(Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, fo_gn), Scalar.Multiply(b, eo_gm)), Scalar.Multiply(c, en_fm)), invDet)); - - T gl_hk = Scalar.Subtract(Scalar.Multiply(g, l), Scalar.Multiply(h, k)); - T fl_hj = Scalar.Subtract(Scalar.Multiply(f, l), Scalar.Multiply(h, j)); - T fk_gj = Scalar.Subtract(Scalar.Multiply(f, k), Scalar.Multiply(g, j)); - T el_hi = Scalar.Subtract(Scalar.Multiply(e, l), Scalar.Multiply(h, i)); - T ek_gi = Scalar.Subtract(Scalar.Multiply(e, k), Scalar.Multiply(g, i)); - T ej_fi = Scalar.Subtract(Scalar.Multiply(e, j), Scalar.Multiply(f, i)); - - result.M14 = Scalar.Negate(Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(b, gl_hk), Scalar.Multiply(c, fl_hj)), Scalar.Multiply(d, fk_gj)), invDet)); - result.M24 = Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, gl_hk), Scalar.Multiply(c, el_hi)), Scalar.Multiply(d, ek_gi)), invDet); - result.M34 = Scalar.Negate(Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, fl_hj), Scalar.Multiply(b, el_hi)), Scalar.Multiply(d, ej_fi)), invDet)); - result.M44 = Scalar.Multiply(Scalar.Add(Scalar.Subtract(Scalar.Multiply(a, fk_gj), Scalar.Multiply(b, ek_gi)), Scalar.Multiply(c, ej_fi)), invDet); + result.M11 = a11 * invDet; + result.M21 = a12 * invDet; + result.M31 = a13 * invDet; + result.M41 = a14 * invDet; + + result.M12 = -(((b * kp_lo) - (c * jp_ln) + (d * jo_kn)) * invDet); + result.M22 = ((a * kp_lo) - (c * ip_lm) + (d * io_km)) * invDet; + result.M32 = -(((a * jp_ln) - (b * ip_lm) + (d * in_jm)) * invDet); + result.M42 = ((a * jo_kn) - (b * io_km) + (c * in_jm)) * invDet; + + T gp_ho = (g * p) - (h * o); + T fp_hn = (f * p) - (h * n); + T fo_gn = (f * o) - (g * n); + T ep_hm = (e * p) - (h * m); + T eo_gm = (e * o) - (g * m); + T en_fm = (e * n) - (f * m); + + result.M13 = ((b * gp_ho) - (c * fp_hn) + (d * fo_gn)) * invDet; + result.M23 = -(((a * gp_ho) - (c * ep_hm) + (d * eo_gm)) * invDet); + result.M33 = ((a * fp_hn) - (b * ep_hm) + (d * en_fm)) * invDet; + result.M43 = -(((a * fo_gn) - (b * eo_gm) + (c * en_fm)) * invDet); + + T gl_hk = (g * l) - (h * k); + T fl_hj = (f * l) - (h * j); + T fk_gj = (f * k) - (g * j); + T el_hi = (e * l) - (h * i); + T ek_gi = (e * k) - (g * i); + T ej_fi = (e * j) - (f * i); + + result.M14 = -(((b * gl_hk) - (c * fl_hj) + (d * fk_gj)) * invDet); + result.M24 = ((a * gl_hk) - (c * el_hi) + (d * ek_gi)) * invDet; + result.M34 = -(((a * fl_hj) - (b * el_hi) + (d * ej_fi)) * invDet); + result.M44 = ((a * fk_gj) - (b * ek_gi) + (c * ej_fi)) * invDet; return true; } } - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Multiply(Matrix4X4 value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector4D value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix2X4 Multiply(Matrix2X4 value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X2 Multiply(Matrix4X4 value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Multiply(Matrix4X4 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Negate(Matrix4X4 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix4X4 Subtract(Matrix4X4 value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - /*[MethodImpl((MethodImplOptions)768)] private static Vector128 Permute(Vector128 value, byte control) { @@ -1269,6 +1199,7 @@ private static Vector128 Permute(Vector128 value, byte control) } }*/ + /* /// Attempts to extract the scale, translation, and rotation components from the given scale/rotation/translation matrix. /// If successful, the out parameters will contained the extracted values. /// The source matrix. @@ -1277,7 +1208,7 @@ private static Vector128 Permute(Vector128 value, byte control) /// The translation component of the transformation matrix /// True if the source matrix was successfully decomposed; False otherwise. public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out Quaternion rotation, out Vector3D translation) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { bool result = true; @@ -1295,9 +1226,9 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out CanonicalBasis canonicalBasis = default; Vector3D* pCanonicalBasis = &canonicalBasis.Row0; - canonicalBasis.Row0 = new Vector3D(Scalar.One, Scalar.Zero, Scalar.Zero); - canonicalBasis.Row1 = new Vector3D(Scalar.Zero, Scalar.One, Scalar.Zero); - canonicalBasis.Row2 = new Vector3D(Scalar.Zero, Scalar.Zero, Scalar.One); + canonicalBasis.Row0 = new Vector3D(T.One, T.Zero, T.Zero); + canonicalBasis.Row1 = new Vector3D(T.Zero, T.One, T.Zero); + canonicalBasis.Row2 = new Vector3D(T.Zero, T.Zero, T.One); translation = new Vector3D( matrix.M41, @@ -1319,9 +1250,9 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out uint a, b, c; #region Ranking T x = pfScales[0], y = pfScales[1], z = pfScales[2]; - if (!Scalar.GreaterThanOrEqual(x, y)) + if (!(x >= y)) { - if (!Scalar.GreaterThanOrEqual(y, z)) + if (!(y >= z)) { a = 2; b = 1; @@ -1331,7 +1262,7 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out { a = 1; - if (!Scalar.GreaterThanOrEqual(x, z)) + if (!(x >= z)) { b = 2; c = 0; @@ -1345,7 +1276,7 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out } else { - if (!Scalar.GreaterThanOrEqual(x, z)) + if (!(x >= z)) { a = 2; b = 0; @@ -1355,7 +1286,7 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out { a = 0; - if (!Scalar.GreaterThanOrEqual(y, z)) + if (!(y >= z)) { b = 2; c = 1; @@ -1369,32 +1300,32 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out } #endregion - if (!Scalar.GreaterThanOrEqual(pfScales[a], Scalar.As(DecomposeEpsilon))) + if (!(pfScales[a] >= T.CreateTruncating(DecomposeEpsilon))) { *(pVectorBasis[a]) = pCanonicalBasis[a]; } *pVectorBasis[a] = Vector3D.Normalize(*pVectorBasis[a]); - if (!Scalar.GreaterThanOrEqual(pfScales[b], Scalar.As(DecomposeEpsilon))) + if (!(pfScales[b] >= T.CreateTruncating(DecomposeEpsilon))) { uint cc; T fAbsX, fAbsY, fAbsZ; - fAbsX = Scalar.Abs(pVectorBasis[a]->X); - fAbsY = Scalar.Abs(pVectorBasis[a]->Y); - fAbsZ = Scalar.Abs(pVectorBasis[a]->Z); + fAbsX = T.Abs(pVectorBasis[a]->X); + fAbsY = T.Abs(pVectorBasis[a]->Y); + fAbsZ = T.Abs(pVectorBasis[a]->Z); #region Ranking - if (!Scalar.GreaterThanOrEqual(fAbsX, fAbsY)) + if (!(fAbsX >= fAbsY)) { - if (!Scalar.GreaterThanOrEqual(fAbsY, fAbsZ)) + if (!(fAbsY >= fAbsZ)) { cc = 0; } else { - if (!Scalar.GreaterThanOrEqual(fAbsX, fAbsZ)) + if (!(fAbsX >= fAbsZ)) { cc = 0; } @@ -1406,13 +1337,13 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out } else { - if (!Scalar.GreaterThanOrEqual(fAbsX, fAbsZ)) + if (!(fAbsX >= fAbsZ)) { cc = 1; } else { - if (!Scalar.GreaterThanOrEqual(fAbsY, fAbsZ)) + if (!(fAbsY >= fAbsZ)) { cc = 1; } @@ -1429,7 +1360,7 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out *pVectorBasis[b] = Vector3D.Normalize(*pVectorBasis[b]); - if (!Scalar.GreaterThanOrEqual(pfScales[c], Scalar.As(DecomposeEpsilon))) + if (!(pfScales[c] >= T.CreateTruncating(DecomposeEpsilon))) { *pVectorBasis[c] = Vector3D.Cross(*pVectorBasis[a], *pVectorBasis[b]); } @@ -1439,19 +1370,19 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out det = matTemp.GetDeterminant(); // use Kramer's rule to check for handedness of coordinate system - if (!Scalar.GreaterThanOrEqual(det, Scalar.Zero)) + if (!(det >= T.Zero)) { // switch coordinate system by negating the scale and inverting the basis vector on the x-axis - pfScales[a] = Scalar.Negate(pfScales[a]); + pfScales[a] = -pfScales[a]; *pVectorBasis[a] = -(*pVectorBasis[a]); - det = Scalar.Negate(det); + det = -det; } - det = Scalar.Subtract(det, Scalar.One); - det = Scalar.Multiply(det, det); + det = det - T.One; + det = det * det; - if (!Scalar.GreaterThanOrEqual(Scalar.As(DecomposeEpsilon), det)) + if (!(T.CreateTruncating(DecomposeEpsilon) >= det)) { // Non-SRT matrix encountered rotation = Quaternion.Identity; @@ -1467,56 +1398,41 @@ public static bool Decompose(Matrix4X4 matrix, out Vector3D scale, out return result; } - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix4X4 Lerp(Matrix4X4 matrix1, Matrix4X4 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Vector4D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector4D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector4D.Lerp(matrix1.Row3, matrix2.Row3, amount), - Vector4D.Lerp(matrix1.Row4, matrix2.Row4, amount) - ); - } + */ /// Transforms the given matrix by applying the given Quaternion rotation. /// The source matrix to transform. /// The rotation to apply. /// The transformed matrix. public static Matrix4X4 Transform(Matrix4X4 value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { // Compute rotation matrix. - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - T q11 = Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2); - T q21 = Scalar.Subtract(xy2, wz2); - T q31 = Scalar.Add(xz2, wy2); - - T q12 = Scalar.Add(xy2, wz2); - T q22 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2); - T q32 = Scalar.Subtract(yz2, wx2); - - T q13 = Scalar.Subtract(xz2, wy2); - T q23 = Scalar.Add(yz2, wx2); - T q33 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2); + T x2 = rotation.X + rotation.X; + T y2 = rotation.Y + rotation.Y; + T z2 = rotation.Z + rotation.Z; + + T wx2 = rotation.W * x2; + T wy2 = rotation.W * y2; + T wz2 = rotation.W * z2; + T xx2 = rotation.X * x2; + T xy2 = rotation.X * y2; + T xz2 = rotation.X * z2; + T yy2 = rotation.Y * y2; + T yz2 = rotation.Y * z2; + T zz2 = rotation.Z * z2; + + T q11 = T.One - yy2 - zz2; + T q21 = xy2 - wz2; + T q31 = xz2 + wy2; + + T q12 = xy2 + wz2; + T q22 = T.One - xx2 - zz2; + T q32 = yz2 - wx2; + + T q13 = xz2 - wy2; + T q23 = yz2 + wx2; + T q33 = T.One - xx2 - yy2; var q1 = new Vector3D(q11, q12, q13); var q2 = new Vector3D(q21, q22, q23); @@ -1534,9 +1450,9 @@ public static Matrix4X4 Transform(Matrix4X4 value, Quaternion rotati /// The source matrix. /// The transposed matrix. public static unsafe Matrix4X4 Transpose(Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { return new(matrix.Column1, matrix.Column2, matrix.Column3, matrix.Column4); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Matrix4X4.Ops.gen.cs b/sources/Maths/Maths/Matrix4X4.Ops.gen.cs new file mode 100644 index 0000000000..80278aa415 --- /dev/null +++ b/sources/Maths/Maths/Matrix4X4.Ops.gen.cs @@ -0,0 +1,128 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix4X4 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix4X4 Lerp(Matrix4X4 value1, Matrix4X4 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector4D.Lerp(value1.Row1, value2.Row1, amount), + Vector4D.Lerp(value1.Row2, value2.Row2, amount), + Vector4D.Lerp(value1.Row3, value2.Row3, amount), + Vector4D.Lerp(value1.Row4, value2.Row4, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix4X4 Add(Matrix4X4 left, Matrix4X4 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix4X4 Negate(Matrix4X4 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4X4 Subtract(Matrix4X4 left, Matrix4X4 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4X4 Multiply(Matrix4X4 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix4X4 Multiply(T left, Matrix4X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector4D Multiply(Vector4D rowVector, Matrix4X4 matrix) + where T : INumberBase => + rowVector * matrix; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector4D Multiply(Matrix4X4 matrix, Vector4D columnVector) + where T : INumberBase => + matrix * columnVector; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 Multiply(Matrix2X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 Multiply(Matrix3X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 Multiply(Matrix4X4 left, Matrix4X2 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 Multiply(Matrix4X4 left, Matrix4X3 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 Multiply(Matrix4X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix5X4 Multiply(Matrix5X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix4X4.cs b/sources/Maths/Maths/Matrix4X4.cs index 1bc8c0553a..6b8af672f3 100644 --- a/sources/Maths/Maths/Matrix4X4.cs +++ b/sources/Maths/Maths/Matrix4X4.cs @@ -1,294 +1,28 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; - namespace Silk.NET.Maths { - /// A structure encapsulating a 4x4 matrix. - [Serializable] - [DataContract] - public struct Matrix4X4 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix4X4 { - private static readonly Matrix4X4 _identity = new - ( - Scalar.One, Scalar.Zero, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.One, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.Zero, Scalar.One - ); - - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row2; - - /// - /// Row 3 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row3; - - /// - /// Row 4 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row4; - - /// - /// Column 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column1 => new(Row1.X, Row2.X, Row3.X, Row4.X); - - /// - /// Column 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column2 => new(Row1.Y, Row2.Y, Row3.Y, Row4.Y); - - /// - /// Column 3 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column3 => new(Row1.Z, Row2.Z, Row3.Z, Row4.Z); - - /// - /// Column 4 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Column4 => new(Row1.W, Row2.W, Row3.W, Row4.W); - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 1, column 4 of the matrix. - [DataMember] - public T M14 - { - readonly get => Row1.W; - set => Row1.W = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// Value at row 2, column 4 of the matrix. - [DataMember] - public T M24 - { - readonly get => Row2.W; - set => Row2.W = value; - } - - /// Value at row 3, column 1 of the matrix. - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// Value at row 3, column 2 of the matrix. - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// Value at row 3, column 3 of the matrix. - [DataMember] - public T M33 - { - readonly get => Row3.Z; - set => Row3.Z = value; - } - - /// Value at row 3, column 4 of the matrix. - [DataMember] - public T M34 - { - readonly get => Row3.W; - set => Row3.W = value; - } - - /// Value at row 4, column 1 of the matrix. - [DataMember] - public T M41 - { - readonly get => Row4.X; - set => Row4.X = value; - } - - /// Value at row 4, column 2 of the matrix. - [DataMember] - public T M42 - { - readonly get => Row4.Y; - set => Row4.Y = value; - } - - /// Value at row 4, column 3 of the matrix. - [DataMember] - public T M43 - { - readonly get => Row4.Z; - set => Row4.Z = value; - } - - /// Value at row 4, column 4 of the matrix. - [DataMember] - public T M44 - { - readonly get => Row4.W; - set => Row4.W = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector4D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 3 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// - /// Constructs a from the given rows - /// - public Matrix4X4(Vector4D row1, Vector4D row2, Vector4D row3, Vector4D row4) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - Row4 = row4; - } - - /// Constructs a from the given components. - public Matrix4X4 - ( - T m11, - T m12, - T m13, - T m14, - T m21, - T m22, - T m23, - T m24, - T m31, - T m32, - T m33, - T m34, - T m41, - T m42, - T m43, - T m44 - ) - { - Row1 = new(m11, m12, m13, m14); - Row2 = new(m21, m22, m23, m24); - Row3 = new(m31, m32, m33, m34); - Row4 = new(m41, m42, m43, m44); - } - /// Constructs a from the given . /// The source . public Matrix4X4(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); - Row4 = new(value.M31, value.M32, default, Scalar.One); - Row3 = new(default, default, Scalar.One, default); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); + Row4 = new(value.M31, value.M32, T.Zero, T.One); + Row3 = new(T.Zero, T.Zero, T.One, T.Zero); } /// Constructs a from the given . /// The source . public Matrix4X4(Matrix4X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); - Row3 = new(value.M31, value.M32, value.M33, default); - Row4 = new(value.M41, value.M42, value.M43, Scalar.One); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); + Row3 = new(value.M31, value.M32, value.M33, T.Zero); + Row4 = new(value.M41, value.M42, value.M43, T.One); } /// Constructs a from the given . @@ -305,10 +39,10 @@ public Matrix4X4(Matrix3X4 value) /// The source . public Matrix4X4(Matrix3X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); - Row4 = new(value.M31, value.M32, value.M33, Scalar.One); - Row3 = new(default, default, Scalar.One, default); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); + Row4 = new(value.M31, value.M32, value.M33, T.One); + Row3 = new(T.Zero, T.Zero, T.One, T.Zero); } /// Constructs a from the given . @@ -325,180 +59,12 @@ public Matrix4X4(Matrix2X4 value) /// The source . public Matrix4X4(Matrix4X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); - Row3 = new(value.M31, value.M32, Scalar.One, default); - Row4 = new(value.M41, value.M42, default, Scalar.One); - } - - /// Returns the multiplicative identity matrix. - public static Matrix4X4 Identity => _identity; - - /// Returns whether the matrix is the identity matrix. - [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && Scalar.Equal(M22, Scalar.One) && - Scalar.Equal(M33, Scalar.One) && - Scalar.Equal(M44, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M14, Scalar.Zero) && Scalar.Equal(M21, Scalar.Zero) && - Scalar.Equal(M23, Scalar.Zero) && Scalar.Equal(M24, Scalar.Zero) && - Scalar.Equal(M31, Scalar.Zero) && Scalar.Equal(M32, Scalar.Zero) && - Scalar.Equal(M34, Scalar.Zero) && Scalar.Equal(M41, Scalar.Zero) && - Scalar.Equal(M42, Scalar.Zero) && Scalar.Equal(M43, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix4X4 operator +(Matrix4X4 value1, Matrix4X4 value2) - { - return new - ( - value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3, - value1.Row4 + value2.Row4 - ); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix4X4 value1, Matrix4X4 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - Scalar.Equal(value1.M33, value2.M33) && - Scalar.Equal(value1.M44, value2.M44) && // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M14, value2.M14) && Scalar.Equal(value1.M21, value2.M21) && - Scalar.Equal(value1.M23, value2.M23) && Scalar.Equal(value1.M24, value2.M24) && - Scalar.Equal(value1.M31, value2.M31) && Scalar.Equal(value1.M32, value2.M32) && - Scalar.Equal(value1.M34, value2.M34) && Scalar.Equal(value1.M41, value2.M41) && - Scalar.Equal(value1.M42, value2.M42) && Scalar.Equal(value1.M43, value2.M43); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix4X4 value1, Matrix4X4 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || Scalar.NotEqual(value1.M22, value2.M22) || - Scalar.NotEqual(value1.M33, value2.M33) || - Scalar.NotEqual(value1.M44, value2.M44) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M14, value2.M14) || Scalar.NotEqual(value1.M21, value2.M21) || - Scalar.NotEqual(value1.M23, value2.M23) || Scalar.NotEqual(value1.M24, value2.M24) || - Scalar.NotEqual(value1.M31, value2.M31) || Scalar.NotEqual(value1.M32, value2.M32) || - Scalar.NotEqual(value1.M34, value2.M34) || Scalar.NotEqual(value1.M41, value2.M41) || - Scalar.NotEqual(value1.M42, value2.M42) || Scalar.NotEqual(value1.M43, value2.M43); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X4 operator *(Matrix4X4 value1, Matrix4X4 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 + value1.M34 * value2.Row4, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 + value1.M43 * value2.Row3 + value1.M44 * value2.Row4 - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - public static unsafe Vector4D operator *(Vector4D value1, Matrix4X4 value2) - { - return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3 + - value1.W * value2.Row4; - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix3X4 operator *(Matrix3X4 value1, Matrix4X4 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 + value1.M34 * value2.Row4 - ); - } - - /// Multiplies a matrix by another matrix. - /// The first source matrix. - /// The second source matrix. - /// The result of the multiplication. - public static unsafe Matrix4X3 operator *(Matrix4X4 value1, Matrix4X3 value2) - { - return new( - value1.M11 * value2.Row1 + value1.M12 * value2.Row2 + value1.M13 * value2.Row3 + value1.M14 * value2.Row4, - value1.M21 * value2.Row1 + value1.M22 * value2.Row2 + value1.M23 * value2.Row3 + value1.M24 * value2.Row4, - value1.M31 * value2.Row1 + value1.M32 * value2.Row2 + value1.M33 * value2.Row3 + value1.M34 * value2.Row4, - value1.M41 * value2.Row1 + value1.M42 * value2.Row2 + value1.M43 * value2.Row3 + value1.M44 * value2.Row4 - ); - } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix4X4 operator *(Matrix4X4 value1, T value2) - { - return new( - value1.Row1 * value2, - value1.Row2 * value2, - value1.Row3 * value2, - value1.Row4 * value2 - ); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix4X4 operator -(Matrix4X4 value1, Matrix4X4 value2) - { - return new( - value1.Row1 - value2.Row1, - value1.Row2 - value2.Row2, - value1.Row3 - value2.Row3, - value1.Row4 - value2.Row4 - ); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); + Row3 = new(value.M31, value.M32, T.One, T.Zero); + Row4 = new(value.M41, value.M42, T.Zero, T.One); } - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix4X4 operator -(Matrix4X4 value) - { - return new( - -value.Row1, - -value.Row2, - -value.Row3, - -value.Row4 - ); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix4X4 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix4X4 other) - => this == other; - /// Calculates the determinant of the matrix. /// The determinant of the matrix. public readonly T GetDeterminant() @@ -530,303 +96,22 @@ public readonly T GetDeterminant() // add: 6 + 8 + 3 = 17 // mul: 12 + 16 = 28 - T a = M11, b = M12, c = M13, d = M14; - T e = M21, f = M22, g = M23, h = M24; - T i = M31, j = M32, k = M33, l = M34; - T m = M41, n = M42, o = M43, p = M44; - - T kp_lo = Scalar.Subtract(Scalar.Multiply(k, p), Scalar.Multiply(l, o)); - T jp_ln = Scalar.Subtract(Scalar.Multiply(j, p), Scalar.Multiply(l, n)); - T jo_kn = Scalar.Subtract(Scalar.Multiply(j, o), Scalar.Multiply(k, n)); - T ip_lm = Scalar.Subtract(Scalar.Multiply(i, p), Scalar.Multiply(l, m)); - T io_km = Scalar.Subtract(Scalar.Multiply(i, o), Scalar.Multiply(k, m)); - T in_jm = Scalar.Subtract(Scalar.Multiply(i, n), Scalar.Multiply(j, m)); - - return Scalar.Add( - Scalar.Subtract( - Scalar.Multiply(a, - Scalar.Add( - Scalar.Subtract(Scalar.Multiply(f, kp_lo), Scalar.Multiply(g, jp_ln)), - Scalar.Multiply(h, jo_kn))), - Scalar.Multiply(b, - Scalar.Add( - Scalar.Subtract(Scalar.Multiply(e, kp_lo), Scalar.Multiply(g, ip_lm)), - Scalar.Multiply(h, io_km)))), - Scalar.Subtract( - Scalar.Multiply(c, - Scalar.Add( - Scalar.Subtract(Scalar.Multiply(e, jp_ln), Scalar.Multiply(f, ip_lm)), - Scalar.Multiply(h, in_jm))), - Scalar.Multiply(d, - Scalar.Add( - Scalar.Subtract(Scalar.Multiply(e, jo_kn), Scalar.Multiply(f, io_km)), - Scalar.Multiply(g, in_jm))))); - } - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - hash.Add(M14); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - hash.Add(M24); - - hash.Add(M31); - hash.Add(M32); - hash.Add(M33); - hash.Add(M34); - - hash.Add(M41); - hash.Add(M42); - hash.Add(M43); - hash.Add(M44); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} {{M41:{12} M42:{13} M43:{14} M44:{15}}} }}", - M11, M12, M13, M14, - M21, M22, M23, M24, - M31, M32, M33, M34, - M41, M42, M43, M44); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix4X4(Matrix4X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix4X4 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As(), Row4.As()); + T a = Row1.X, b = Row1.Y, c = Row1.Z, d = Row1.W; + T e = Row2.X, f = Row2.Y, g = Row2.Z, h = Row2.W; + T i = Row3.X, j = Row3.Y, k = Row3.Z, l = Row3.W; + T m = Row4.X, n = Row4.Y, o = Row4.Z, p = Row4.W; + + T kp_lo = (k * p) - (l * o); + T jp_ln = (j * p) - (l * n); + T jo_kn = (j * o) - (k * n); + T ip_lm = (i * p) - (l * m); + T io_km = (i * o) - (k * m); + T in_jm = (i * n) - (j * m); + + return (a * ((f * kp_lo) - (g * jp_ln) + (h * jo_kn))) + - (b * ((e * kp_lo) - (g * ip_lm) + (h * io_km))) + + ((c * ((e * jp_ln) - (f * ip_lm) + (h * in_jm))) + - (d * ((e * jo_kn) - (f * io_km) + (g * in_jm)))); } } } diff --git a/sources/Maths/Maths/Matrix4X4.gen.cs b/sources/Maths/Maths/Matrix4X4.gen.cs new file mode 100644 index 0000000000..53c9fb4eb6 --- /dev/null +++ b/sources/Maths/Maths/Matrix4X4.gen.cs @@ -0,0 +1,670 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 4x4 matrix. + [Serializable] + [DataContract] + public partial struct Matrix4X4 : + IEquatable> + where T : INumberBase + { + /// Gets the multiplicative identity matrix of size 4x4. + public static Matrix4X4 Identity { get; } = new( + new(T.One, T.Zero, T.Zero, T.Zero), + new(T.Zero, T.One, T.Zero, T.Zero), + new(T.Zero, T.Zero, T.One, T.Zero), + new(T.Zero, T.Zero, T.Zero, T.One)); + + /// Returns whether the matrix is the identity matrix. + [IgnoreDataMember] + public readonly bool IsIdentity => this == Identity; + + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row3; + + /// The 4th row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row4; + + /// The 1st column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column1 => new(Row1.X, Row2.X, Row3.X, Row4.X); + + /// The 2nd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column2 => new(Row1.Y, Row2.Y, Row3.Y, Row4.Y); + + /// The 3rd column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column3 => new(Row1.Z, Row2.Z, Row3.Z, Row4.Z); + + /// The 4th column of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Column4 => new(Row1.W, Row2.W, Row3.W, Row4.W); + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 1st row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M14 => ref Row1.W; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// Gets the element in the 2nd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M24 => ref Row2.W; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// Gets the element in the 3rd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M33 => ref Row3.Z; + + /// Gets the element in the 3rd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M34 => ref Row3.W; + + /// Gets the element in the 4th row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M41 => ref Row4.X; + + /// Gets the element in the 4th row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M42 => ref Row4.Y; + + /// Gets the element in the 4th row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M43 => ref Row4.Z; + + /// Gets the element in the 4th row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M44 => ref Row4.W; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector4D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + case 3: + return ref Row4; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix4X4(Vector4D row1, Vector4D row2, Vector4D row3, Vector4D row4) => + (Row1, Row2, Row3, Row4) = (row1, row2, row3, row4); + + /// Constructs a from the given components. + public Matrix4X4( + T m11, T m12, T m13, T m14, + T m21, T m22, T m23, T m24, + T m31, T m32, T m33, T m34, + T m41, T m42, T m43, T m44) + { + Row1 = new(m11, m12, m13, m14); + Row2 = new(m21, m22, m23, m24); + Row3 = new(m31, m32, m33, m34); + Row4 = new(m41, m42, m43, m44); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} {{M41:{12} M42:{13} M43:{14} M44:{15}}} }}", + Row1.X, Row1.Y, Row1.Z, Row1.W, + Row2.X, Row2.Y, Row2.Z, Row2.W, + Row3.X, Row3.Y, Row3.Z, Row3.W, + Row4.X, Row4.Y, Row4.Z, Row4.W); + + /// + public override bool Equals(object? obj) => obj is Matrix4X4 other && Equals(other); + + /// + public bool Equals(Matrix4X4 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3, Row4); + + /// Converts the components of this matrix to another type. + public static Matrix4X4 CreateChecked(Matrix4X4 other) + where TOther : INumberBase => + new(Vector4D.CreateChecked(other.Row1), Vector4D.CreateChecked(other.Row2), Vector4D.CreateChecked(other.Row3), Vector4D.CreateChecked(other.Row4)); + + /// Converts the components of this matrix to another type. + public static Matrix4X4 CreateSaturating(Matrix4X4 other) + where TOther : INumberBase => + new(Vector4D.CreateSaturating(other.Row1), Vector4D.CreateSaturating(other.Row2), Vector4D.CreateSaturating(other.Row3), Vector4D.CreateSaturating(other.Row4)); + + /// Converts the components of this matrix to another type. + public static Matrix4X4 CreateTruncating(Matrix4X4 other) + where TOther : INumberBase => + new(Vector4D.CreateTruncating(other.Row1), Vector4D.CreateTruncating(other.Row2), Vector4D.CreateTruncating(other.Row3), Vector4D.CreateTruncating(other.Row4)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix4X4 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As(), Row4.As()); + + /// Converts the components of this matrix to another type. + public Matrix4X4 AsChecked() + where TOther : INumberBase => + Matrix4X4.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix4X4 AsSaturating() + where TOther : INumberBase => + Matrix4X4.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix4X4 AsTruncating() + where TOther : INumberBase => + Matrix4X4.CreateTruncating(this); + + /// Computes the transpose of the matrix. + public Matrix4X4 Transpose() => + new(Column1, + Column2, + Column3, + Column4); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix4X4 left, Matrix4X4 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3 && + left.Row4 == right.Row4; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix4X4 left, Matrix4X4 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix4X4 operator +(Matrix4X4 left, Matrix4X4 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3, + left.Row4 + right.Row4); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix4X4 operator -(Matrix4X4 left, Matrix4X4 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3, + left.Row4 - right.Row4); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix4X4 operator -(Matrix4X4 value) => + new(-value.Row1, + -value.Row2, + -value.Row3, + -value.Row4); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix4X4 operator *(T left, Matrix4X4 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3, + left * right.Row4); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix4X4 operator *(Matrix4X4 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right, + left.Row4 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix, expressed as a row vector. + /// The second source matrix. + /// The result of the multiplication as a column vector. + public static Vector4D operator *(Vector4D rowVector, Matrix4X4 matrix) => + rowVector.X * matrix.Row1 + rowVector.Y * matrix.Row2 + rowVector.Z * matrix.Row3 + rowVector.W * matrix.Row4; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix, expressed as a column vector. + /// The result of the multiplication as a row vector. + public static Vector4D operator *(Matrix4X4 matrix, Vector4D columnVector) => + matrix.Column1 * columnVector.X + matrix.Column2 * columnVector.Y + matrix.Column3 * columnVector.Z + matrix.Column4 * columnVector.W; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix2X4 operator *(Matrix2X4 left, Matrix4X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix3X4 operator *(Matrix3X4 left, Matrix4X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X2 operator *(Matrix4X4 left, Matrix4X2 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3 + left.M44 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X3 operator *(Matrix4X4 left, Matrix4X3 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3 + left.M44 * right.Row4); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix4X4 operator *(Matrix4X4 left, Matrix4X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3 + left.M44 * right.Row4); + + /// Converts a to a . + public static explicit operator Matrix4X4(Matrix4x4 from) => + new(T.CreateTruncating(from.M11), T.CreateTruncating(from.M12), T.CreateTruncating(from.M13), T.CreateTruncating(from.M14), + T.CreateTruncating(from.M21), T.CreateTruncating(from.M22), T.CreateTruncating(from.M23), T.CreateTruncating(from.M24), + T.CreateTruncating(from.M31), T.CreateTruncating(from.M32), T.CreateTruncating(from.M33), T.CreateTruncating(from.M34), + T.CreateTruncating(from.M41), T.CreateTruncating(from.M42), T.CreateTruncating(from.M43), T.CreateTruncating(from.M44)); + + /// Converts a to a . + public static explicit operator checked Matrix4X4(Matrix4x4 from) => + new(T.CreateChecked(from.M11), T.CreateChecked(from.M12), T.CreateChecked(from.M13), T.CreateChecked(from.M14), + T.CreateChecked(from.M21), T.CreateChecked(from.M22), T.CreateChecked(from.M23), T.CreateChecked(from.M24), + T.CreateChecked(from.M31), T.CreateChecked(from.M32), T.CreateChecked(from.M33), T.CreateChecked(from.M34), + T.CreateChecked(from.M41), T.CreateChecked(from.M42), T.CreateChecked(from.M43), T.CreateChecked(from.M44)); + + /// Converts a to . + public static explicit operator Matrix4x4(Matrix4X4 from) => + new(float.CreateTruncating(from.M11), float.CreateTruncating(from.M12), float.CreateTruncating(from.M13), float.CreateTruncating(from.M14), + float.CreateTruncating(from.M21), float.CreateTruncating(from.M22), float.CreateTruncating(from.M23), float.CreateTruncating(from.M24), + float.CreateTruncating(from.M31), float.CreateTruncating(from.M32), float.CreateTruncating(from.M33), float.CreateTruncating(from.M34), + float.CreateTruncating(from.M41), float.CreateTruncating(from.M42), float.CreateTruncating(from.M43), float.CreateTruncating(from.M44)); + + /// Converts a to . + public static explicit operator checked Matrix4x4(Matrix4X4 from) => + new(float.CreateChecked(from.M11), float.CreateChecked(from.M12), float.CreateChecked(from.M13), float.CreateChecked(from.M14), + float.CreateChecked(from.M21), float.CreateChecked(from.M22), float.CreateChecked(from.M23), float.CreateChecked(from.M24), + float.CreateChecked(from.M31), float.CreateChecked(from.M32), float.CreateChecked(from.M33), float.CreateChecked(from.M34), + float.CreateChecked(from.M41), float.CreateChecked(from.M42), float.CreateChecked(from.M43), float.CreateChecked(from.M44)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix4X4(Matrix4X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4)); + } +} diff --git a/sources/Maths/Maths/Matrix5X4.Ops.cs b/sources/Maths/Maths/Matrix5X4.Ops.cs index 18fe708f4e..65c6170be8 100644 --- a/sources/Maths/Maths/Matrix5X4.Ops.cs +++ b/sources/Maths/Maths/Matrix5X4.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -9,69 +10,15 @@ namespace Silk.NET.Maths /// /// Methods for working with /// - public static class Matrix5X4 + public static partial class Matrix5X4 { - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix5X4 Add(Matrix5X4 value1, Matrix5X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return value1 + value2; - } - /// Multiplies a vector by a matrix. /// The vector. /// The matrix. /// The result of the multiplication. [MethodImpl((MethodImplOptions) 768)] public static Vector4D Multiply(Vector4D value1, Matrix5X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix5X4 Multiply(Matrix5X4 value1, T value2) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase => value1 * value2; - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix5X4 Negate(Matrix5X4 value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Matrix5X4 Subtract(Matrix5X4 value1, Matrix5X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 - value2; - - /// Linearly interpolates between the corresponding values of two matrices. - /// The first source matrix. - /// The second source matrix. - /// The relative weight of the second source matrix. - /// The interpolated matrix. - public static unsafe Matrix5X4 Lerp(Matrix5X4 matrix1, Matrix5X4 matrix2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Vector4D.Lerp(matrix1.Row1, matrix2.Row1, amount), - Vector4D.Lerp(matrix1.Row2, matrix2.Row2, amount), - Vector4D.Lerp(matrix1.Row3, matrix2.Row3, amount), - Vector4D.Lerp(matrix1.Row4, matrix2.Row4, amount), - Vector4D.Lerp(matrix1.Row5, matrix2.Row5, amount) - ); - } } } diff --git a/sources/Maths/Maths/Matrix5X4.Ops.gen.cs b/sources/Maths/Maths/Matrix5X4.Ops.gen.cs new file mode 100644 index 0000000000..bbe6b3776e --- /dev/null +++ b/sources/Maths/Maths/Matrix5X4.Ops.gen.cs @@ -0,0 +1,73 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Matrix5X4 + { + /// Linearly interpolates between the corresponding values of two matrices. + /// The first source matrix. + /// The second source matrix. + /// The relative weight of the second source matrix. + /// The interpolated matrix. + public static Matrix5X4 Lerp(Matrix5X4 value1, Matrix5X4 value2, T amount) + where T : IFloatingPointIeee754 => + new(Vector4D.Lerp(value1.Row1, value2.Row1, amount), + Vector4D.Lerp(value1.Row2, value2.Row2, amount), + Vector4D.Lerp(value1.Row3, value2.Row3, amount), + Vector4D.Lerp(value1.Row4, value2.Row4, amount), + Vector4D.Lerp(value1.Row5, value2.Row5, amount)); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix5X4 Add(Matrix5X4 left, Matrix5X4 right) + where T : INumberBase => + left + right; + + /// Returns a negated copy of the specified matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix5X4 Negate(Matrix5X4 value) + where T : INumberBase => + -value; + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix5X4 Subtract(Matrix5X4 left, Matrix5X4 right) + where T : INumberBase => + left - right; + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix5X4 Multiply(Matrix5X4 left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix5X4 Multiply(T left, Matrix5X4 right) + where T : INumberBase => + left * right; + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix5X4 Multiply(Matrix5X4 left, Matrix4X4 right) + where T : INumberBase => + left * right; + } +} diff --git a/sources/Maths/Maths/Matrix5X4.cs b/sources/Maths/Maths/Matrix5X4.cs index 348ba77941..0d007466eb 100644 --- a/sources/Maths/Maths/Matrix5X4.cs +++ b/sources/Maths/Maths/Matrix5X4.cs @@ -1,304 +1,28 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Globalization; -using System.Runtime.CompilerServices; using System.Runtime.Serialization; namespace Silk.NET.Maths { - /// A structure encapsulating a 4x4 matrix. - [Serializable] - [DataContract] - public struct Matrix5X4 : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Matrix5X4 { private static readonly Matrix5X4 _identity = new ( - Scalar.One, Scalar.Zero, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.One, Scalar.Zero, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.One, Scalar.Zero, - Scalar.Zero, Scalar.Zero, Scalar.Zero, Scalar.One, - Scalar.Zero, Scalar.Zero, Scalar.Zero, Scalar.Zero + T.One, T.Zero, T.Zero, T.Zero, + T.Zero, T.One, T.Zero, T.Zero, + T.Zero, T.Zero, T.One, T.Zero, + T.Zero, T.Zero, T.Zero, T.One, + T.Zero, T.Zero, T.Zero, T.Zero ); - /// - /// Row 1 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row1; - - /// - /// Row 2 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row2; - - /// - /// Row 3 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row3; - - /// - /// Row 4 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row4; - - /// - /// Row 5 of the matrix. - /// - [IgnoreDataMember] - public Vector4D Row5; - - /// Value at row 1, column 1 of the matrix. - [DataMember] - public T M11 - { - readonly get => Row1.X; - set => Row1.X = value; - } - - /// Value at row 1, column 2 of the matrix. - [DataMember] - public T M12 - { - readonly get => Row1.Y; - set => Row1.Y = value; - } - - /// Value at row 1, column 3 of the matrix. - [DataMember] - public T M13 - { - readonly get => Row1.Z; - set => Row1.Z = value; - } - - /// Value at row 1, column 4 of the matrix. - [DataMember] - public T M14 - { - readonly get => Row1.W; - set => Row1.W = value; - } - - /// Value at row 2, column 1 of the matrix. - [DataMember] - public T M21 - { - readonly get => Row2.X; - set => Row2.X = value; - } - - /// Value at row 2, column 2 of the matrix. - [DataMember] - public T M22 - { - readonly get => Row2.Y; - set => Row2.Y = value; - } - - /// Value at row 2, column 3 of the matrix. - [DataMember] - public T M23 - { - readonly get => Row2.Z; - set => Row2.Z = value; - } - - /// Value at row 2, column 4 of the matrix. - [DataMember] - public T M24 - { - readonly get => Row2.W; - set => Row2.W = value; - } - - /// Value at row 3, column 1 of the matrix. - [DataMember] - public T M31 - { - readonly get => Row3.X; - set => Row3.X = value; - } - - /// Value at row 3, column 2 of the matrix. - [DataMember] - public T M32 - { - readonly get => Row3.Y; - set => Row3.Y = value; - } - - /// Value at row 3, column 3 of the matrix. - [DataMember] - public T M33 - { - readonly get => Row3.Z; - set => Row3.Z = value; - } - - /// Value at row 3, column 4 of the matrix. - [DataMember] - public T M34 - { - readonly get => Row3.W; - set => Row3.W = value; - } - - /// Value at row 4, column 1 of the matrix. - [DataMember] - public T M41 - { - readonly get => Row4.X; - set => Row4.X = value; - } - - /// Value at row 4, column 2 of the matrix. - [DataMember] - public T M42 - { - readonly get => Row4.Y; - set => Row4.Y = value; - } - - /// Value at row 4, column 3 of the matrix. - [DataMember] - public T M43 - { - readonly get => Row4.Z; - set => Row4.Z = value; - } - - /// Value at row 4, column 4 of the matrix. - [DataMember] - public T M44 - { - readonly get => Row4.W; - set => Row4.W = value; - } - - /// Value at row 5, column 1 of the matrix. - [DataMember] - public T M51 - { - readonly get => Row5.X; - set => Row5.X = value; - } - - /// Value at row 5, column 2 of the matrix. - [DataMember] - public T M52 - { - readonly get => Row5.Y; - set => Row5.Y = value; - } - - /// Value at row 5, column 3 of the matrix. - [DataMember] - public T M53 - { - readonly get => Row5.Z; - set => Row5.Z = value; - } - - /// Value at row 5, column 4 of the matrix. - [DataMember] - public T M54 - { - readonly get => Row5.W; - set => Row5.W = value; - } - - /// - /// Indexer for the rows of this matrix. - /// - /// The row to select. Zero based. - public unsafe Vector4D this[int x] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 4 || i < 0) - ThrowHelper(); - } - - VerifyBounds(x); - return Unsafe.Add(ref Row1, x); - } - } - - /// - /// Indexer for the values in this matrix. - /// - /// The row to select. Zero based. - /// The column to select. Zero based. - public unsafe T this[int x, int y] - { - get - { - var row = this[x]; - return row[y]; - } - } - - /// - /// Constructs a from the given rows - /// - public Matrix5X4(Vector4D row1, Vector4D row2, Vector4D row3, Vector4D row4, Vector4D row5) - { - Row1 = row1; - Row2 = row2; - Row3 = row3; - Row4 = row4; - Row5 = row5; - } - - /// Constructs a from the given components. - public Matrix5X4 - ( - T m11, - T m12, - T m13, - T m14, - T m21, - T m22, - T m23, - T m24, - T m31, - T m32, - T m33, - T m34, - T m41, - T m42, - T m43, - T m44, - T m51, - T m52, - T m53, - T m54 - ) - { - Row1 = new(m11, m12, m13, m14); - Row2 = new(m21, m22, m23, m24); - Row3 = new(m31, m32, m33, m34); - Row4 = new(m41, m42, m43, m44); - Row5 = new(m51, m52, m53, m54); - } - /// Constructs a from the given . /// The source . public Matrix5X4(Matrix3X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); - Row5 = new(value.M31, value.M32, default, default); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); + Row5 = new(value.M31, value.M32, T.Zero, T.Zero); Row3 = Vector4D.UnitZ; Row4 = Vector4D.UnitW; } @@ -318,10 +42,10 @@ public Matrix5X4(Matrix4X4 value) /// The source . public Matrix5X4(Matrix4X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); - Row3 = new(value.M31, value.M32, value.M33, default); - Row4 = new(value.M41, value.M42, value.M43, Scalar.One); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); + Row3 = new(value.M31, value.M32, value.M33, T.Zero); + Row4 = new(value.M41, value.M42, value.M43, T.One); Row5 = default; } @@ -340,9 +64,9 @@ public Matrix5X4(Matrix3X4 value) /// The source . public Matrix5X4(Matrix3X3 value) { - Row1 = new(value.M11, value.M12, value.M13, default); - Row2 = new(value.M21, value.M22, value.M23, default); - Row5 = new(value.M31, value.M32, value.M33, default); + Row1 = new(value.M11, value.M12, value.M13, T.Zero); + Row2 = new(value.M21, value.M22, value.M23, T.Zero); + Row5 = new(value.M31, value.M32, value.M33, T.Zero); Row3 = Vector4D.UnitZ; Row4 = Vector4D.UnitW; } @@ -362,10 +86,10 @@ public Matrix5X4(Matrix2X4 value) /// The source . public Matrix5X4(Matrix4X2 value) { - Row1 = new(value.M11, value.M12, default, default); - Row2 = new(value.M21, value.M22, default, default); - Row3 = new(value.M31, value.M32, Scalar.One, default); - Row4 = new(value.M41, value.M42, default, Scalar.One); + Row1 = new(value.M11, value.M12, T.Zero, T.Zero); + Row2 = new(value.M21, value.M22, T.Zero, T.Zero); + Row3 = new(value.M31, value.M32, T.One, T.Zero); + Row4 = new(value.M41, value.M42, T.Zero, T.One); Row5 = default; } @@ -374,69 +98,7 @@ public Matrix5X4(Matrix4X2 value) /// Returns whether the matrix is the identity matrix. [IgnoreDataMember] - public readonly bool IsIdentity - => Scalar.Equal(M11, Scalar.One) && Scalar.Equal(M22, Scalar.One) && - Scalar.Equal(M33, Scalar.One) && - Scalar.Equal(M44, Scalar.One) && // Check diagonal element first for early out. - Scalar.Equal(M12, Scalar.Zero) && Scalar.Equal(M13, Scalar.Zero) && - Scalar.Equal(M14, Scalar.Zero) && Scalar.Equal(M21, Scalar.Zero) && - Scalar.Equal(M23, Scalar.Zero) && Scalar.Equal(M24, Scalar.Zero) && - Scalar.Equal(M31, Scalar.Zero) && Scalar.Equal(M32, Scalar.Zero) && - Scalar.Equal(M34, Scalar.Zero) && Scalar.Equal(M41, Scalar.Zero) && - Scalar.Equal(M42, Scalar.Zero) && Scalar.Equal(M43, Scalar.Zero) && - Scalar.Equal(M51, Scalar.Zero) && Scalar.Equal(M52, Scalar.Zero) && - Scalar.Equal(M53, Scalar.Zero) && Scalar.Equal(M54, Scalar.Zero); - - /// Adds two matrices together. - /// The first source matrix. - /// The second source matrix. - /// The resulting matrix. - public static unsafe Matrix5X4 operator +(Matrix5X4 value1, Matrix5X4 value2) - { - return new - ( - value1.Row1 + value2.Row1, value1.Row2 + value2.Row2, value1.Row3 + value2.Row3, - value1.Row4 + value2.Row4, value1.Row5 + value2.Row5 - ); - } - - /// Returns a boolean indicating whether the given two matrices are equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are equal; False otherwise. - public static unsafe bool operator ==(Matrix5X4 value1, Matrix5X4 value2) - { - return Scalar.Equal(value1.M11, value2.M11) && Scalar.Equal(value1.M22, value2.M22) && - Scalar.Equal(value1.M33, value2.M33) && - Scalar.Equal(value1.M44, value2.M44) && // Check diagonal elements first for early out. - Scalar.Equal(value1.M12, value2.M12) && Scalar.Equal(value1.M13, value2.M13) && - Scalar.Equal(value1.M14, value2.M14) && Scalar.Equal(value1.M21, value2.M21) && - Scalar.Equal(value1.M23, value2.M23) && Scalar.Equal(value1.M24, value2.M24) && - Scalar.Equal(value1.M31, value2.M31) && Scalar.Equal(value1.M32, value2.M32) && - Scalar.Equal(value1.M34, value2.M34) && Scalar.Equal(value1.M41, value2.M41) && - Scalar.Equal(value1.M42, value2.M42) && Scalar.Equal(value1.M43, value2.M43) && - Scalar.Equal(value1.M51, value2.M51) && Scalar.Equal(value1.M52, value2.M52) && - Scalar.Equal(value1.M53, value2.M53) && Scalar.Equal(value1.M54, value2.M54); - } - - /// Returns a boolean indicating whether the given two matrices are not equal. - /// The first matrix to compare. - /// The second matrix to compare. - /// True if the given matrices are not equal; False if they are equal. - public static unsafe bool operator !=(Matrix5X4 value1, Matrix5X4 value2) - { - return Scalar.NotEqual(value1.M11, value2.M11) || Scalar.NotEqual(value1.M22, value2.M22) || - Scalar.NotEqual(value1.M33, value2.M33) || - Scalar.NotEqual(value1.M44, value2.M44) || // Check diagonal elements first for early out. - Scalar.NotEqual(value1.M12, value2.M12) || Scalar.NotEqual(value1.M13, value2.M13) || - Scalar.NotEqual(value1.M14, value2.M14) || Scalar.NotEqual(value1.M21, value2.M21) || - Scalar.NotEqual(value1.M23, value2.M23) || Scalar.NotEqual(value1.M24, value2.M24) || - Scalar.NotEqual(value1.M31, value2.M31) || Scalar.NotEqual(value1.M32, value2.M32) || - Scalar.NotEqual(value1.M34, value2.M34) || Scalar.NotEqual(value1.M41, value2.M41) || - Scalar.NotEqual(value1.M42, value2.M42) || Scalar.NotEqual(value1.M43, value2.M43) || - Scalar.NotEqual(value1.M51, value2.M51) || Scalar.NotEqual(value1.M52, value2.M52) || - Scalar.NotEqual(value1.M53, value2.M53) || Scalar.NotEqual(value1.M54, value2.M54); - } + public readonly bool IsIdentity => this == Identity; /// Multiplies a vector by a matrix. /// The vector. @@ -447,358 +109,5 @@ public readonly bool IsIdentity return value1.X * value2.Row1 + value1.Y * value2.Row2 + value1.Z * value2.Row3 + value1.W * value2.Row4 + value2.Row5; } - - /// Multiplies a matrix by a scalar value. - /// The source matrix. - /// The scaling factor. - /// The scaled matrix. - public static unsafe Matrix5X4 operator *(Matrix5X4 value1, T value2) - { - return new( - value1.Row1 * value2, - value1.Row2 * value2, - value1.Row3 * value2, - value1.Row4 * value2, - value1.Row5 * value2 - ); - } - - /// Subtracts the second matrix from the first. - /// The first source matrix. - /// The second source matrix. - /// The result of the subtraction. - public static unsafe Matrix5X4 operator -(Matrix5X4 value1, Matrix5X4 value2) - { - return new( - value1.Row1 - value2.Row1, - value1.Row2 - value2.Row2, - value1.Row3 - value2.Row3, - value1.Row4 - value2.Row4, - value1.Row5 - value2.Row5 - ); - } - - /// Returns a new matrix with the negated elements of the given matrix. - /// The source matrix. - /// The negated matrix. - public static unsafe Matrix5X4 operator -(Matrix5X4 value) - { - return new( - -value.Row1, - -value.Row2, - -value.Row3, - -value.Row4, - -value.Row5 - ); - } - - /// Returns a boolean indicating whether the given Object is equal to this matrix instance. - /// The Object to compare against. - /// True if the Object is equal to this matrix; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Matrix5X4 other) && Equals(other); - - /// Returns a boolean indicating whether this matrix instance is equal to the other given matrix. - /// The matrix to compare this instance to. - /// True if the matrices are equal; False otherwise. - public readonly bool Equals(Matrix5X4 other) - => this == other; - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - HashCode hash = default; - - hash.Add(M11); - hash.Add(M12); - hash.Add(M13); - hash.Add(M14); - - hash.Add(M21); - hash.Add(M22); - hash.Add(M23); - hash.Add(M24); - - hash.Add(M31); - hash.Add(M32); - hash.Add(M33); - hash.Add(M34); - - hash.Add(M41); - hash.Add(M42); - hash.Add(M43); - hash.Add(M44); - - hash.Add(M51); - hash.Add(M52); - hash.Add(M53); - hash.Add(M54); - - return hash.ToHashCode(); - } - - /// Returns a String representing this matrix instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} {{M41:{12} M42:{13} M43:{14} M44:{15}}} {{M51:{16} M52:{17} M53:{18} M54:{19}}} }}", - M11, M12, M13, M14, - M21, M22, M23, M24, - M31, M32, M33, M34, - M41, M42, M43, M44, - M51, M52, M53, M54); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Matrix5X4(Matrix5X4 from) - => new - ( - Scalar.As(from.M11), Scalar.As(from.M12), - Scalar.As(from.M13), Scalar.As(from.M14), - Scalar.As(from.M21), Scalar.As(from.M22), - Scalar.As(from.M23), Scalar.As(from.M24), - Scalar.As(from.M31), Scalar.As(from.M32), - Scalar.As(from.M33), Scalar.As(from.M34), - Scalar.As(from.M41), Scalar.As(from.M42), - Scalar.As(from.M43), Scalar.As(from.M44), - Scalar.As(from.M51), Scalar.As(from.M52), - Scalar.As(from.M53), Scalar.As(from.M54) - ); - - /// - /// Returns this matrix casted to - /// - /// The type to cast to - /// The casted matrix - public Matrix5X4 As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Row1.As(), Row2.As(), Row3.As(), Row4.As(), Row5.As()); - } } } diff --git a/sources/Maths/Maths/Matrix5X4.gen.cs b/sources/Maths/Maths/Matrix5X4.gen.cs new file mode 100644 index 0000000000..4a2161dc38 --- /dev/null +++ b/sources/Maths/Maths/Matrix5X4.gen.cs @@ -0,0 +1,617 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.Serialization; + + /// A structure encapsulating a 5x4 matrix. + [Serializable] + [DataContract] + public partial struct Matrix5X4 : + IEquatable> + where T : INumberBase + { + /// The 1st row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row1; + + /// The 2nd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row2; + + /// The 3rd row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row3; + + /// The 4th row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row4; + + /// The 5th row of the matrix represented as a vector. + [IgnoreDataMember] + public Vector4D Row5; + + /// Gets the element in the 1st row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M11 => ref Row1.X; + + /// Gets the element in the 1st row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M12 => ref Row1.Y; + + /// Gets the element in the 1st row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M13 => ref Row1.Z; + + /// Gets the element in the 1st row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M14 => ref Row1.W; + + /// Gets the element in the 2nd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M21 => ref Row2.X; + + /// Gets the element in the 2nd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M22 => ref Row2.Y; + + /// Gets the element in the 2nd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M23 => ref Row2.Z; + + /// Gets the element in the 2nd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M24 => ref Row2.W; + + /// Gets the element in the 3rd row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M31 => ref Row3.X; + + /// Gets the element in the 3rd row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M32 => ref Row3.Y; + + /// Gets the element in the 3rd row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M33 => ref Row3.Z; + + /// Gets the element in the 3rd row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M34 => ref Row3.W; + + /// Gets the element in the 4th row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M41 => ref Row4.X; + + /// Gets the element in the 4th row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M42 => ref Row4.Y; + + /// Gets the element in the 4th row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M43 => ref Row4.Z; + + /// Gets the element in the 4th row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M44 => ref Row4.W; + + /// Gets the element in the 5th row and 1st column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M51 => ref Row5.X; + + /// Gets the element in the 5th row and 2nd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M52 => ref Row5.Y; + + /// Gets the element in the 5th row and 3rd column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M53 => ref Row5.Z; + + /// Gets the element in the 5th row and 4th column of the matrix. + [DataMember] + [UnscopedRef] + public ref T M54 => ref Row5.W; + + /// + /// Indexer for the rows of this matrix. + /// + /// The row to select. Zero based. + [UnscopedRef] + public ref Vector4D this[int row] + { + get + { + switch (row) + { + case 0: + return ref Row1; + case 1: + return ref Row2; + case 2: + return ref Row3; + case 3: + return ref Row4; + case 4: + return ref Row5; + } + + throw new IndexOutOfRangeException(); + } + } + + /// + /// Indexer for the values in this matrix. + /// + /// The row to select. Zero based. + /// The column to select. Zero based. + [UnscopedRef] + public ref T this[int row, int column] => ref this[row][column]; + + /// Constructs a from the given rows. + public Matrix5X4(Vector4D row1, Vector4D row2, Vector4D row3, Vector4D row4, Vector4D row5) => + (Row1, Row2, Row3, Row4, Row5) = (row1, row2, row3, row4, row5); + + /// Constructs a from the given components. + public Matrix5X4( + T m11, T m12, T m13, T m14, + T m21, T m22, T m23, T m24, + T m31, T m32, T m33, T m34, + T m41, T m42, T m43, T m44, + T m51, T m52, T m53, T m54) + { + Row1 = new(m11, m12, m13, m14); + Row2 = new(m21, m22, m23, m24); + Row3 = new(m31, m32, m33, m34); + Row4 = new(m41, m42, m43, m44); + Row5 = new(m51, m52, m53, m54); + } + + /// + public override string ToString() => + string.Format( + "{{ {{M11:{0} M12:{1} M13:{2} M14:{3}}} {{M21:{4} M22:{5} M23:{6} M24:{7}}} {{M31:{8} M32:{9} M33:{10} M34:{11}}} {{M41:{12} M42:{13} M43:{14} M44:{15}}} {{M51:{16} M52:{17} M53:{18} M54:{19}}} }}", + Row1.X, Row1.Y, Row1.Z, Row1.W, + Row2.X, Row2.Y, Row2.Z, Row2.W, + Row3.X, Row3.Y, Row3.Z, Row3.W, + Row4.X, Row4.Y, Row4.Z, Row4.W, + Row5.X, Row5.Y, Row5.Z, Row5.W); + + /// + public override bool Equals(object? obj) => obj is Matrix5X4 other && Equals(other); + + /// + public bool Equals(Matrix5X4 other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(Row1, Row2, Row3, Row4, Row5); + + /// Converts the components of this matrix to another type. + public static Matrix5X4 CreateChecked(Matrix5X4 other) + where TOther : INumberBase => + new(Vector4D.CreateChecked(other.Row1), Vector4D.CreateChecked(other.Row2), Vector4D.CreateChecked(other.Row3), Vector4D.CreateChecked(other.Row4), Vector4D.CreateChecked(other.Row5)); + + /// Converts the components of this matrix to another type. + public static Matrix5X4 CreateSaturating(Matrix5X4 other) + where TOther : INumberBase => + new(Vector4D.CreateSaturating(other.Row1), Vector4D.CreateSaturating(other.Row2), Vector4D.CreateSaturating(other.Row3), Vector4D.CreateSaturating(other.Row4), Vector4D.CreateSaturating(other.Row5)); + + /// Converts the components of this matrix to another type. + public static Matrix5X4 CreateTruncating(Matrix5X4 other) + where TOther : INumberBase => + new(Vector4D.CreateTruncating(other.Row1), Vector4D.CreateTruncating(other.Row2), Vector4D.CreateTruncating(other.Row3), Vector4D.CreateTruncating(other.Row4), Vector4D.CreateTruncating(other.Row5)); + + /// Converts the components of this matrix to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Matrix5X4 As() + where TOther : INumberBase => + new(Row1.As(), Row2.As(), Row3.As(), Row4.As(), Row5.As()); + + /// Converts the components of this matrix to another type. + public Matrix5X4 AsChecked() + where TOther : INumberBase => + Matrix5X4.CreateChecked(this); + + /// Converts the components of this matrix to another type. + public Matrix5X4 AsSaturating() + where TOther : INumberBase => + Matrix5X4.CreateSaturating(this); + + /// Converts the components of this matrix to another type. + public Matrix5X4 AsTruncating() + where TOther : INumberBase => + Matrix5X4.CreateTruncating(this); + + /// Returns a boolean indicating whether the given two matrices are equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are equal; false otherwise. + public static bool operator ==(Matrix5X4 left, Matrix5X4 right) => + left.Row1 == right.Row1 && + left.Row2 == right.Row2 && + left.Row3 == right.Row3 && + left.Row4 == right.Row4 && + left.Row5 == right.Row5; + + /// Returns a boolean indicating whether the given two matrices are not equal. + /// The first matrix to compare. + /// The second matrix to compare. + /// true if the given matrices are not equal; false otherwise. + public static bool operator !=(Matrix5X4 left, Matrix5X4 right) => !(left == right); + + /// Adds two matrices together. + /// The first source matrix. + /// The second source matrix. + /// The result of the addition. + public static Matrix5X4 operator +(Matrix5X4 left, Matrix5X4 right) => + new(left.Row1 + right.Row1, + left.Row2 + right.Row2, + left.Row3 + right.Row3, + left.Row4 + right.Row4, + left.Row5 + right.Row5); + + /// Subtracts the second matrix from the first. + /// The first source matrix. + /// The second source matrix. + /// The result of the subtraction. + public static Matrix5X4 operator -(Matrix5X4 left, Matrix5X4 right) => + new(left.Row1 - right.Row1, + left.Row2 - right.Row2, + left.Row3 - right.Row3, + left.Row4 - right.Row4, + left.Row5 - right.Row5); + + /// Returns a new matrix with the negated elements of the given matrix. + /// The source matrix. + /// The negated matrix. + public static Matrix5X4 operator -(Matrix5X4 value) => + new(-value.Row1, + -value.Row2, + -value.Row3, + -value.Row4, + -value.Row5); + + /// Multiplies a matrix by a scalar value. + /// The scaling factor. + /// The source matrix. + /// The scaled matrix. + public static Matrix5X4 operator *(T left, Matrix5X4 right) => + new(left * right.Row1, + left * right.Row2, + left * right.Row3, + left * right.Row4, + left * right.Row5); + + /// Multiplies a matrix by a scalar value. + /// The source matrix. + /// The scaling factor. + /// The scaled matrix. + public static Matrix5X4 operator *(Matrix5X4 left, T right) => + new(left.Row1 * right, + left.Row2 * right, + left.Row3 * right, + left.Row4 * right, + left.Row5 * right); + + /// Multiplies a matrix by another matrix. + /// The first source matrix. + /// The second source matrix. + /// The result of the multiplication. + public static Matrix5X4 operator *(Matrix5X4 left, Matrix4X4 right) => + new(left.M11 * right.Row1 + left.M12 * right.Row2 + left.M13 * right.Row3 + left.M14 * right.Row4, + left.M21 * right.Row1 + left.M22 * right.Row2 + left.M23 * right.Row3 + left.M24 * right.Row4, + left.M31 * right.Row1 + left.M32 * right.Row2 + left.M33 * right.Row3 + left.M34 * right.Row4, + left.M41 * right.Row1 + left.M42 * right.Row2 + left.M43 * right.Row3 + left.M44 * right.Row4, + left.M51 * right.Row1 + left.M52 * right.Row2 + left.M53 * right.Row3 + left.M54 * right.Row4); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateTruncating(from.Row1), + Vector4D.CreateTruncating(from.Row2), + Vector4D.CreateTruncating(from.Row3), + Vector4D.CreateTruncating(from.Row4), + Vector4D.CreateTruncating(from.Row5)); + + /// + /// Converts a matrix of into one with an underlying type of . + /// + /// The source matrix. + /// The matrix. + public static explicit operator checked Matrix5X4(Matrix5X4 from) => + new(Vector4D.CreateChecked(from.Row1), + Vector4D.CreateChecked(from.Row2), + Vector4D.CreateChecked(from.Row3), + Vector4D.CreateChecked(from.Row4), + Vector4D.CreateChecked(from.Row5)); + } +} diff --git a/sources/Maths/Maths/Plane.Ops.cs b/sources/Maths/Maths/Plane.Ops.cs index ec15e8de18..c843d6e05f 100644 --- a/sources/Maths/Maths/Plane.Ops.cs +++ b/sources/Maths/Maths/Plane.Ops.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.CompilerServices; namespace Silk.NET.Maths @@ -16,9 +17,9 @@ public static class Plane /// The second point defining the Plane. /// The third point defining the Plane. /// The Plane containing the three points. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static Plane CreateFromVertices(Vector3D point1, Vector3D point2, Vector3D point3) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { var a = point1; var b = point2; @@ -29,9 +30,7 @@ public static Plane CreateFromVertices(Vector3D point1, Vector3D poi var cross = Vector3D.Cross(ab, ac); Plane p; p.Normal = cross; - p.Distance = Scalar.Negate(Scalar.Add( - Scalar.Add(Scalar.Multiply(p.Normal.X, a.X), Scalar.Multiply(p.Normal.Y, a.Y)), - Scalar.Multiply(p.Normal.Z, a.Z))); + p.Distance = -((p.Normal.X * a.X) + (p.Normal.Y * a.Y) + (p.Normal.Z * a.Z)); return p; @@ -45,38 +44,35 @@ public static Plane CreateFromVertices(Vector3D point1, Vector3D poi Vector3D normal = Vector3D.Normalize(n); // D = - Dot(N, point1) - T d = Scalar.Negate(Vector3D.Dot(normal, point1)); + T d = -Vector3D.Dot(normal, point1); return new Plane(normal, d); } else { - T ax = Scalar.Subtract(point2.X, point1.X); - T ay = Scalar.Subtract(point2.Y, point1.Y); - T az = Scalar.Subtract(point2.Z, point1.Z); + T ax = point2.X - point1.X; + T ay = point2.Y - point1.Y; + T az = point2.Z - point1.Z; - T bx = Scalar.Subtract(point3.X, point1.X); - T by = Scalar.Subtract(point3.Y, point1.Y); - T bz = Scalar.Subtract(point3.Z, point1.Z); + T bx = point3.X - point1.X; + T by = point3.Y - point1.Y; + T bz = point3.Z - point1.Z; // N=Cross(a,b) - T nx = Scalar.Subtract(Scalar.Multiply(ay, bz), Scalar.Multiply(az, by)); - T ny = Scalar.Subtract(Scalar.Multiply(az, bx), Scalar.Multiply(ax, bz)); - T nz = Scalar.Subtract(Scalar.Multiply(ax, by), Scalar.Multiply(ay, bx)); + T nx = (ay * bz) - (az * by); + T ny = (az * bx) - (ax * bz); + T nz = (ax * by) - (ay * bx); // Normalize(N) - T ls = Scalar.Add(Scalar.Add(Scalar.Multiply(nx, nx), Scalar.Multiply(ny, ny)), Scalar.Multiply(nz, nz)); - T invNorm = Scalar.Inverse(Scalar.Sqrt(ls)); + T ls = (nx * nx) + (ny * ny) + (nz * nz); + T invNorm = T.One / T.Sqrt(ls); Vector3D normal = new Vector3D( - Scalar.Multiply(nx, invNorm), - Scalar.Multiply(ny, invNorm), - Scalar.Multiply(nz, invNorm)); - - return new(normal, - Scalar.Negate(Scalar.Add( - Scalar.Add(Scalar.Multiply(normal.X, point1.X), - Scalar.Multiply(normal.Y, point1.Y)), Scalar.Multiply(normal.Z, point1.Z)))); + nx * invNorm, + ny * invNorm, + nz * invNorm); + + return new(normal, -((normal.X * point1.X) + (normal.Y * point1.Y) + (normal.Z * point1.Z))); }*/ } @@ -84,31 +80,27 @@ public static Plane CreateFromVertices(Vector3D point1, Vector3D poi /// The Plane. /// The Vector4D. /// The dot product. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static T Dot(Plane plane, Vector4D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Add( - Scalar.Add( - Scalar.Add(Scalar.Multiply(plane.Normal.X, value.X), - Scalar.Multiply(plane.Normal.Y, value.Y)), Scalar.Multiply(plane.Normal.Z, value.Z)), - Scalar.Multiply(plane.Distance, value.W)); + where T : INumberBase + => (plane.Normal.X * value.X) + (plane.Normal.Y * value.Y) + (plane.Normal.Z * value.Z) + (plane.Distance * value.W); /// Returns the dot product of a specified Vector3D and the normal vector of this Plane plus the distance (D) value of the Plane. /// The plane. /// The Vector3D. /// The resulting value. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static T DotCoordinate(Plane plane, Vector3D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Add(Vector3D.Dot(plane.Normal, value), plane.Distance); + where T : INumberBase + => Vector3D.Dot(plane.Normal, value) + plane.Distance; /// Returns the dot product of a specified Vector3D and the Normal vector of this Plane. /// The plane. /// The Vector3D. /// The resulting dot product. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static T DotNormal(Plane plane, Vector3D value) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase => Vector3D.Dot(plane.Normal, value); private const float NormalizeEpsilon = 1.192092896e-07f; // smallest such that 1.0+NormalizeEpsilon != 1.0 @@ -116,9 +108,9 @@ public static T DotNormal(Plane plane, Vector3D value) /// Creates a new Plane whose normal vector is the source Plane's normal vector normalized. /// The source Plane. /// The normalized Plane. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static Plane Normalize(Plane value) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions { /*if (Vector.IsHardwareAccelerated) { @@ -135,23 +127,20 @@ public static Plane Normalize(Plane value) } else*/ { - T f = Scalar.Add( - Scalar.Add(Scalar.Multiply(value.Normal.X, value.Normal.X), - Scalar.Multiply(value.Normal.Y, value.Normal.Y)), - Scalar.Multiply(value.Normal.Z, value.Normal.Z)); + T f = (value.Normal.X * value.Normal.X) + (value.Normal.Y * value.Normal.Y) + (value.Normal.Z * value.Normal.Z); - if (!Scalar.GreaterThanOrEqual(Scalar.Abs(Scalar.Subtract(f, Scalar.One)), Scalar.As(NormalizeEpsilon))) + if (!(T.Abs(f - T.One) >= T.CreateTruncating(NormalizeEpsilon))) { return value; // It already normalized, so we don't need to further process. } - T fInv = Scalar.Reciprocal(Scalar.Sqrt(f)); + T fInv = T.One / T.Sqrt(f); return new( - Scalar.Multiply(value.Normal.X, fInv), - Scalar.Multiply(value.Normal.Y, fInv), - Scalar.Multiply(value.Normal.Z, fInv), - Scalar.Multiply(value.Distance, fInv)); + value.Normal.X * fInv, + value.Normal.Y * fInv, + value.Normal.Z * fInv, + value.Distance * fInv); } } @@ -160,19 +149,19 @@ public static Plane Normalize(Plane value) /// This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called. /// The transformation matrix to apply to the Plane. /// The transformed Plane. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static Plane Transform(Plane plane, Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : IFloatingPointIeee754 { Matrix4X4.Invert(matrix, out Matrix4X4 m); T x = plane.Normal.X, y = plane.Normal.Y, z = plane.Normal.Z, w = plane.Distance; return new( - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(x, m.M11), Scalar.Multiply(y, m.M12)), Scalar.Multiply(z, m.M13)), Scalar.Multiply(w, m.M14)), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(x, m.M21), Scalar.Multiply(y, m.M22)), Scalar.Multiply(z, m.M23)), Scalar.Multiply(w, m.M24)), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(x, m.M31), Scalar.Multiply(y, m.M32)), Scalar.Multiply(z, m.M33)), Scalar.Multiply(w, m.M34)), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(x, m.M41), Scalar.Multiply(y, m.M42)), Scalar.Multiply(z, m.M43)), Scalar.Multiply(w, m.M44))); + (x * m.M11) + (y * m.M12) + (z * m.M13) + (w * m.M14), + (x * m.M21) + (y * m.M22) + (z * m.M23) + (w * m.M24), + (x * m.M31) + (y * m.M32) + (z * m.M33) + (w * m.M34), + (x * m.M41) + (y * m.M42) + (z * m.M43) + (w * m.M44)); } /// Transforms a normalized Plane by a Quaternion rotation. @@ -180,44 +169,44 @@ public static Plane Transform(Plane plane, Matrix4X4 matrix) /// This Plane must already be normalized, so that its Normal vector is of unit length, before this method is called. /// The Quaternion rotation to apply to the Plane. /// A new Plane that results from applying the rotation. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static Plane Transform(Plane plane, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber, IRootFunctions, ITrigonometricFunctions { // Compute rotation matrix. - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - T m11 = Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2); - T m21 = Scalar.Subtract(xy2, wz2); - T m31 = Scalar.Add(xz2, wy2); - - T m12 = Scalar.Add(xy2, wz2); - T m22 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2); - T m32 = Scalar.Subtract(yz2, wx2); - - T m13 = Scalar.Subtract(xz2, wy2); - T m23 = Scalar.Add(yz2, wx2); - T m33 = Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2); + T x2 = rotation.X + rotation.X; + T y2 = rotation.Y + rotation.Y; + T z2 = rotation.Z + rotation.Z; + + T wx2 = rotation.W * x2; + T wy2 = rotation.W * y2; + T wz2 = rotation.W * z2; + T xx2 = rotation.X * x2; + T xy2 = rotation.X * y2; + T xz2 = rotation.X * z2; + T yy2 = rotation.Y * y2; + T yz2 = rotation.Y * z2; + T zz2 = rotation.Z * z2; + + T m11 = T.One - yy2 - zz2; + T m21 = xy2 - wz2; + T m31 = xz2 + wy2; + + T m12 = xy2 + wz2; + T m22 = T.One - xx2 - zz2; + T m32 = yz2 - wx2; + + T m13 = xz2 - wy2; + T m23 = yz2 + wx2; + T m33 = T.One - xx2 - yy2; T x = plane.Normal.X, y = plane.Normal.Y, z = plane.Normal.Z; return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(x, m11), Scalar.Multiply(y, m21)), Scalar.Multiply(z, m31)), - Scalar.Add(Scalar.Add(Scalar.Multiply(x, m12), Scalar.Multiply(y, m22)), Scalar.Multiply(z, m32)), - Scalar.Add(Scalar.Add(Scalar.Multiply(x, m13), Scalar.Multiply(y, m23)), Scalar.Multiply(z, m33)), + (x * m11) + (y * m21) + (z * m31), + (x * m12) + (y * m22) + (z * m32), + (x * m13) + (y * m23) + (z * m33), plane.Distance); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Plane.cs b/sources/Maths/Maths/Plane.cs index 83b0fccaf1..d4794bcced 100644 --- a/sources/Maths/Maths/Plane.cs +++ b/sources/Maths/Maths/Plane.cs @@ -3,6 +3,7 @@ using System; using System.Globalization; +using System.Numerics; using System.Runtime.CompilerServices; using System.Runtime.Serialization; @@ -15,7 +16,8 @@ namespace Silk.NET.Maths [Serializable] [DataContract] public struct Plane - : IEquatable> where T : unmanaged, IFormattable, IEquatable, IComparable + : IEquatable> + where T : INumberBase { /// The normal vector of the Plane. [DataMember] @@ -58,22 +60,22 @@ public Plane(Vector4D value) /// The first Plane to compare. /// The second Plane to compare. /// True if the Planes are equal; False otherwise. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static bool operator ==(Plane value1, Plane value2) - => value1.Normal == value2.Normal && Scalar.Equal(value1.Distance, value2.Distance); + => value1.Normal == value2.Normal && value1.Distance == value2.Distance; /// Returns a boolean indicating whether the two given Planes are not equal. /// The first Plane to compare. /// The second Plane to compare. /// True if the Planes are not equal; False if they are equal. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public static bool operator !=(Plane value1, Plane value2) => !(value1 == value2); /// Returns a boolean indicating whether the given Object is equal to this Plane instance. /// The Object to compare against. /// True if the Object is equal to this Plane; False otherwise. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public override readonly bool Equals(object? obj) { return (obj is Plane other) && Equals(other); @@ -82,10 +84,10 @@ public override readonly bool Equals(object? obj) /// Returns a boolean indicating whether the given Plane is equal to this Plane instance. /// The Plane to compare this instance to. /// True if the other Plane is equal to this instance; False otherwise. - [MethodImpl((MethodImplOptions) 768)] + [MethodImpl((MethodImplOptions)768)] public readonly bool Equals(Plane other) { - return Normal.Equals(other.Normal) && Scalar.Equal(Distance, other.Distance); + return Normal.Equals(other.Normal) && Distance == other.Distance; } /// Returns the hash code for this instance. @@ -109,7 +111,7 @@ public override readonly string ToString() /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, Half.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -117,7 +119,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, float.CreateTruncating(from.Distance)); /// /// Converts a into @@ -125,15 +127,15 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator System.Numerics.Plane(Plane from) - => new((System.Numerics.Vector3) from.Normal, Scalar.As(from.Distance)); - + => new((System.Numerics.Vector3)from.Normal, float.CreateTruncating(from.Distance)); + /// /// Converts a into one with a of /// /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, double.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -141,7 +143,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, decimal.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -149,7 +151,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, sbyte.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -157,7 +159,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, byte.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -165,7 +167,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, ushort.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -173,7 +175,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, short.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -181,7 +183,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, uint.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -189,7 +191,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, int.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -197,7 +199,7 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); + => new((Vector3D)from.Normal, ulong.CreateTruncating(from.Distance)); /// /// Converts a into one with a of @@ -205,16 +207,17 @@ public static explicit operator Plane(Plane from) /// The source matrix /// The matrix public static explicit operator Plane(Plane from) - => new((Vector3D) from.Normal, Scalar.As(from.Distance)); - + => new((Vector3D)from.Normal, long.CreateTruncating(from.Distance)); + /// /// Returns this plane casted to /// /// The type to cast to /// The casted plane - public Plane As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Plane As() where TOther : INumberBase { - return new(Normal.As(), Scalar.As(Distance)); + return new(Normal.As(), TOther.CreateTruncating(Distance)); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/PublicAPI/net10.0/PublicAPI.Unshipped.txt b/sources/Maths/Maths/PublicAPI/net10.0/PublicAPI.Unshipped.txt index 3552eec334..e3b1e3e3c8 100644 --- a/sources/Maths/Maths/PublicAPI/net10.0/PublicAPI.Unshipped.txt +++ b/sources/Maths/Maths/PublicAPI/net10.0/PublicAPI.Unshipped.txt @@ -60,8 +60,12 @@ override Silk.NET.Maths.Vector3D.ToString() -> string! override Silk.NET.Maths.Vector4D.Equals(object? obj) -> bool override Silk.NET.Maths.Vector4D.GetHashCode() -> int override Silk.NET.Maths.Vector4D.ToString() -> string! +Silk.NET.Maths.Box2D Silk.NET.Maths.Box2D Silk.NET.Maths.Box2D.As() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.AsChecked() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.AsSaturating() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.AsTruncating() -> Silk.NET.Maths.Box2D Silk.NET.Maths.Box2D.Box2D() -> void Silk.NET.Maths.Box2D.Box2D(Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> void Silk.NET.Maths.Box2D.Box2D(Silk.NET.Maths.Vector2D min, T maxX, T maxY) -> void @@ -71,7 +75,6 @@ Silk.NET.Maths.Box2D.Center.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Box2D.Contains(Silk.NET.Maths.Box2D other) -> bool Silk.NET.Maths.Box2D.Contains(Silk.NET.Maths.Vector2D point) -> bool Silk.NET.Maths.Box2D.Equals(Silk.NET.Maths.Box2D other) -> bool -Silk.NET.Maths.Box2D.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T Silk.NET.Maths.Box2D.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Box2D Silk.NET.Maths.Box2D.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Box2D Silk.NET.Maths.Box2D.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Box2D @@ -79,6 +82,7 @@ Silk.NET.Maths.Box2D.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Si Silk.NET.Maths.Box2D.Max -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Box2D.Min -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Box2D.Size.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Box3D Silk.NET.Maths.Box3D Silk.NET.Maths.Box3D.As() -> Silk.NET.Maths.Box3D Silk.NET.Maths.Box3D.Box3D() -> void @@ -90,7 +94,6 @@ Silk.NET.Maths.Box3D.Center.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Box3D.Contains(Silk.NET.Maths.Box3D other) -> bool Silk.NET.Maths.Box3D.Contains(Silk.NET.Maths.Vector3D point) -> bool Silk.NET.Maths.Box3D.Equals(Silk.NET.Maths.Box3D other) -> bool -Silk.NET.Maths.Box3D.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T Silk.NET.Maths.Box3D.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Box3D Silk.NET.Maths.Box3D.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Box3D Silk.NET.Maths.Box3D.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Box3D @@ -98,6 +101,7 @@ Silk.NET.Maths.Box3D.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Si Silk.NET.Maths.Box3D.Max -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Box3D.Min -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Box3D.Size.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Circle Silk.NET.Maths.Circle Silk.NET.Maths.Circle.As() -> Silk.NET.Maths.Circle Silk.NET.Maths.Circle.Center -> Silk.NET.Maths.Vector2D @@ -105,16 +109,14 @@ Silk.NET.Maths.Circle.Circle() -> void Silk.NET.Maths.Circle.Circle(Silk.NET.Maths.Vector2D center, T radius) -> void Silk.NET.Maths.Circle.Circle(T centerX, T centerY, T radius) -> void Silk.NET.Maths.Circle.Circumference.get -> T -Silk.NET.Maths.Circle.Contains(Silk.NET.Maths.Circle other) -> bool -Silk.NET.Maths.Circle.Contains(Silk.NET.Maths.Vector2D point) -> bool Silk.NET.Maths.Circle.Diameter.get -> T Silk.NET.Maths.Circle.Equals(Silk.NET.Maths.Circle other) -> bool Silk.NET.Maths.Circle.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T Silk.NET.Maths.Circle.GetDistanceToNearestEdgeSquared(Silk.NET.Maths.Vector2D point) -> T -Silk.NET.Maths.Circle.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Circle Silk.NET.Maths.Circle.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Circle Silk.NET.Maths.Circle.Radius -> T Silk.NET.Maths.Circle.SquaredRadius.get -> T +Silk.NET.Maths.Cube Silk.NET.Maths.Cube Silk.NET.Maths.Cube.As() -> Silk.NET.Maths.Cube Silk.NET.Maths.Cube.Center.get -> Silk.NET.Maths.Vector3D @@ -126,7 +128,6 @@ Silk.NET.Maths.Cube.Cube(Silk.NET.Maths.Vector3D origin, T sizeX, T sizeY, Silk.NET.Maths.Cube.Cube(T originX, T originY, T originZ, Silk.NET.Maths.Vector3D size) -> void Silk.NET.Maths.Cube.Cube(T originX, T originY, T originZ, T sizeX, T sizeY, T sizeZ) -> void Silk.NET.Maths.Cube.Equals(Silk.NET.Maths.Cube other) -> bool -Silk.NET.Maths.Cube.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T Silk.NET.Maths.Cube.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Cube Silk.NET.Maths.Cube.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Cube Silk.NET.Maths.Cube.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Cube @@ -138,19 +139,18 @@ Silk.NET.Maths.Cube.Size -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix2X2 Silk.NET.Maths.Matrix2X2 Silk.NET.Maths.Matrix2X2.As() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.AsChecked() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.AsSaturating() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.AsTruncating() -> Silk.NET.Maths.Matrix2X2 Silk.NET.Maths.Matrix2X2.Column1.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X2.Column2.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X2.Equals(Silk.NET.Maths.Matrix2X2 other) -> bool Silk.NET.Maths.Matrix2X2.GetDeterminant() -> T Silk.NET.Maths.Matrix2X2.IsIdentity.get -> bool Silk.NET.Maths.Matrix2X2.M11.get -> T -Silk.NET.Maths.Matrix2X2.M11.set -> void Silk.NET.Maths.Matrix2X2.M12.get -> T -Silk.NET.Maths.Matrix2X2.M12.set -> void Silk.NET.Maths.Matrix2X2.M21.get -> T -Silk.NET.Maths.Matrix2X2.M21.set -> void Silk.NET.Maths.Matrix2X2.M22.get -> T -Silk.NET.Maths.Matrix2X2.M22.set -> void Silk.NET.Maths.Matrix2X2.Matrix2X2() -> void Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix3X2 value) -> void @@ -161,28 +161,26 @@ Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Vector2D row1, Silk.NET. Silk.NET.Maths.Matrix2X2.Matrix2X2(T m11, T m12, T m21, T m22) -> void Silk.NET.Maths.Matrix2X2.Row1 -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X2.Row2 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X2.this[int x, int y].get -> T -Silk.NET.Maths.Matrix2X2.this[int x].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.this[int row, int column].get -> T +Silk.NET.Maths.Matrix2X2.this[int row].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.Transpose() -> Silk.NET.Maths.Matrix2X2 Silk.NET.Maths.Matrix2X3 Silk.NET.Maths.Matrix2X3 Silk.NET.Maths.Matrix2X3.As() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.AsChecked() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.AsSaturating() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.AsTruncating() -> Silk.NET.Maths.Matrix2X3 Silk.NET.Maths.Matrix2X3.Column1.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X3.Column2.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X3.Column3.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X3.Equals(Silk.NET.Maths.Matrix2X3 other) -> bool Silk.NET.Maths.Matrix2X3.IsIdentity.get -> bool Silk.NET.Maths.Matrix2X3.M11.get -> T -Silk.NET.Maths.Matrix2X3.M11.set -> void Silk.NET.Maths.Matrix2X3.M12.get -> T -Silk.NET.Maths.Matrix2X3.M12.set -> void Silk.NET.Maths.Matrix2X3.M13.get -> T -Silk.NET.Maths.Matrix2X3.M13.set -> void Silk.NET.Maths.Matrix2X3.M21.get -> T -Silk.NET.Maths.Matrix2X3.M21.set -> void Silk.NET.Maths.Matrix2X3.M22.get -> T -Silk.NET.Maths.Matrix2X3.M22.set -> void Silk.NET.Maths.Matrix2X3.M23.get -> T -Silk.NET.Maths.Matrix2X3.M23.set -> void Silk.NET.Maths.Matrix2X3.Matrix2X3() -> void Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix3X2 value) -> void @@ -193,11 +191,15 @@ Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Vector3D row1, Silk.NET. Silk.NET.Maths.Matrix2X3.Matrix2X3(T m11, T m12, T m13, T m21, T m22, T m23) -> void Silk.NET.Maths.Matrix2X3.Row1 -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix2X3.Row2 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix2X3.this[int x, int y].get -> T -Silk.NET.Maths.Matrix2X3.this[int x].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix2X3.this[int row, int column].get -> T +Silk.NET.Maths.Matrix2X3.this[int row].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix2X3.Transpose() -> Silk.NET.Maths.Matrix3X2 Silk.NET.Maths.Matrix2X4 Silk.NET.Maths.Matrix2X4 Silk.NET.Maths.Matrix2X4.As() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.AsChecked() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.AsSaturating() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.AsTruncating() -> Silk.NET.Maths.Matrix2X4 Silk.NET.Maths.Matrix2X4.Column1.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X4.Column2.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X4.Column3.get -> Silk.NET.Maths.Vector2D @@ -205,21 +207,13 @@ Silk.NET.Maths.Matrix2X4.Column4.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix2X4.Equals(Silk.NET.Maths.Matrix2X4 other) -> bool Silk.NET.Maths.Matrix2X4.IsIdentity.get -> bool Silk.NET.Maths.Matrix2X4.M11.get -> T -Silk.NET.Maths.Matrix2X4.M11.set -> void Silk.NET.Maths.Matrix2X4.M12.get -> T -Silk.NET.Maths.Matrix2X4.M12.set -> void Silk.NET.Maths.Matrix2X4.M13.get -> T -Silk.NET.Maths.Matrix2X4.M13.set -> void Silk.NET.Maths.Matrix2X4.M14.get -> T -Silk.NET.Maths.Matrix2X4.M14.set -> void Silk.NET.Maths.Matrix2X4.M21.get -> T -Silk.NET.Maths.Matrix2X4.M21.set -> void Silk.NET.Maths.Matrix2X4.M22.get -> T -Silk.NET.Maths.Matrix2X4.M22.set -> void Silk.NET.Maths.Matrix2X4.M23.get -> T -Silk.NET.Maths.Matrix2X4.M23.set -> void Silk.NET.Maths.Matrix2X4.M24.get -> T -Silk.NET.Maths.Matrix2X4.M24.set -> void Silk.NET.Maths.Matrix2X4.Matrix2X4() -> void Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X2 value) -> void Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X3 value) -> void @@ -230,28 +224,26 @@ Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Vector4D row1, Silk.NET. Silk.NET.Maths.Matrix2X4.Matrix2X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24) -> void Silk.NET.Maths.Matrix2X4.Row1 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix2X4.Row2 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix2X4.this[int x, int j].get -> T -Silk.NET.Maths.Matrix2X4.this[int x].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix2X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix2X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix2X4.Transpose() -> Silk.NET.Maths.Matrix4X2 Silk.NET.Maths.Matrix3X2 Silk.NET.Maths.Matrix3X2 Silk.NET.Maths.Matrix3X2.As() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.AsChecked() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.AsSaturating() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.AsTruncating() -> Silk.NET.Maths.Matrix3X2 Silk.NET.Maths.Matrix3X2.Column1.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X2.Column2.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X2.Equals(Silk.NET.Maths.Matrix3X2 other) -> bool Silk.NET.Maths.Matrix3X2.GetDeterminant() -> T Silk.NET.Maths.Matrix3X2.IsIdentity.get -> bool Silk.NET.Maths.Matrix3X2.M11.get -> T -Silk.NET.Maths.Matrix3X2.M11.set -> void Silk.NET.Maths.Matrix3X2.M12.get -> T -Silk.NET.Maths.Matrix3X2.M12.set -> void Silk.NET.Maths.Matrix3X2.M21.get -> T -Silk.NET.Maths.Matrix3X2.M21.set -> void Silk.NET.Maths.Matrix3X2.M22.get -> T -Silk.NET.Maths.Matrix3X2.M22.set -> void Silk.NET.Maths.Matrix3X2.M31.get -> T -Silk.NET.Maths.Matrix3X2.M31.set -> void Silk.NET.Maths.Matrix3X2.M32.get -> T -Silk.NET.Maths.Matrix3X2.M32.set -> void Silk.NET.Maths.Matrix3X2.Matrix3X2() -> void Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix3X3 value) -> void @@ -263,11 +255,15 @@ Silk.NET.Maths.Matrix3X2.Matrix3X2(T m11, T m12, T m21, T m22, T m31, T m32) Silk.NET.Maths.Matrix3X2.Row1 -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix3X2.Row2 -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix3X2.Row3 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix3X2.this[int x, int y].get -> T -Silk.NET.Maths.Matrix3X2.this[int x].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix3X2.this[int row, int column].get -> T +Silk.NET.Maths.Matrix3X2.this[int row].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix3X2.Transpose() -> Silk.NET.Maths.Matrix2X3 Silk.NET.Maths.Matrix3X3 Silk.NET.Maths.Matrix3X3 Silk.NET.Maths.Matrix3X3.As() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.AsChecked() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.AsSaturating() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.AsTruncating() -> Silk.NET.Maths.Matrix3X3 Silk.NET.Maths.Matrix3X3.Column1.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X3.Column2.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X3.Column3.get -> Silk.NET.Maths.Vector3D @@ -275,23 +271,14 @@ Silk.NET.Maths.Matrix3X3.Equals(Silk.NET.Maths.Matrix3X3 other) -> bool Silk.NET.Maths.Matrix3X3.GetDeterminant() -> T Silk.NET.Maths.Matrix3X3.IsIdentity.get -> bool Silk.NET.Maths.Matrix3X3.M11.get -> T -Silk.NET.Maths.Matrix3X3.M11.set -> void Silk.NET.Maths.Matrix3X3.M12.get -> T -Silk.NET.Maths.Matrix3X3.M12.set -> void Silk.NET.Maths.Matrix3X3.M13.get -> T -Silk.NET.Maths.Matrix3X3.M13.set -> void Silk.NET.Maths.Matrix3X3.M21.get -> T -Silk.NET.Maths.Matrix3X3.M21.set -> void Silk.NET.Maths.Matrix3X3.M22.get -> T -Silk.NET.Maths.Matrix3X3.M22.set -> void Silk.NET.Maths.Matrix3X3.M23.get -> T -Silk.NET.Maths.Matrix3X3.M23.set -> void Silk.NET.Maths.Matrix3X3.M31.get -> T -Silk.NET.Maths.Matrix3X3.M31.set -> void Silk.NET.Maths.Matrix3X3.M32.get -> T -Silk.NET.Maths.Matrix3X3.M32.set -> void Silk.NET.Maths.Matrix3X3.M33.get -> T -Silk.NET.Maths.Matrix3X3.M33.set -> void Silk.NET.Maths.Matrix3X3.Matrix3X3() -> void Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X2 value) -> void @@ -305,11 +292,15 @@ Silk.NET.Maths.Matrix3X3.Matrix3X3(T m11, T m12, T m13, T m21, T m22, T m23, Silk.NET.Maths.Matrix3X3.Row1 -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X3.Row2 -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X3.Row3 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.this[int x, int i].get -> T -Silk.NET.Maths.Matrix3X3.this[int x].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.this[int row, int column].get -> T +Silk.NET.Maths.Matrix3X3.this[int row].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Transpose() -> Silk.NET.Maths.Matrix3X3 Silk.NET.Maths.Matrix3X4 Silk.NET.Maths.Matrix3X4 Silk.NET.Maths.Matrix3X4.As() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.AsChecked() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.AsSaturating() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.AsTruncating() -> Silk.NET.Maths.Matrix3X4 Silk.NET.Maths.Matrix3X4.Column1.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X4.Column2.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X4.Column3.get -> Silk.NET.Maths.Vector3D @@ -317,29 +308,17 @@ Silk.NET.Maths.Matrix3X4.Column4.get -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix3X4.Equals(Silk.NET.Maths.Matrix3X4 other) -> bool Silk.NET.Maths.Matrix3X4.IsIdentity.get -> bool Silk.NET.Maths.Matrix3X4.M11.get -> T -Silk.NET.Maths.Matrix3X4.M11.set -> void Silk.NET.Maths.Matrix3X4.M12.get -> T -Silk.NET.Maths.Matrix3X4.M12.set -> void Silk.NET.Maths.Matrix3X4.M13.get -> T -Silk.NET.Maths.Matrix3X4.M13.set -> void Silk.NET.Maths.Matrix3X4.M14.get -> T -Silk.NET.Maths.Matrix3X4.M14.set -> void Silk.NET.Maths.Matrix3X4.M21.get -> T -Silk.NET.Maths.Matrix3X4.M21.set -> void Silk.NET.Maths.Matrix3X4.M22.get -> T -Silk.NET.Maths.Matrix3X4.M22.set -> void Silk.NET.Maths.Matrix3X4.M23.get -> T -Silk.NET.Maths.Matrix3X4.M23.set -> void Silk.NET.Maths.Matrix3X4.M24.get -> T -Silk.NET.Maths.Matrix3X4.M24.set -> void Silk.NET.Maths.Matrix3X4.M31.get -> T -Silk.NET.Maths.Matrix3X4.M31.set -> void Silk.NET.Maths.Matrix3X4.M32.get -> T -Silk.NET.Maths.Matrix3X4.M32.set -> void Silk.NET.Maths.Matrix3X4.M33.get -> T -Silk.NET.Maths.Matrix3X4.M33.set -> void Silk.NET.Maths.Matrix3X4.M34.get -> T -Silk.NET.Maths.Matrix3X4.M34.set -> void Silk.NET.Maths.Matrix3X4.Matrix3X4() -> void Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X2 value) -> void @@ -352,31 +331,27 @@ Silk.NET.Maths.Matrix3X4.Matrix3X4(T m11, T m12, T m13, T m14, T m21, T m22, Silk.NET.Maths.Matrix3X4.Row1 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix3X4.Row2 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix3X4.Row3 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix3X4.this[int x, int y].get -> T -Silk.NET.Maths.Matrix3X4.this[int x].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix3X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix3X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix3X4.Transpose() -> Silk.NET.Maths.Matrix4X3 Silk.NET.Maths.Matrix4X2 Silk.NET.Maths.Matrix4X2 Silk.NET.Maths.Matrix4X2.As() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.AsChecked() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.AsSaturating() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.AsTruncating() -> Silk.NET.Maths.Matrix4X2 Silk.NET.Maths.Matrix4X2.Column1.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X2.Column2.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X2.Equals(Silk.NET.Maths.Matrix4X2 other) -> bool Silk.NET.Maths.Matrix4X2.IsIdentity.get -> bool Silk.NET.Maths.Matrix4X2.M11.get -> T -Silk.NET.Maths.Matrix4X2.M11.set -> void Silk.NET.Maths.Matrix4X2.M12.get -> T -Silk.NET.Maths.Matrix4X2.M12.set -> void Silk.NET.Maths.Matrix4X2.M21.get -> T -Silk.NET.Maths.Matrix4X2.M21.set -> void Silk.NET.Maths.Matrix4X2.M22.get -> T -Silk.NET.Maths.Matrix4X2.M22.set -> void Silk.NET.Maths.Matrix4X2.M31.get -> T -Silk.NET.Maths.Matrix4X2.M31.set -> void Silk.NET.Maths.Matrix4X2.M32.get -> T -Silk.NET.Maths.Matrix4X2.M32.set -> void Silk.NET.Maths.Matrix4X2.M41.get -> T -Silk.NET.Maths.Matrix4X2.M41.set -> void Silk.NET.Maths.Matrix4X2.M42.get -> T -Silk.NET.Maths.Matrix4X2.M42.set -> void Silk.NET.Maths.Matrix4X2.Matrix4X2() -> void Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X2 value) -> void @@ -389,40 +364,32 @@ Silk.NET.Maths.Matrix4X2.Row1 -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix4X2.Row2 -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix4X2.Row3 -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Matrix4X2.Row4 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix4X2.this[int x, int y].get -> T -Silk.NET.Maths.Matrix4X2.this[int x].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.this[int row, int column].get -> T +Silk.NET.Maths.Matrix4X2.this[int row].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.Transpose() -> Silk.NET.Maths.Matrix2X4 Silk.NET.Maths.Matrix4X3 Silk.NET.Maths.Matrix4X3 Silk.NET.Maths.Matrix4X3.As() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.AsChecked() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.AsSaturating() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.AsTruncating() -> Silk.NET.Maths.Matrix4X3 Silk.NET.Maths.Matrix4X3.Column1.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X3.Column2.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X3.Column3.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X3.Equals(Silk.NET.Maths.Matrix4X3 other) -> bool Silk.NET.Maths.Matrix4X3.IsIdentity.get -> bool Silk.NET.Maths.Matrix4X3.M11.get -> T -Silk.NET.Maths.Matrix4X3.M11.set -> void Silk.NET.Maths.Matrix4X3.M12.get -> T -Silk.NET.Maths.Matrix4X3.M12.set -> void Silk.NET.Maths.Matrix4X3.M13.get -> T -Silk.NET.Maths.Matrix4X3.M13.set -> void Silk.NET.Maths.Matrix4X3.M21.get -> T -Silk.NET.Maths.Matrix4X3.M21.set -> void Silk.NET.Maths.Matrix4X3.M22.get -> T -Silk.NET.Maths.Matrix4X3.M22.set -> void Silk.NET.Maths.Matrix4X3.M23.get -> T -Silk.NET.Maths.Matrix4X3.M23.set -> void Silk.NET.Maths.Matrix4X3.M31.get -> T -Silk.NET.Maths.Matrix4X3.M31.set -> void Silk.NET.Maths.Matrix4X3.M32.get -> T -Silk.NET.Maths.Matrix4X3.M32.set -> void Silk.NET.Maths.Matrix4X3.M33.get -> T -Silk.NET.Maths.Matrix4X3.M33.set -> void Silk.NET.Maths.Matrix4X3.M41.get -> T -Silk.NET.Maths.Matrix4X3.M41.set -> void Silk.NET.Maths.Matrix4X3.M42.get -> T -Silk.NET.Maths.Matrix4X3.M42.set -> void Silk.NET.Maths.Matrix4X3.M43.get -> T -Silk.NET.Maths.Matrix4X3.M43.set -> void Silk.NET.Maths.Matrix4X3.Matrix4X3() -> void Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X2 value) -> void @@ -437,11 +404,15 @@ Silk.NET.Maths.Matrix4X3.Row1 -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix4X3.Row2 -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix4X3.Row3 -> Silk.NET.Maths.Vector3D Silk.NET.Maths.Matrix4X3.Row4 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix4X3.this[int x, int i].get -> T -Silk.NET.Maths.Matrix4X3.this[int x].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.this[int row, int column].get -> T +Silk.NET.Maths.Matrix4X3.this[int row].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.Transpose() -> Silk.NET.Maths.Matrix3X4 Silk.NET.Maths.Matrix4X4 Silk.NET.Maths.Matrix4X4 Silk.NET.Maths.Matrix4X4.As() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.AsChecked() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.AsSaturating() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.AsTruncating() -> Silk.NET.Maths.Matrix4X4 Silk.NET.Maths.Matrix4X4.Column1.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X4.Column2.get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X4.Column3.get -> Silk.NET.Maths.Vector4D @@ -450,37 +421,21 @@ Silk.NET.Maths.Matrix4X4.Equals(Silk.NET.Maths.Matrix4X4 other) -> bool Silk.NET.Maths.Matrix4X4.GetDeterminant() -> T Silk.NET.Maths.Matrix4X4.IsIdentity.get -> bool Silk.NET.Maths.Matrix4X4.M11.get -> T -Silk.NET.Maths.Matrix4X4.M11.set -> void Silk.NET.Maths.Matrix4X4.M12.get -> T -Silk.NET.Maths.Matrix4X4.M12.set -> void Silk.NET.Maths.Matrix4X4.M13.get -> T -Silk.NET.Maths.Matrix4X4.M13.set -> void Silk.NET.Maths.Matrix4X4.M14.get -> T -Silk.NET.Maths.Matrix4X4.M14.set -> void Silk.NET.Maths.Matrix4X4.M21.get -> T -Silk.NET.Maths.Matrix4X4.M21.set -> void Silk.NET.Maths.Matrix4X4.M22.get -> T -Silk.NET.Maths.Matrix4X4.M22.set -> void Silk.NET.Maths.Matrix4X4.M23.get -> T -Silk.NET.Maths.Matrix4X4.M23.set -> void Silk.NET.Maths.Matrix4X4.M24.get -> T -Silk.NET.Maths.Matrix4X4.M24.set -> void Silk.NET.Maths.Matrix4X4.M31.get -> T -Silk.NET.Maths.Matrix4X4.M31.set -> void Silk.NET.Maths.Matrix4X4.M32.get -> T -Silk.NET.Maths.Matrix4X4.M32.set -> void Silk.NET.Maths.Matrix4X4.M33.get -> T -Silk.NET.Maths.Matrix4X4.M33.set -> void Silk.NET.Maths.Matrix4X4.M34.get -> T -Silk.NET.Maths.Matrix4X4.M34.set -> void Silk.NET.Maths.Matrix4X4.M41.get -> T -Silk.NET.Maths.Matrix4X4.M41.set -> void Silk.NET.Maths.Matrix4X4.M42.get -> T -Silk.NET.Maths.Matrix4X4.M42.set -> void Silk.NET.Maths.Matrix4X4.M43.get -> T -Silk.NET.Maths.Matrix4X4.M43.set -> void Silk.NET.Maths.Matrix4X4.M44.get -> T -Silk.NET.Maths.Matrix4X4.M44.set -> void Silk.NET.Maths.Matrix4X4.Matrix4X4() -> void Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X2 value) -> void @@ -494,53 +449,37 @@ Silk.NET.Maths.Matrix4X4.Row1 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X4.Row2 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X4.Row3 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix4X4.Row4 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.this[int x, int y].get -> T -Silk.NET.Maths.Matrix4X4.this[int x].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix4X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Transpose() -> Silk.NET.Maths.Matrix4X4 Silk.NET.Maths.Matrix5X4 Silk.NET.Maths.Matrix5X4 Silk.NET.Maths.Matrix5X4.As() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.AsChecked() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.AsSaturating() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.AsTruncating() -> Silk.NET.Maths.Matrix5X4 Silk.NET.Maths.Matrix5X4.Equals(Silk.NET.Maths.Matrix5X4 other) -> bool Silk.NET.Maths.Matrix5X4.IsIdentity.get -> bool Silk.NET.Maths.Matrix5X4.M11.get -> T -Silk.NET.Maths.Matrix5X4.M11.set -> void Silk.NET.Maths.Matrix5X4.M12.get -> T -Silk.NET.Maths.Matrix5X4.M12.set -> void Silk.NET.Maths.Matrix5X4.M13.get -> T -Silk.NET.Maths.Matrix5X4.M13.set -> void Silk.NET.Maths.Matrix5X4.M14.get -> T -Silk.NET.Maths.Matrix5X4.M14.set -> void Silk.NET.Maths.Matrix5X4.M21.get -> T -Silk.NET.Maths.Matrix5X4.M21.set -> void Silk.NET.Maths.Matrix5X4.M22.get -> T -Silk.NET.Maths.Matrix5X4.M22.set -> void Silk.NET.Maths.Matrix5X4.M23.get -> T -Silk.NET.Maths.Matrix5X4.M23.set -> void Silk.NET.Maths.Matrix5X4.M24.get -> T -Silk.NET.Maths.Matrix5X4.M24.set -> void Silk.NET.Maths.Matrix5X4.M31.get -> T -Silk.NET.Maths.Matrix5X4.M31.set -> void Silk.NET.Maths.Matrix5X4.M32.get -> T -Silk.NET.Maths.Matrix5X4.M32.set -> void Silk.NET.Maths.Matrix5X4.M33.get -> T -Silk.NET.Maths.Matrix5X4.M33.set -> void Silk.NET.Maths.Matrix5X4.M34.get -> T -Silk.NET.Maths.Matrix5X4.M34.set -> void Silk.NET.Maths.Matrix5X4.M41.get -> T -Silk.NET.Maths.Matrix5X4.M41.set -> void Silk.NET.Maths.Matrix5X4.M42.get -> T -Silk.NET.Maths.Matrix5X4.M42.set -> void Silk.NET.Maths.Matrix5X4.M43.get -> T -Silk.NET.Maths.Matrix5X4.M43.set -> void Silk.NET.Maths.Matrix5X4.M44.get -> T -Silk.NET.Maths.Matrix5X4.M44.set -> void Silk.NET.Maths.Matrix5X4.M51.get -> T -Silk.NET.Maths.Matrix5X4.M51.set -> void Silk.NET.Maths.Matrix5X4.M52.get -> T -Silk.NET.Maths.Matrix5X4.M52.set -> void Silk.NET.Maths.Matrix5X4.M53.get -> T -Silk.NET.Maths.Matrix5X4.M53.set -> void Silk.NET.Maths.Matrix5X4.M54.get -> T -Silk.NET.Maths.Matrix5X4.M54.set -> void Silk.NET.Maths.Matrix5X4.Matrix5X4() -> void Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix2X4 value) -> void Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X2 value) -> void @@ -556,8 +495,8 @@ Silk.NET.Maths.Matrix5X4.Row2 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix5X4.Row3 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix5X4.Row4 -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Matrix5X4.Row5 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4.this[int x, int y].get -> T -Silk.NET.Maths.Matrix5X4.this[int x].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix5X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix5X4.this[int row].get -> Silk.NET.Maths.Vector4D Silk.NET.Maths.Plane Silk.NET.Maths.Plane Silk.NET.Maths.Plane.As() -> Silk.NET.Maths.Plane @@ -569,6 +508,7 @@ Silk.NET.Maths.Plane.Plane(Silk.NET.Maths.Vector3D normal, T distance) -> Silk.NET.Maths.Plane.Plane(Silk.NET.Maths.Vector4D value) -> void Silk.NET.Maths.Plane.Plane(T x, T y, T z, T distance) -> void Silk.NET.Maths.Quaternion +Silk.NET.Maths.Quaternion.Angle.get -> T Silk.NET.Maths.Quaternion.As() -> Silk.NET.Maths.Quaternion Silk.NET.Maths.Quaternion.Equals(Silk.NET.Maths.Quaternion other) -> bool Silk.NET.Maths.Quaternion.IsIdentity.get -> bool @@ -577,6 +517,7 @@ Silk.NET.Maths.Quaternion.LengthSquared() -> T Silk.NET.Maths.Quaternion.Quaternion() -> void Silk.NET.Maths.Quaternion.Quaternion(Silk.NET.Maths.Vector3D vectorPart, T scalarPart) -> void Silk.NET.Maths.Quaternion.Quaternion(T x, T y, T z, T w) -> void +Silk.NET.Maths.Quaternion.this[int index].get -> T Silk.NET.Maths.Quaternion.W -> T Silk.NET.Maths.Quaternion.X -> T Silk.NET.Maths.Quaternion.Y -> T @@ -610,7 +551,6 @@ Silk.NET.Maths.Rectangle.Center.get -> Silk.NET.Maths.Vector2D Silk.NET.Maths.Rectangle.Contains(Silk.NET.Maths.Rectangle other) -> bool Silk.NET.Maths.Rectangle.Contains(Silk.NET.Maths.Vector2D point) -> bool Silk.NET.Maths.Rectangle.Equals(Silk.NET.Maths.Rectangle other) -> bool -Silk.NET.Maths.Rectangle.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T Silk.NET.Maths.Rectangle.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Rectangle Silk.NET.Maths.Rectangle.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Rectangle Silk.NET.Maths.Rectangle.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Rectangle @@ -624,18 +564,14 @@ Silk.NET.Maths.Rectangle.Rectangle(Silk.NET.Maths.Vector2D origin, T sizeX Silk.NET.Maths.Rectangle.Rectangle(T originX, T originY, Silk.NET.Maths.Vector2D size) -> void Silk.NET.Maths.Rectangle.Rectangle(T originX, T originY, T sizeX, T sizeY) -> void Silk.NET.Maths.Rectangle.Size -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Scalar -Silk.NET.Maths.Scalar +Silk.NET.Maths.Sphere Silk.NET.Maths.Sphere Silk.NET.Maths.Sphere.As() -> Silk.NET.Maths.Sphere Silk.NET.Maths.Sphere.Center -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Sphere.Contains(Silk.NET.Maths.Sphere other) -> bool -Silk.NET.Maths.Sphere.Contains(Silk.NET.Maths.Vector3D point) -> bool Silk.NET.Maths.Sphere.Diameter.get -> T Silk.NET.Maths.Sphere.Equals(Silk.NET.Maths.Sphere other) -> bool Silk.NET.Maths.Sphere.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T Silk.NET.Maths.Sphere.GetDistanceToNearestEdgeSquared(Silk.NET.Maths.Vector3D point) -> T -Silk.NET.Maths.Sphere.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Sphere Silk.NET.Maths.Sphere.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Sphere Silk.NET.Maths.Sphere.Radius -> T Silk.NET.Maths.Sphere.Sphere() -> void @@ -644,93 +580,134 @@ Silk.NET.Maths.Sphere.Sphere(T centerX, T centerY, T centerZ, T radius) -> vo Silk.NET.Maths.Sphere.SquaredRadius.get -> T Silk.NET.Maths.SystemNumericsExtensions Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.extension(Silk.NET.Maths.Vector2D) +Silk.NET.Maths.Vector2D.extension(Silk.NET.Maths.Vector2D).Length.get -> T +Silk.NET.Maths.Vector2D.extension(Silk.NET.Maths.Vector2D).LengthSquared.get -> T Silk.NET.Maths.Vector2D Silk.NET.Maths.Vector2D.As() -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Vector2D.CopyTo(T[]? array) -> void -Silk.NET.Maths.Vector2D.CopyTo(T[]? array, int index) -> void +Silk.NET.Maths.Vector2D.AsChecked() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.AsSaturating() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.AsSpan() -> System.Span +Silk.NET.Maths.Vector2D.AsTruncating() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.CopyTo(System.Span span) -> void +Silk.NET.Maths.Vector2D.CopyTo(System.Span span, int startIndex) -> void +Silk.NET.Maths.Vector2D.CopyTo(T[]! array) -> void +Silk.NET.Maths.Vector2D.CopyTo(T[]! array, int startIndex) -> void +Silk.NET.Maths.Vector2D.Count.get -> int Silk.NET.Maths.Vector2D.Equals(Silk.NET.Maths.Vector2D other) -> bool -Silk.NET.Maths.Vector2D.Length.get -> T -Silk.NET.Maths.Vector2D.LengthSquared.get -> T -Silk.NET.Maths.Vector2D.this[int i].get -> T -Silk.NET.Maths.Vector2D.ToString(string? format) -> string! +Silk.NET.Maths.Vector2D.GetEnumerator() -> System.Collections.Generic.IEnumerator! +Silk.NET.Maths.Vector2D.this[int index].get -> T Silk.NET.Maths.Vector2D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +Silk.NET.Maths.Vector2D.TryFormat(System.Span utf8Destination, out int bytesWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector2D.TryFormat(System.Span destination, out int charsWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool Silk.NET.Maths.Vector2D.Vector2D() -> void +Silk.NET.Maths.Vector2D.Vector2D(System.ReadOnlySpan values) -> void Silk.NET.Maths.Vector2D.Vector2D(T value) -> void Silk.NET.Maths.Vector2D.Vector2D(T x, T y) -> void Silk.NET.Maths.Vector2D.X -> T Silk.NET.Maths.Vector2D.Y -> T Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.extension(Silk.NET.Maths.Vector3D) +Silk.NET.Maths.Vector3D.extension(Silk.NET.Maths.Vector3D).Length.get -> T +Silk.NET.Maths.Vector3D.extension(Silk.NET.Maths.Vector3D).LengthSquared.get -> T Silk.NET.Maths.Vector3D Silk.NET.Maths.Vector3D.As() -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Vector3D.CopyTo(T[]? array) -> void -Silk.NET.Maths.Vector3D.CopyTo(T[]? array, int index) -> void +Silk.NET.Maths.Vector3D.AsChecked() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.AsSaturating() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.AsSpan() -> System.Span +Silk.NET.Maths.Vector3D.AsTruncating() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.CopyTo(System.Span span) -> void +Silk.NET.Maths.Vector3D.CopyTo(System.Span span, int startIndex) -> void +Silk.NET.Maths.Vector3D.CopyTo(T[]! array) -> void +Silk.NET.Maths.Vector3D.CopyTo(T[]! array, int startIndex) -> void +Silk.NET.Maths.Vector3D.Count.get -> int Silk.NET.Maths.Vector3D.Equals(Silk.NET.Maths.Vector3D other) -> bool -Silk.NET.Maths.Vector3D.Length.get -> T -Silk.NET.Maths.Vector3D.LengthSquared.get -> T -Silk.NET.Maths.Vector3D.this[int i].get -> T -Silk.NET.Maths.Vector3D.ToString(string? format) -> string! +Silk.NET.Maths.Vector3D.GetEnumerator() -> System.Collections.Generic.IEnumerator! +Silk.NET.Maths.Vector3D.this[int index].get -> T Silk.NET.Maths.Vector3D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +Silk.NET.Maths.Vector3D.TryFormat(System.Span utf8Destination, out int bytesWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector3D.TryFormat(System.Span destination, out int charsWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool Silk.NET.Maths.Vector3D.Vector3D() -> void -Silk.NET.Maths.Vector3D.Vector3D(Silk.NET.Maths.Vector2D value, T z) -> void +Silk.NET.Maths.Vector3D.Vector3D(Silk.NET.Maths.Vector2D other, T z) -> void +Silk.NET.Maths.Vector3D.Vector3D(System.ReadOnlySpan values) -> void Silk.NET.Maths.Vector3D.Vector3D(T value) -> void Silk.NET.Maths.Vector3D.Vector3D(T x, T y, T z) -> void Silk.NET.Maths.Vector3D.X -> T Silk.NET.Maths.Vector3D.Y -> T Silk.NET.Maths.Vector3D.Z -> T Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.extension(Silk.NET.Maths.Vector4D) +Silk.NET.Maths.Vector4D.extension(Silk.NET.Maths.Vector4D).Length.get -> T +Silk.NET.Maths.Vector4D.extension(Silk.NET.Maths.Vector4D).LengthSquared.get -> T Silk.NET.Maths.Vector4D Silk.NET.Maths.Vector4D.As() -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Vector4D.CopyTo(T[]? array) -> void -Silk.NET.Maths.Vector4D.CopyTo(T[]? array, int index) -> void +Silk.NET.Maths.Vector4D.AsChecked() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.AsSaturating() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.AsSpan() -> System.Span +Silk.NET.Maths.Vector4D.AsTruncating() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.CopyTo(System.Span span) -> void +Silk.NET.Maths.Vector4D.CopyTo(System.Span span, int startIndex) -> void +Silk.NET.Maths.Vector4D.CopyTo(T[]! array) -> void +Silk.NET.Maths.Vector4D.CopyTo(T[]! array, int startIndex) -> void +Silk.NET.Maths.Vector4D.Count.get -> int Silk.NET.Maths.Vector4D.Equals(Silk.NET.Maths.Vector4D other) -> bool -Silk.NET.Maths.Vector4D.Length.get -> T -Silk.NET.Maths.Vector4D.LengthSquared.get -> T -Silk.NET.Maths.Vector4D.this[int i].get -> T -Silk.NET.Maths.Vector4D.ToString(string? format) -> string! +Silk.NET.Maths.Vector4D.GetEnumerator() -> System.Collections.Generic.IEnumerator! +Silk.NET.Maths.Vector4D.this[int index].get -> T Silk.NET.Maths.Vector4D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +Silk.NET.Maths.Vector4D.TryFormat(System.Span utf8Destination, out int bytesWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector4D.TryFormat(System.Span destination, out int charsWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool Silk.NET.Maths.Vector4D.Vector4D() -> void -Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector2D value, T z, T w) -> void -Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector3D value, T w) -> void +Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector2D other, T z, T w) -> void +Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector3D other, T w) -> void +Silk.NET.Maths.Vector4D.Vector4D(System.ReadOnlySpan values) -> void Silk.NET.Maths.Vector4D.Vector4D(T value) -> void Silk.NET.Maths.Vector4D.Vector4D(T x, T y, T z, T w) -> void Silk.NET.Maths.Vector4D.W -> T Silk.NET.Maths.Vector4D.X -> T Silk.NET.Maths.Vector4D.Y -> T Silk.NET.Maths.Vector4D.Z -> T -static readonly Silk.NET.Maths.Scalar.DegreesPerRadian -> T -static readonly Silk.NET.Maths.Scalar.E -> T -static readonly Silk.NET.Maths.Scalar.Epsilon -> T -static readonly Silk.NET.Maths.Scalar.MaxValue -> T -static readonly Silk.NET.Maths.Scalar.MinusOne -> T -static readonly Silk.NET.Maths.Scalar.MinusTwo -> T -static readonly Silk.NET.Maths.Scalar.MinValue -> T -static readonly Silk.NET.Maths.Scalar.NaN -> T -static readonly Silk.NET.Maths.Scalar.NegativeInfinity -> T -static readonly Silk.NET.Maths.Scalar.One -> T -static readonly Silk.NET.Maths.Scalar.Pi -> T -static readonly Silk.NET.Maths.Scalar.PiOver2 -> T -static readonly Silk.NET.Maths.Scalar.PositiveInfinity -> T -static readonly Silk.NET.Maths.Scalar.RadiansPerDegree -> T -static readonly Silk.NET.Maths.Scalar.Tau -> T -static readonly Silk.NET.Maths.Scalar.Two -> T -static readonly Silk.NET.Maths.Scalar.Zero -> T +static Silk.NET.Maths.Box2D.GetDistanceToNearestEdge(this Silk.NET.Maths.Box2D box, Silk.NET.Maths.Vector2D point) -> T static Silk.NET.Maths.Box2D.operator !=(Silk.NET.Maths.Box2D value1, Silk.NET.Maths.Box2D value2) -> bool static Silk.NET.Maths.Box2D.operator ==(Silk.NET.Maths.Box2D value1, Silk.NET.Maths.Box2D value2) -> bool +static Silk.NET.Maths.Box3D.GetDistanceToNearestEdge(this Silk.NET.Maths.Box3D box, Silk.NET.Maths.Vector3D point) -> T static Silk.NET.Maths.Box3D.operator !=(Silk.NET.Maths.Box3D value1, Silk.NET.Maths.Box3D value2) -> bool static Silk.NET.Maths.Box3D.operator ==(Silk.NET.Maths.Box3D value1, Silk.NET.Maths.Box3D value2) -> bool +static Silk.NET.Maths.Circle.Contains(this Silk.NET.Maths.Circle circle, Silk.NET.Maths.Circle other) -> bool +static Silk.NET.Maths.Circle.Contains(this Silk.NET.Maths.Circle circle, Silk.NET.Maths.Vector2D point) -> bool +static Silk.NET.Maths.Circle.GetInflated(this Silk.NET.Maths.Circle circle, Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Circle static Silk.NET.Maths.Circle.operator !=(Silk.NET.Maths.Circle value1, Silk.NET.Maths.Circle value2) -> bool static Silk.NET.Maths.Circle.operator ==(Silk.NET.Maths.Circle value1, Silk.NET.Maths.Circle value2) -> bool +static Silk.NET.Maths.Cube.GetDistanceToNearestEdge(Silk.NET.Maths.Cube cube, Silk.NET.Maths.Vector3D point) -> T static Silk.NET.Maths.Cube.operator !=(Silk.NET.Maths.Cube value1, Silk.NET.Maths.Cube value2) -> bool static Silk.NET.Maths.Cube.operator ==(Silk.NET.Maths.Cube value1, Silk.NET.Maths.Cube value2) -> bool -static Silk.NET.Maths.Matrix2X2.Add(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Lerp(Silk.NET.Maths.Matrix2X2 matrix1, Silk.NET.Maths.Matrix2X2 matrix2, T amount) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 value1, T value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.Add(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Lerp(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2, T amount) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, T right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.Multiply(T left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.Negate(Silk.NET.Maths.Matrix2X2 value) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Subtract(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Subtract(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.CreateChecked(Silk.NET.Maths.Matrix2X2 other) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.CreateSaturating(Silk.NET.Maths.Matrix2X2 other) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.CreateTruncating(Silk.NET.Maths.Matrix2X2 other) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 @@ -744,28 +721,50 @@ static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.Identity.get -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator !=(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> bool -static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 value1, T value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix2X2.operator +(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator !=(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> bool +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 left, T right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.operator *(T left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator +(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 value) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator ==(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> bool -static Silk.NET.Maths.Matrix2X3.Add(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X2.operator ==(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> bool +static Silk.NET.Maths.Matrix2X3.Add(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Lerp(Silk.NET.Maths.Matrix2X3 matrix1, Silk.NET.Maths.Matrix2X3 matrix2, T amount) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, T value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix2X3.Lerp(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2, T amount) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, T right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix2X3.Multiply(T left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.Negate(Silk.NET.Maths.Matrix2X3 value) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Subtract(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Subtract(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.Transform(Silk.NET.Maths.Matrix2X3 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateChecked(Silk.NET.Maths.Matrix2X3 other) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateSaturating(Silk.NET.Maths.Matrix2X3 other) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateTruncating(Silk.NET.Maths.Matrix2X3 other) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 @@ -779,25 +778,46 @@ static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.Identity.get -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator !=(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> bool -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 value1, T value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix2X3.operator +(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator !=(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> bool +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 left, T right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix2X3.operator *(T left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator +(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 value) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator ==(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> bool -static Silk.NET.Maths.Matrix2X4.Add(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Lerp(Silk.NET.Maths.Matrix2X4 matrix1, Silk.NET.Maths.Matrix2X4 matrix2, T amount) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix2X3.operator ==(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> bool +static Silk.NET.Maths.Matrix2X4.Add(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Lerp(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2, T amount) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, T right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix2X4.Multiply(T left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Negate(Silk.NET.Maths.Matrix2X4 value) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Subtract(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.CreateChecked(Silk.NET.Maths.Matrix2X4 other) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.CreateSaturating(Silk.NET.Maths.Matrix2X4 other) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.CreateTruncating(Silk.NET.Maths.Matrix2X4 other) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 @@ -811,18 +831,19 @@ static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 static Silk.NET.Maths.Matrix2X4.Identity.get -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator !=(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> bool -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 value1, T value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix2X4.operator +(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator !=(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> bool +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 left, T right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix2X4.operator *(T left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator +(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 value) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator ==(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> bool -static Silk.NET.Maths.Matrix3X2.Add(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix2X4.operator ==(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> bool +static Silk.NET.Maths.Matrix3X2.Add(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.CreateRotation(T radians) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.CreateRotation(T radians, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.CreateScale(Silk.NET.Maths.Vector2D scales) -> Silk.NET.Maths.Matrix3X2 @@ -836,15 +857,36 @@ static Silk.NET.Maths.Matrix3X2.CreateSkew(T radiansX, T radiansY, Silk.NET.M static Silk.NET.Maths.Matrix3X2.CreateTranslation(Silk.NET.Maths.Vector2D position) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.CreateTranslation(T xPosition, T yPosition) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.Invert(Silk.NET.Maths.Matrix3X2 matrix, out Silk.NET.Maths.Matrix3X2 result) -> bool -static Silk.NET.Maths.Matrix3X2.Lerp(Silk.NET.Maths.Matrix3X2 matrix1, Silk.NET.Maths.Matrix3X2 matrix2, T amount) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, T value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix3X2.Lerp(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2, T amount) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, T right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix3X2.Multiply(T left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.Negate(Silk.NET.Maths.Matrix3X2 value) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Subtract(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Subtract(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateChecked(Silk.NET.Maths.Matrix3X2 other) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateSaturating(Silk.NET.Maths.Matrix3X2 other) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateTruncating(Silk.NET.Maths.Matrix3X2 other) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(System.Numerics.Matrix3x2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked System.Numerics.Matrix3x2(Silk.NET.Maths.Matrix3X2 from) -> System.Numerics.Matrix3x2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 @@ -854,22 +896,24 @@ static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(System.Numerics.Matrix3x2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.explicit operator System.Numerics.Matrix3x2(Silk.NET.Maths.Matrix3X2 from) -> System.Numerics.Matrix3x2 static Silk.NET.Maths.Matrix3X2.Identity.get -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator !=(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> bool -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 value1, T value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix3X2.operator +(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator !=(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> bool +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 left, T right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix3X2.operator *(T left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator +(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 value) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator ==(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> bool -static Silk.NET.Maths.Matrix3X3.Add(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X2.operator ==(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> bool +static Silk.NET.Maths.Matrix3X3.Add(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix3X3 @@ -880,19 +924,35 @@ static Silk.NET.Maths.Matrix3X3.CreateRotationZ(T radians) -> Silk.NET.Maths. static Silk.NET.Maths.Matrix3X3.CreateScale(Silk.NET.Maths.Vector3D scales) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.CreateScale(T scale) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.CreateScale(T xScale, T yScale, T zScale) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Decompose(Silk.NET.Maths.Matrix3X3 matrix, out Silk.NET.Maths.Vector3D scale, out Silk.NET.Maths.Quaternion rotation) -> bool -static Silk.NET.Maths.Matrix3X3.Lerp(Silk.NET.Maths.Matrix3X3 matrix1, Silk.NET.Maths.Matrix3X3 matrix2, T amount) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, T value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.Lerp(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2, T amount) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, T right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.Multiply(T left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.Negate(Silk.NET.Maths.Matrix3X3 value) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Subtract(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Subtract(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.Transform(Silk.NET.Maths.Matrix3X3 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.Transpose(Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateChecked(Silk.NET.Maths.Matrix3X3 other) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateSaturating(Silk.NET.Maths.Matrix3X3 other) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateTruncating(Silk.NET.Maths.Matrix3X3 other) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 @@ -906,24 +966,47 @@ static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.Identity.get -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator !=(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> bool -static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 value1, T value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix3X3.operator +(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator !=(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> bool +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 left, T right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.operator *(T left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator +(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 value) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator ==(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> bool -static Silk.NET.Maths.Matrix3X4.Add(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Lerp(Silk.NET.Maths.Matrix3X4 matrix1, Silk.NET.Maths.Matrix3X4 matrix2, T amount) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 value1, T value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix3X3.operator ==(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> bool +static Silk.NET.Maths.Matrix3X4.Add(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Lerp(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2, T amount) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, T right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix3X4.Multiply(T left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.Negate(Silk.NET.Maths.Matrix3X4 value) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Subtract(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Subtract(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.CreateChecked(Silk.NET.Maths.Matrix3X4 other) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.CreateSaturating(Silk.NET.Maths.Matrix3X4 other) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.CreateTruncating(Silk.NET.Maths.Matrix3X4 other) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 @@ -937,26 +1020,48 @@ static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.Identity.get -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator !=(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> bool -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 value1, T value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix3X4.operator +(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator !=(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> bool +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 left, T right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix3X4.operator *(T left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator +(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 value) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator ==(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> bool -static Silk.NET.Maths.Matrix4X2.Add(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Lerp(Silk.NET.Maths.Matrix4X2 matrix1, Silk.NET.Maths.Matrix4X2 matrix2, T amount) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix3X4.operator ==(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> bool +static Silk.NET.Maths.Matrix4X2.Add(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Lerp(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2, T amount) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, T right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix4X2.Multiply(T left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.Negate(Silk.NET.Maths.Matrix4X2 value) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Subtract(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Subtract(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.CreateChecked(Silk.NET.Maths.Matrix4X2 other) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.CreateSaturating(Silk.NET.Maths.Matrix4X2 other) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.CreateTruncating(Silk.NET.Maths.Matrix4X2 other) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 @@ -970,29 +1075,47 @@ static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.Identity.get -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator !=(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> bool -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, T value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix4X2.operator +(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator !=(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> bool +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, T right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix4X2.operator *(T left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator +(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 value) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator ==(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> bool -static Silk.NET.Maths.Matrix4X3.Add(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Lerp(Silk.NET.Maths.Matrix4X3 matrix1, Silk.NET.Maths.Matrix4X3 matrix2, T amount) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, T value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix4X2.operator ==(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> bool +static Silk.NET.Maths.Matrix4X3.Add(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Lerp(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2, T amount) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, T right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix4X3.Multiply(T left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.Negate(Silk.NET.Maths.Matrix4X3 value) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Subtract(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Subtract(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.CreateChecked(Silk.NET.Maths.Matrix4X3 other) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.CreateSaturating(Silk.NET.Maths.Matrix4X3 other) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.CreateTruncating(Silk.NET.Maths.Matrix4X3 other) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 @@ -1006,16 +1129,20 @@ static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.Identity.get -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator !=(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> bool -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 value1, T value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix4X3.operator +(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator !=(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> bool +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, T right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix4X3.operator *(T left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator +(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 value) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator ==(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> bool -static Silk.NET.Maths.Matrix4X4.Add(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X3.operator ==(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> bool +static Silk.NET.Maths.Matrix4X4.Add(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.CreateConstrainedBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D rotateAxis, Silk.NET.Maths.Vector3D cameraForwardVector, Silk.NET.Maths.Vector3D objectForwardVector) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix4X4 @@ -1044,18 +1171,39 @@ static Silk.NET.Maths.Matrix4X4.CreateShadow(Silk.NET.Maths.Vector3D light static Silk.NET.Maths.Matrix4X4.CreateTranslation(Silk.NET.Maths.Vector3D position) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.CreateTranslation(T xPosition, T yPosition, T zPosition) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.CreateWorld(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Vector3D forward, Silk.NET.Maths.Vector3D up) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Decompose(Silk.NET.Maths.Matrix4X4 matrix, out Silk.NET.Maths.Vector3D scale, out Silk.NET.Maths.Quaternion rotation, out Silk.NET.Maths.Vector3D translation) -> bool static Silk.NET.Maths.Matrix4X4.Invert(Silk.NET.Maths.Matrix4X4 matrix, out Silk.NET.Maths.Matrix4X4 result) -> bool -static Silk.NET.Maths.Matrix4X4.Lerp(Silk.NET.Maths.Matrix4X4 matrix1, Silk.NET.Maths.Matrix4X4 matrix2, T amount) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 value1, T value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.Lerp(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2, T amount) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, T right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.Multiply(T left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.Negate(Silk.NET.Maths.Matrix4X4 value) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Subtract(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Subtract(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.Transform(Silk.NET.Maths.Matrix4X4 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.Transpose(Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateChecked(Silk.NET.Maths.Matrix4X4 other) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateSaturating(Silk.NET.Maths.Matrix4X4 other) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateTruncating(Silk.NET.Maths.Matrix4X4 other) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(System.Numerics.Matrix4x4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked System.Numerics.Matrix4x4(Silk.NET.Maths.Matrix4X4 from) -> System.Numerics.Matrix4x4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 @@ -1065,26 +1213,49 @@ static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(System.Numerics.Matrix4x4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator System.Numerics.Matrix4x4(Silk.NET.Maths.Matrix4X4 from) -> System.Numerics.Matrix4x4 static Silk.NET.Maths.Matrix4X4.Identity.get -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator !=(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> bool -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 value1, T value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix4X4.operator +(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator !=(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> bool +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, T right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.operator *(T left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator +(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 value) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator ==(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> bool -static Silk.NET.Maths.Matrix5X4.Add(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Lerp(Silk.NET.Maths.Matrix5X4 matrix1, Silk.NET.Maths.Matrix5X4 matrix2, T amount) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Matrix5X4 value1, T value2) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix4X4.operator ==(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> bool +static Silk.NET.Maths.Matrix5X4.Add(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Lerp(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2, T amount) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Matrix5X4 left, T right) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix5X4.Multiply(T left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.Negate(Silk.NET.Maths.Matrix5X4 value) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Subtract(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Subtract(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.CreateChecked(Silk.NET.Maths.Matrix5X4 other) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.CreateSaturating(Silk.NET.Maths.Matrix5X4 other) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.CreateTruncating(Silk.NET.Maths.Matrix5X4 other) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 @@ -1098,13 +1269,15 @@ static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.Identity.get -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator !=(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> bool -static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Matrix5X4 value1, T value2) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator !=(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> bool +static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Matrix5X4 left, T right) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix5X4.operator +(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator *(T left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator +(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 value) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator ==(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> bool +static Silk.NET.Maths.Matrix5X4.operator ==(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> bool static Silk.NET.Maths.Plane.CreateFromVertices(Silk.NET.Maths.Vector3D point1, Silk.NET.Maths.Vector3D point2, Silk.NET.Maths.Vector3D point3) -> Silk.NET.Maths.Plane static Silk.NET.Maths.Plane.Dot(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector4D value) -> T static Silk.NET.Maths.Plane.DotCoordinate(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector3D value) -> T @@ -1136,18 +1309,9 @@ static Silk.NET.Maths.Quaternion.CreateFromRotationMatrix(Silk.NET.Maths.Matr static Silk.NET.Maths.Quaternion.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.Divide(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.Dot(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2) -> T -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.explicit operator System.Numerics.Quaternion(Silk.NET.Maths.Quaternion from) -> System.Numerics.Quaternion static Silk.NET.Maths.Quaternion.Identity.get -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.Inverse(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion @@ -1156,14 +1320,14 @@ static Silk.NET.Maths.Quaternion.Multiply(Silk.NET.Maths.Quaternion value1 static Silk.NET.Maths.Quaternion.Multiply(Silk.NET.Maths.Quaternion value1, T value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.Negate(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.Normalize(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator !=(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> bool +static Silk.NET.Maths.Quaternion.operator !=(Silk.NET.Maths.Quaternion left, Silk.NET.Maths.Quaternion right) -> bool static Silk.NET.Maths.Quaternion.operator *(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.operator *(Silk.NET.Maths.Quaternion value1, T value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.operator +(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.operator -(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.operator -(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.operator /(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator ==(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> bool +static Silk.NET.Maths.Quaternion.operator ==(Silk.NET.Maths.Quaternion left, Silk.NET.Maths.Quaternion right) -> bool static Silk.NET.Maths.Quaternion.Slerp(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2, T amount) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Quaternion.Subtract(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion static Silk.NET.Maths.Ray2D.operator !=(Silk.NET.Maths.Ray2D value1, Silk.NET.Maths.Ray2D value2) -> bool @@ -1171,72 +1335,12 @@ static Silk.NET.Maths.Ray2D.operator ==(Silk.NET.Maths.Ray2D value1, Silk. static Silk.NET.Maths.Ray3D.operator !=(Silk.NET.Maths.Ray3D value1, Silk.NET.Maths.Ray3D value2) -> bool static Silk.NET.Maths.Ray3D.operator ==(Silk.NET.Maths.Ray3D value1, Silk.NET.Maths.Ray3D value2) -> bool static Silk.NET.Maths.Rectangle.FromLTRB(T left, T top, T right, T bottom) -> Silk.NET.Maths.Rectangle +static Silk.NET.Maths.Rectangle.GetDistanceToNearestEdge(this Silk.NET.Maths.Rectangle rectangle, Silk.NET.Maths.Vector2D point) -> T static Silk.NET.Maths.Rectangle.operator !=(Silk.NET.Maths.Rectangle value1, Silk.NET.Maths.Rectangle value2) -> bool static Silk.NET.Maths.Rectangle.operator ==(Silk.NET.Maths.Rectangle value1, Silk.NET.Maths.Rectangle value2) -> bool -static Silk.NET.Maths.Scalar.Abs(T x) -> T -static Silk.NET.Maths.Scalar.Acos(T x) -> T -static Silk.NET.Maths.Scalar.Acosh(T x) -> T -static Silk.NET.Maths.Scalar.Add(T left, T right) -> T -static Silk.NET.Maths.Scalar.And(T left, T right) -> T -static Silk.NET.Maths.Scalar.As(TFrom val) -> TTo -static Silk.NET.Maths.Scalar.Asin(T x) -> T -static Silk.NET.Maths.Scalar.Asinh(T x) -> T -static Silk.NET.Maths.Scalar.Atan2(T y, T x) -> T -static Silk.NET.Maths.Scalar.Atan(T x) -> T -static Silk.NET.Maths.Scalar.Atanh(T x) -> T -static Silk.NET.Maths.Scalar.Cbrt(T x) -> T -static Silk.NET.Maths.Scalar.Ceiling(T x) -> T -static Silk.NET.Maths.Scalar.Cos(T x) -> T -static Silk.NET.Maths.Scalar.Cosh(T x) -> T -static Silk.NET.Maths.Scalar.DegreesToRadians(T degrees) -> T -static Silk.NET.Maths.Scalar.Divide(T left, T right) -> T -static Silk.NET.Maths.Scalar.Equal(T left, T right) -> bool -static Silk.NET.Maths.Scalar.Exp(T x) -> T -static Silk.NET.Maths.Scalar.Floor(T x) -> T -static Silk.NET.Maths.Scalar.GreaterThan(T left, T right) -> bool -static Silk.NET.Maths.Scalar.GreaterThanOrEqual(T left, T right) -> bool -static Silk.NET.Maths.Scalar.IEEERemainder(T x, T y) -> T -static Silk.NET.Maths.Scalar.IsFinite(T f) -> bool -static Silk.NET.Maths.Scalar.IsHardwareAccelerated.get -> bool -static Silk.NET.Maths.Scalar.IsInfinity(T f) -> bool -static Silk.NET.Maths.Scalar.IsNaN(T f) -> bool -static Silk.NET.Maths.Scalar.IsNegative(T f) -> bool -static Silk.NET.Maths.Scalar.IsNegativeInfinity(T f) -> bool -static Silk.NET.Maths.Scalar.IsNormal(T f) -> bool -static Silk.NET.Maths.Scalar.IsPositiveInfinity(T f) -> bool -static Silk.NET.Maths.Scalar.IsSubnormal(T f) -> bool -static Silk.NET.Maths.Scalar.LessThan(T left, T right) -> bool -static Silk.NET.Maths.Scalar.LessThanOrEqual(T left, T right) -> bool -static Silk.NET.Maths.Scalar.Log10(T x) -> T -static Silk.NET.Maths.Scalar.Log(T x) -> T -static Silk.NET.Maths.Scalar.Log(T x, T y) -> T -static Silk.NET.Maths.Scalar.Max(T x, T y) -> T -static Silk.NET.Maths.Scalar.Min(T x, T y) -> T -static Silk.NET.Maths.Scalar.Multiply(T left, T right) -> T -static Silk.NET.Maths.Scalar.Negate(T x) -> T -static Silk.NET.Maths.Scalar.Not(T value) -> T -static Silk.NET.Maths.Scalar.NotEqual(T left, T right) -> bool -static Silk.NET.Maths.Scalar.Or(T left, T right) -> T -static Silk.NET.Maths.Scalar.Pow(T x, T y) -> T -static Silk.NET.Maths.Scalar.RadiansToDegrees(T radians) -> T -static Silk.NET.Maths.Scalar.Reciprocal(T x) -> T -static Silk.NET.Maths.Scalar.RotateLeft(T value, int offset) -> T -static Silk.NET.Maths.Scalar.RotateRight(T value, int offset) -> T -static Silk.NET.Maths.Scalar.Round(T x) -> T -static Silk.NET.Maths.Scalar.Round(T x, int digits) -> T -static Silk.NET.Maths.Scalar.Round(T x, int digits, System.MidpointRounding mode) -> T -static Silk.NET.Maths.Scalar.Round(T x, System.MidpointRounding mode) -> T -static Silk.NET.Maths.Scalar.ShiftLeft(T value, int offset) -> T -static Silk.NET.Maths.Scalar.ShiftRight(T value, int offset) -> T -static Silk.NET.Maths.Scalar.Sign(T x) -> int -static Silk.NET.Maths.Scalar.Sin(T x) -> T -static Silk.NET.Maths.Scalar.Sinh(T x) -> T -static Silk.NET.Maths.Scalar.Sqrt(T x) -> T -static Silk.NET.Maths.Scalar.Subtract(T left, T right) -> T -static Silk.NET.Maths.Scalar.Tan(T x) -> T -static Silk.NET.Maths.Scalar.Tanh(T x) -> T -static Silk.NET.Maths.Scalar.Truncate(T x) -> T -static Silk.NET.Maths.Scalar.Xor(T left, T right) -> T +static Silk.NET.Maths.Sphere.Contains(this Silk.NET.Maths.Sphere sphere, Silk.NET.Maths.Sphere other) -> bool +static Silk.NET.Maths.Sphere.Contains(this Silk.NET.Maths.Sphere sphere, Silk.NET.Maths.Vector3D point) -> bool +static Silk.NET.Maths.Sphere.GetInflated(this Silk.NET.Maths.Sphere sphere, Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Sphere static Silk.NET.Maths.Sphere.operator !=(Silk.NET.Maths.Sphere value1, Silk.NET.Maths.Sphere value2) -> bool static Silk.NET.Maths.Sphere.operator ==(Silk.NET.Maths.Sphere value1, Silk.NET.Maths.Sphere value2) -> bool static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Matrix3x2 value) -> Silk.NET.Maths.Matrix3X2 @@ -1253,33 +1357,128 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quat static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D value) -> System.Numerics.Vector2 static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D value) -> System.Numerics.Vector3 static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D value) -> System.Numerics.Vector4 -static Silk.NET.Maths.Vector2D.Abs(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Add(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Clamp(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Abs(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Acos(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Acosh(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.AcosPi(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Asin(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Asinh(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.AsinPi(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atan2(Silk.NET.Maths.Vector2D y, Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atan2Pi(Silk.NET.Maths.Vector2D y, Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atan(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atanh(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.AtanPi(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.BitDecrement(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.BitIncrement(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cbrt(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Ceiling(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Clamp(Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Clamp(Silk.NET.Maths.Vector2D value, TSelf min, TSelf max) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CopySign(Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Vector2D sign) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CopySign(Silk.NET.Maths.Vector2D value, TSelf sign) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cos(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cosh(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CosPi(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cross(this Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> T +static Silk.NET.Maths.Vector2D.Deconstruct(this Silk.NET.Maths.Vector2D vector, out T x, out T y) -> void +static Silk.NET.Maths.Vector2D.DegreesToRadians(Silk.NET.Maths.Vector2D degrees) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.Distance(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T static Silk.NET.Maths.Vector2D.DistanceSquared(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T -static Silk.NET.Maths.Vector2D.Divide(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Divide(Silk.NET.Maths.Vector2D left, T divisor) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Dot(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T -static Silk.NET.Maths.Vector2D.Lerp(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2, T amount) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Max(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Min(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.DivRem(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> (Silk.NET.Maths.Vector2D Quotient, Silk.NET.Maths.Vector2D Remainder) +static Silk.NET.Maths.Vector2D.Dot(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> T +static Silk.NET.Maths.Vector2D.Exp10(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp10M1(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp2(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp2M1(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ExpM1(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Floor(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right, Silk.NET.Maths.Vector2D addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right, TSelf addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(Silk.NET.Maths.Vector2D left, TSelf right, Silk.NET.Maths.Vector2D addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(Silk.NET.Maths.Vector2D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.get_Length(Silk.NET.Maths.Vector2D vector) -> T +static Silk.NET.Maths.Vector2D.get_LengthSquared(Silk.NET.Maths.Vector2D vector) -> T +static Silk.NET.Maths.Vector2D.Hypot(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Hypot(Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Ieee754Remainder(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Ieee754Remainder(Silk.NET.Maths.Vector2D left, TSelf right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ILogB(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Lerp(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2, TSelf amount) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.LerpClamped(Silk.NET.Maths.Vector2D a, Silk.NET.Maths.Vector2D b, Silk.NET.Maths.Vector2D amount) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.LerpClamped(Silk.NET.Maths.Vector2D a, Silk.NET.Maths.Vector2D b, T amount) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log10(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log10P1(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log2(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log2P1(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D newBase) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log(Silk.NET.Maths.Vector2D x, TSelf newBase) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.LogP1(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Max(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Max(Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxMagnitude(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxMagnitudeNumber(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxNumber(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxNumber(Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Min(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Min(Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinMagnitude(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinMagnitudeNumber(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinNumber(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinNumber(Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D left, T right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector2D.Multiply(T left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Negate(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Normalize(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MultiplyAddEstimate(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right, Silk.NET.Maths.Vector2D addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MultiplyAddEstimate(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right, TSelf addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MultiplyAddEstimate(Silk.NET.Maths.Vector2D left, TSelf right, Silk.NET.Maths.Vector2D addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MultiplyAddEstimate(Silk.NET.Maths.Vector2D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Normalize(this Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.PopCount(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Pow(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Pow(Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.RadiansToDegrees(Silk.NET.Maths.Vector2D radians) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ReciprocalEstimate(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ReciprocalSqrtEstimate(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.Reflect(Silk.NET.Maths.Vector2D vector, Silk.NET.Maths.Vector2D normal) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.SquareRoot(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Subtract(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Transform(Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Transform(Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Transform(Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.TransformNormal(Silk.NET.Maths.Vector2D normal, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.TransformNormal(Silk.NET.Maths.Vector2D normal, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.RootN(Silk.NET.Maths.Vector2D x, int n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.RootN(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(Silk.NET.Maths.Vector2D x, int digits) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(Silk.NET.Maths.Vector2D x, int digits, System.MidpointRounding mode) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(Silk.NET.Maths.Vector2D x, System.MidpointRounding mode) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ScaleB(Silk.NET.Maths.Vector2D x, int n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ScaleB(Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Sign(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Sin(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.SinCos(Silk.NET.Maths.Vector2D x) -> (Silk.NET.Maths.Vector2D Sin, Silk.NET.Maths.Vector2D Cos) +static Silk.NET.Maths.Vector2D.SinCosPi(Silk.NET.Maths.Vector2D x) -> (Silk.NET.Maths.Vector2D SinPi, Silk.NET.Maths.Vector2D CosPi) +static Silk.NET.Maths.Vector2D.Sinh(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.SinPi(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Sqrt(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Tan(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Tanh(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.TanPi(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.TrailingZeroCount(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Truncate(Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CreateChecked(Silk.NET.Maths.Vector2D source) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CreateSaturating(Silk.NET.Maths.Vector2D source) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CreateTruncating(Silk.NET.Maths.Vector2D source) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(System.Numerics.Vector2 from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked System.Numerics.Vector2(Silk.NET.Maths.Vector2D from) -> System.Numerics.Vector2 static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D @@ -1289,50 +1488,158 @@ static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(System.Numerics.Vector2 from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.explicit operator System.Numerics.Vector2(Silk.NET.Maths.Vector2D from) -> System.Numerics.Vector2 +static Silk.NET.Maths.Vector2D.implicit operator (T X, T Y)(Silk.NET.Maths.Vector2D v) -> (T X, T Y) +static Silk.NET.Maths.Vector2D.implicit operator Silk.NET.Maths.Vector2D((T X, T Y) v) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.One.get -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.operator !=(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> bool static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D left, T right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator *(T left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator *(T scalar, Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D value1, T value2) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.operator ==(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> bool +static Silk.NET.Maths.Vector2D.Parse(string! s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Parse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.TryParse(string? s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector2D result) -> bool +static Silk.NET.Maths.Vector2D.TryParse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider, out Silk.NET.Maths.Vector2D result) -> bool +static Silk.NET.Maths.Vector2D.TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector2D result) -> bool static Silk.NET.Maths.Vector2D.UnitX.get -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.UnitY.get -> Silk.NET.Maths.Vector2D static Silk.NET.Maths.Vector2D.Zero.get -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector3D.Abs(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Add(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Clamp(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D min, Silk.NET.Maths.Vector3D max) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Cross(Silk.NET.Maths.Vector3D vector1, Silk.NET.Maths.Vector3D vector2) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Abs(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Acos(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Acosh(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.AcosPi(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Asin(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Asinh(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.AsinPi(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atan2(Silk.NET.Maths.Vector3D y, Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atan2Pi(Silk.NET.Maths.Vector3D y, Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atan(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atanh(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.AtanPi(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.BitDecrement(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.BitIncrement(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cbrt(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Ceiling(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Clamp(Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Vector3D min, Silk.NET.Maths.Vector3D max) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Clamp(Silk.NET.Maths.Vector3D value, TSelf min, TSelf max) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CopySign(Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Vector3D sign) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CopySign(Silk.NET.Maths.Vector3D value, TSelf sign) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cos(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cosh(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CosPi(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cross(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Deconstruct(this Silk.NET.Maths.Vector3D vector, out T x, out T y, out T z) -> void +static Silk.NET.Maths.Vector3D.DegreesToRadians(Silk.NET.Maths.Vector3D degrees) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.Distance(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> T static Silk.NET.Maths.Vector3D.DistanceSquared(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> T -static Silk.NET.Maths.Vector3D.Divide(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Divide(Silk.NET.Maths.Vector3D left, T divisor) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Dot(Silk.NET.Maths.Vector3D vector1, Silk.NET.Maths.Vector3D vector2) -> T -static Silk.NET.Maths.Vector3D.Lerp(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2, T amount) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Max(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Min(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.DivRem(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> (Silk.NET.Maths.Vector3D Quotient, Silk.NET.Maths.Vector3D Remainder) +static Silk.NET.Maths.Vector3D.Dot(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> T +static Silk.NET.Maths.Vector3D.Exp10(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp10M1(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp2(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp2M1(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ExpM1(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Floor(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right, Silk.NET.Maths.Vector3D addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right, TSelf addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(Silk.NET.Maths.Vector3D left, TSelf right, Silk.NET.Maths.Vector3D addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(Silk.NET.Maths.Vector3D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.get_Length(Silk.NET.Maths.Vector3D vector) -> T +static Silk.NET.Maths.Vector3D.get_LengthSquared(Silk.NET.Maths.Vector3D vector) -> T +static Silk.NET.Maths.Vector3D.Hypot(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Hypot(Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Ieee754Remainder(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Ieee754Remainder(Silk.NET.Maths.Vector3D left, TSelf right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ILogB(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Lerp(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2, TSelf amount) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.LerpClamped(Silk.NET.Maths.Vector3D a, Silk.NET.Maths.Vector3D b, Silk.NET.Maths.Vector3D amount) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.LerpClamped(Silk.NET.Maths.Vector3D a, Silk.NET.Maths.Vector3D b, T amount) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log10(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log10P1(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log2(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log2P1(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D newBase) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log(Silk.NET.Maths.Vector3D x, TSelf newBase) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.LogP1(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Max(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Max(Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxMagnitude(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxMagnitudeNumber(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxNumber(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxNumber(Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Min(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Min(Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinMagnitude(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinMagnitudeNumber(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinNumber(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinNumber(Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D left, T right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector3D.Multiply(T left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Negate(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Normalize(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MultiplyAddEstimate(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right, Silk.NET.Maths.Vector3D addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MultiplyAddEstimate(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right, TSelf addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MultiplyAddEstimate(Silk.NET.Maths.Vector3D left, TSelf right, Silk.NET.Maths.Vector3D addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MultiplyAddEstimate(Silk.NET.Maths.Vector3D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Normalize(this Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.PopCount(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Pow(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Pow(Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.RadiansToDegrees(Silk.NET.Maths.Vector3D radians) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ReciprocalEstimate(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ReciprocalSqrtEstimate(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.Reflect(Silk.NET.Maths.Vector3D vector, Silk.NET.Maths.Vector3D normal) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.SquareRoot(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Subtract(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Transform(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Transform(Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.TransformNormal(Silk.NET.Maths.Vector3D normal, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.RootN(Silk.NET.Maths.Vector3D x, int n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.RootN(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(Silk.NET.Maths.Vector3D x, int digits) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(Silk.NET.Maths.Vector3D x, int digits, System.MidpointRounding mode) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(Silk.NET.Maths.Vector3D x, System.MidpointRounding mode) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ScaleB(Silk.NET.Maths.Vector3D x, int n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ScaleB(Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Sign(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Sin(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.SinCos(Silk.NET.Maths.Vector3D x) -> (Silk.NET.Maths.Vector3D Sin, Silk.NET.Maths.Vector3D Cos) +static Silk.NET.Maths.Vector3D.SinCosPi(Silk.NET.Maths.Vector3D x) -> (Silk.NET.Maths.Vector3D SinPi, Silk.NET.Maths.Vector3D CosPi) +static Silk.NET.Maths.Vector3D.Sinh(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.SinPi(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Sqrt(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Tan(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Tanh(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.TanPi(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.TrailingZeroCount(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Truncate(Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CreateChecked(Silk.NET.Maths.Vector3D source) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CreateSaturating(Silk.NET.Maths.Vector3D source) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CreateTruncating(Silk.NET.Maths.Vector3D source) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(System.Numerics.Vector3 from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked System.Numerics.Vector3(Silk.NET.Maths.Vector3D from) -> System.Numerics.Vector3 static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D @@ -1342,52 +1649,158 @@ static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(System.Numerics.Vector3 from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.explicit operator System.Numerics.Vector3(Silk.NET.Maths.Vector3D from) -> System.Numerics.Vector3 +static Silk.NET.Maths.Vector3D.implicit operator (T X, T Y, T Z)(Silk.NET.Maths.Vector3D v) -> (T X, T Y, T Z) +static Silk.NET.Maths.Vector3D.implicit operator Silk.NET.Maths.Vector3D((T X, T Y, T Z) v) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.One.get -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.operator !=(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> bool static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D left, T right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator *(T left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator *(T scalar, Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D value1, T value2) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.operator ==(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> bool +static Silk.NET.Maths.Vector3D.Parse(string! s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Parse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.TryParse(string? s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector3D result) -> bool +static Silk.NET.Maths.Vector3D.TryParse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider, out Silk.NET.Maths.Vector3D result) -> bool +static Silk.NET.Maths.Vector3D.TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector3D result) -> bool static Silk.NET.Maths.Vector3D.UnitX.get -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.UnitY.get -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.UnitZ.get -> Silk.NET.Maths.Vector3D static Silk.NET.Maths.Vector3D.Zero.get -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector4D.Abs(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Add(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Clamp(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D min, Silk.NET.Maths.Vector4D max) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Abs(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Acos(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Acosh(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.AcosPi(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Asin(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Asinh(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.AsinPi(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atan2(Silk.NET.Maths.Vector4D y, Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atan2Pi(Silk.NET.Maths.Vector4D y, Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atan(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atanh(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.AtanPi(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.BitDecrement(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.BitIncrement(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Cbrt(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Ceiling(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Clamp(Silk.NET.Maths.Vector4D value, Silk.NET.Maths.Vector4D min, Silk.NET.Maths.Vector4D max) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Clamp(Silk.NET.Maths.Vector4D value, TSelf min, TSelf max) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CopySign(Silk.NET.Maths.Vector4D value, Silk.NET.Maths.Vector4D sign) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CopySign(Silk.NET.Maths.Vector4D value, TSelf sign) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Cos(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Cosh(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CosPi(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Deconstruct(this Silk.NET.Maths.Vector4D vector, out T x, out T y, out T z, out T w) -> void +static Silk.NET.Maths.Vector4D.DegreesToRadians(Silk.NET.Maths.Vector4D degrees) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.Distance(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> T static Silk.NET.Maths.Vector4D.DistanceSquared(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> T -static Silk.NET.Maths.Vector4D.Divide(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Divide(Silk.NET.Maths.Vector4D left, T divisor) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Dot(Silk.NET.Maths.Vector4D vector1, Silk.NET.Maths.Vector4D vector2) -> T -static Silk.NET.Maths.Vector4D.Lerp(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2, T amount) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Max(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Min(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.DivRem(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> (Silk.NET.Maths.Vector4D Quotient, Silk.NET.Maths.Vector4D Remainder) +static Silk.NET.Maths.Vector4D.Dot(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> T +static Silk.NET.Maths.Vector4D.Exp10(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp10M1(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp2(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp2M1(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ExpM1(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Floor(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right, Silk.NET.Maths.Vector4D addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right, TSelf addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(Silk.NET.Maths.Vector4D left, TSelf right, Silk.NET.Maths.Vector4D addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(Silk.NET.Maths.Vector4D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.get_Length(Silk.NET.Maths.Vector4D vector) -> T +static Silk.NET.Maths.Vector4D.get_LengthSquared(Silk.NET.Maths.Vector4D vector) -> T +static Silk.NET.Maths.Vector4D.Hypot(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Hypot(Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Ieee754Remainder(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Ieee754Remainder(Silk.NET.Maths.Vector4D left, TSelf right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ILogB(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Lerp(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2, TSelf amount) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.LerpClamped(Silk.NET.Maths.Vector4D a, Silk.NET.Maths.Vector4D b, Silk.NET.Maths.Vector4D amount) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.LerpClamped(Silk.NET.Maths.Vector4D a, Silk.NET.Maths.Vector4D b, T amount) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log10(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log10P1(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log2(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log2P1(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D newBase) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log(Silk.NET.Maths.Vector4D x, TSelf newBase) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.LogP1(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Max(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Max(Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxMagnitude(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxMagnitudeNumber(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxNumber(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxNumber(Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Min(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Min(Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinMagnitude(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinMagnitudeNumber(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinNumber(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinNumber(Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D left, T right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.Multiply(T left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Negate(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Normalize(Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.SquareRoot(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Subtract(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector4D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector4D vector, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MultiplyAddEstimate(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right, Silk.NET.Maths.Vector4D addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MultiplyAddEstimate(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right, TSelf addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MultiplyAddEstimate(Silk.NET.Maths.Vector4D left, TSelf right, Silk.NET.Maths.Vector4D addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MultiplyAddEstimate(Silk.NET.Maths.Vector4D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Normalize(this Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.PopCount(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Pow(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Pow(Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.RadiansToDegrees(Silk.NET.Maths.Vector4D radians) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ReciprocalEstimate(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ReciprocalSqrtEstimate(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Reflect(Silk.NET.Maths.Vector4D vector, Silk.NET.Maths.Vector4D normal) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.RootN(Silk.NET.Maths.Vector4D x, int n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.RootN(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(Silk.NET.Maths.Vector4D x, int digits) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(Silk.NET.Maths.Vector4D x, int digits, System.MidpointRounding mode) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(Silk.NET.Maths.Vector4D x, System.MidpointRounding mode) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ScaleB(Silk.NET.Maths.Vector4D x, int n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ScaleB(Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Sign(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Sin(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.SinCos(Silk.NET.Maths.Vector4D x) -> (Silk.NET.Maths.Vector4D Sin, Silk.NET.Maths.Vector4D Cos) +static Silk.NET.Maths.Vector4D.SinCosPi(Silk.NET.Maths.Vector4D x) -> (Silk.NET.Maths.Vector4D SinPi, Silk.NET.Maths.Vector4D CosPi) +static Silk.NET.Maths.Vector4D.Sinh(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.SinPi(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Sqrt(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Tan(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Tanh(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.TanPi(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.TrailingZeroCount(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Truncate(Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CreateChecked(Silk.NET.Maths.Vector4D source) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CreateSaturating(Silk.NET.Maths.Vector4D source) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CreateTruncating(Silk.NET.Maths.Vector4D source) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(System.Numerics.Vector4 from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked System.Numerics.Vector4(Silk.NET.Maths.Vector4D from) -> System.Numerics.Vector4 static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D @@ -1397,21 +1810,33 @@ static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(System.Numerics.Vector4 from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.explicit operator System.Numerics.Vector4(Silk.NET.Maths.Vector4D from) -> System.Numerics.Vector4 +static Silk.NET.Maths.Vector4D.implicit operator (T X, T Y, T Z, T W)(Silk.NET.Maths.Vector4D v) -> (T X, T Y, T Z, T W) +static Silk.NET.Maths.Vector4D.implicit operator Silk.NET.Maths.Vector4D((T X, T Y, T Z, T W) v) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.One.get -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.operator !=(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> bool static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D left, T right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator *(T left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator *(T scalar, Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D value1, T value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.operator ==(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> bool +static Silk.NET.Maths.Vector4D.Parse(string! s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Parse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.TryParse(string? s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector4D result) -> bool +static Silk.NET.Maths.Vector4D.TryParse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider, out Silk.NET.Maths.Vector4D result) -> bool +static Silk.NET.Maths.Vector4D.TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector4D result) -> bool static Silk.NET.Maths.Vector4D.UnitW.get -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.UnitX.get -> Silk.NET.Maths.Vector4D static Silk.NET.Maths.Vector4D.UnitY.get -> Silk.NET.Maths.Vector4D diff --git a/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Shipped.txt b/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Shipped.txt index 3552eec334..7dc5c58110 100644 --- a/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Shipped.txt +++ b/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Shipped.txt @@ -1,1419 +1 @@ #nullable enable -override Silk.NET.Maths.Box2D.Equals(object? obj) -> bool -override Silk.NET.Maths.Box2D.GetHashCode() -> int -override Silk.NET.Maths.Box3D.Equals(object? obj) -> bool -override Silk.NET.Maths.Box3D.GetHashCode() -> int -override Silk.NET.Maths.Circle.Equals(object? obj) -> bool -override Silk.NET.Maths.Circle.GetHashCode() -> int -override Silk.NET.Maths.Cube.Equals(object? obj) -> bool -override Silk.NET.Maths.Cube.GetHashCode() -> int -override Silk.NET.Maths.Matrix2X2.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix2X2.GetHashCode() -> int -override Silk.NET.Maths.Matrix2X2.ToString() -> string! -override Silk.NET.Maths.Matrix2X3.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix2X3.GetHashCode() -> int -override Silk.NET.Maths.Matrix2X3.ToString() -> string! -override Silk.NET.Maths.Matrix2X4.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix2X4.GetHashCode() -> int -override Silk.NET.Maths.Matrix2X4.ToString() -> string! -override Silk.NET.Maths.Matrix3X2.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix3X2.GetHashCode() -> int -override Silk.NET.Maths.Matrix3X2.ToString() -> string! -override Silk.NET.Maths.Matrix3X3.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix3X3.GetHashCode() -> int -override Silk.NET.Maths.Matrix3X3.ToString() -> string! -override Silk.NET.Maths.Matrix3X4.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix3X4.GetHashCode() -> int -override Silk.NET.Maths.Matrix3X4.ToString() -> string! -override Silk.NET.Maths.Matrix4X2.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix4X2.GetHashCode() -> int -override Silk.NET.Maths.Matrix4X2.ToString() -> string! -override Silk.NET.Maths.Matrix4X3.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix4X3.GetHashCode() -> int -override Silk.NET.Maths.Matrix4X3.ToString() -> string! -override Silk.NET.Maths.Matrix4X4.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix4X4.GetHashCode() -> int -override Silk.NET.Maths.Matrix4X4.ToString() -> string! -override Silk.NET.Maths.Matrix5X4.Equals(object? obj) -> bool -override Silk.NET.Maths.Matrix5X4.GetHashCode() -> int -override Silk.NET.Maths.Matrix5X4.ToString() -> string! -override Silk.NET.Maths.Plane.Equals(object? obj) -> bool -override Silk.NET.Maths.Plane.GetHashCode() -> int -override Silk.NET.Maths.Plane.ToString() -> string! -override Silk.NET.Maths.Quaternion.Equals(object? obj) -> bool -override Silk.NET.Maths.Quaternion.GetHashCode() -> int -override Silk.NET.Maths.Quaternion.ToString() -> string! -override Silk.NET.Maths.Ray2D.Equals(object? obj) -> bool -override Silk.NET.Maths.Ray2D.GetHashCode() -> int -override Silk.NET.Maths.Ray3D.Equals(object? obj) -> bool -override Silk.NET.Maths.Ray3D.GetHashCode() -> int -override Silk.NET.Maths.Rectangle.Equals(object? obj) -> bool -override Silk.NET.Maths.Rectangle.GetHashCode() -> int -override Silk.NET.Maths.Sphere.Equals(object? obj) -> bool -override Silk.NET.Maths.Sphere.GetHashCode() -> int -override Silk.NET.Maths.Vector2D.Equals(object? obj) -> bool -override Silk.NET.Maths.Vector2D.GetHashCode() -> int -override Silk.NET.Maths.Vector2D.ToString() -> string! -override Silk.NET.Maths.Vector3D.Equals(object? obj) -> bool -override Silk.NET.Maths.Vector3D.GetHashCode() -> int -override Silk.NET.Maths.Vector3D.ToString() -> string! -override Silk.NET.Maths.Vector4D.Equals(object? obj) -> bool -override Silk.NET.Maths.Vector4D.GetHashCode() -> int -override Silk.NET.Maths.Vector4D.ToString() -> string! -Silk.NET.Maths.Box2D -Silk.NET.Maths.Box2D.As() -> Silk.NET.Maths.Box2D -Silk.NET.Maths.Box2D.Box2D() -> void -Silk.NET.Maths.Box2D.Box2D(Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> void -Silk.NET.Maths.Box2D.Box2D(Silk.NET.Maths.Vector2D min, T maxX, T maxY) -> void -Silk.NET.Maths.Box2D.Box2D(T minX, T minY, Silk.NET.Maths.Vector2D max) -> void -Silk.NET.Maths.Box2D.Box2D(T minX, T minY, T maxX, T maxY) -> void -Silk.NET.Maths.Box2D.Center.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Box2D.Contains(Silk.NET.Maths.Box2D other) -> bool -Silk.NET.Maths.Box2D.Contains(Silk.NET.Maths.Vector2D point) -> bool -Silk.NET.Maths.Box2D.Equals(Silk.NET.Maths.Box2D other) -> bool -Silk.NET.Maths.Box2D.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T -Silk.NET.Maths.Box2D.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Box2D -Silk.NET.Maths.Box2D.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Box2D -Silk.NET.Maths.Box2D.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Box2D -Silk.NET.Maths.Box2D.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Box2D -Silk.NET.Maths.Box2D.Max -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Box2D.Min -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Box2D.Size.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Box3D -Silk.NET.Maths.Box3D.As() -> Silk.NET.Maths.Box3D -Silk.NET.Maths.Box3D.Box3D() -> void -Silk.NET.Maths.Box3D.Box3D(Silk.NET.Maths.Vector3D min, Silk.NET.Maths.Vector3D max) -> void -Silk.NET.Maths.Box3D.Box3D(Silk.NET.Maths.Vector3D min, T maxX, T maxY, T maxZ) -> void -Silk.NET.Maths.Box3D.Box3D(T minX, T minY, T minZ, Silk.NET.Maths.Vector3D max) -> void -Silk.NET.Maths.Box3D.Box3D(T minX, T minY, T minZ, T maxX, T maxY, T maxZ) -> void -Silk.NET.Maths.Box3D.Center.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Box3D.Contains(Silk.NET.Maths.Box3D other) -> bool -Silk.NET.Maths.Box3D.Contains(Silk.NET.Maths.Vector3D point) -> bool -Silk.NET.Maths.Box3D.Equals(Silk.NET.Maths.Box3D other) -> bool -Silk.NET.Maths.Box3D.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T -Silk.NET.Maths.Box3D.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Box3D -Silk.NET.Maths.Box3D.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Box3D -Silk.NET.Maths.Box3D.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Box3D -Silk.NET.Maths.Box3D.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Box3D -Silk.NET.Maths.Box3D.Max -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Box3D.Min -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Box3D.Size.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Circle -Silk.NET.Maths.Circle.As() -> Silk.NET.Maths.Circle -Silk.NET.Maths.Circle.Center -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Circle.Circle() -> void -Silk.NET.Maths.Circle.Circle(Silk.NET.Maths.Vector2D center, T radius) -> void -Silk.NET.Maths.Circle.Circle(T centerX, T centerY, T radius) -> void -Silk.NET.Maths.Circle.Circumference.get -> T -Silk.NET.Maths.Circle.Contains(Silk.NET.Maths.Circle other) -> bool -Silk.NET.Maths.Circle.Contains(Silk.NET.Maths.Vector2D point) -> bool -Silk.NET.Maths.Circle.Diameter.get -> T -Silk.NET.Maths.Circle.Equals(Silk.NET.Maths.Circle other) -> bool -Silk.NET.Maths.Circle.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T -Silk.NET.Maths.Circle.GetDistanceToNearestEdgeSquared(Silk.NET.Maths.Vector2D point) -> T -Silk.NET.Maths.Circle.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Circle -Silk.NET.Maths.Circle.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Circle -Silk.NET.Maths.Circle.Radius -> T -Silk.NET.Maths.Circle.SquaredRadius.get -> T -Silk.NET.Maths.Cube -Silk.NET.Maths.Cube.As() -> Silk.NET.Maths.Cube -Silk.NET.Maths.Cube.Center.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Cube.Contains(Silk.NET.Maths.Cube other) -> bool -Silk.NET.Maths.Cube.Contains(Silk.NET.Maths.Vector3D point) -> bool -Silk.NET.Maths.Cube.Cube() -> void -Silk.NET.Maths.Cube.Cube(Silk.NET.Maths.Vector3D origin, Silk.NET.Maths.Vector3D size) -> void -Silk.NET.Maths.Cube.Cube(Silk.NET.Maths.Vector3D origin, T sizeX, T sizeY, T sizeZ) -> void -Silk.NET.Maths.Cube.Cube(T originX, T originY, T originZ, Silk.NET.Maths.Vector3D size) -> void -Silk.NET.Maths.Cube.Cube(T originX, T originY, T originZ, T sizeX, T sizeY, T sizeZ) -> void -Silk.NET.Maths.Cube.Equals(Silk.NET.Maths.Cube other) -> bool -Silk.NET.Maths.Cube.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T -Silk.NET.Maths.Cube.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Cube -Silk.NET.Maths.Cube.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Cube -Silk.NET.Maths.Cube.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Cube -Silk.NET.Maths.Cube.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Cube -Silk.NET.Maths.Cube.HalfSize.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Cube.Max.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Cube.Origin -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Cube.Size -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix2X2 -Silk.NET.Maths.Matrix2X2 -Silk.NET.Maths.Matrix2X2.As() -> Silk.NET.Maths.Matrix2X2 -Silk.NET.Maths.Matrix2X2.Column1.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X2.Column2.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X2.Equals(Silk.NET.Maths.Matrix2X2 other) -> bool -Silk.NET.Maths.Matrix2X2.GetDeterminant() -> T -Silk.NET.Maths.Matrix2X2.IsIdentity.get -> bool -Silk.NET.Maths.Matrix2X2.M11.get -> T -Silk.NET.Maths.Matrix2X2.M11.set -> void -Silk.NET.Maths.Matrix2X2.M12.get -> T -Silk.NET.Maths.Matrix2X2.M12.set -> void -Silk.NET.Maths.Matrix2X2.M21.get -> T -Silk.NET.Maths.Matrix2X2.M21.set -> void -Silk.NET.Maths.Matrix2X2.M22.get -> T -Silk.NET.Maths.Matrix2X2.M22.set -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2() -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Vector2D row1, Silk.NET.Maths.Vector2D row2) -> void -Silk.NET.Maths.Matrix2X2.Matrix2X2(T m11, T m12, T m21, T m22) -> void -Silk.NET.Maths.Matrix2X2.Row1 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X2.Row2 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X2.this[int x, int y].get -> T -Silk.NET.Maths.Matrix2X2.this[int x].get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X3 -Silk.NET.Maths.Matrix2X3 -Silk.NET.Maths.Matrix2X3.As() -> Silk.NET.Maths.Matrix2X3 -Silk.NET.Maths.Matrix2X3.Column1.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X3.Column2.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X3.Column3.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X3.Equals(Silk.NET.Maths.Matrix2X3 other) -> bool -Silk.NET.Maths.Matrix2X3.IsIdentity.get -> bool -Silk.NET.Maths.Matrix2X3.M11.get -> T -Silk.NET.Maths.Matrix2X3.M11.set -> void -Silk.NET.Maths.Matrix2X3.M12.get -> T -Silk.NET.Maths.Matrix2X3.M12.set -> void -Silk.NET.Maths.Matrix2X3.M13.get -> T -Silk.NET.Maths.Matrix2X3.M13.set -> void -Silk.NET.Maths.Matrix2X3.M21.get -> T -Silk.NET.Maths.Matrix2X3.M21.set -> void -Silk.NET.Maths.Matrix2X3.M22.get -> T -Silk.NET.Maths.Matrix2X3.M22.set -> void -Silk.NET.Maths.Matrix2X3.M23.get -> T -Silk.NET.Maths.Matrix2X3.M23.set -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3() -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Vector3D row1, Silk.NET.Maths.Vector3D row2) -> void -Silk.NET.Maths.Matrix2X3.Matrix2X3(T m11, T m12, T m13, T m21, T m22, T m23) -> void -Silk.NET.Maths.Matrix2X3.Row1 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix2X3.Row2 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix2X3.this[int x, int y].get -> T -Silk.NET.Maths.Matrix2X3.this[int x].get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix2X4 -Silk.NET.Maths.Matrix2X4 -Silk.NET.Maths.Matrix2X4.As() -> Silk.NET.Maths.Matrix2X4 -Silk.NET.Maths.Matrix2X4.Column1.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X4.Column2.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X4.Column3.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X4.Column4.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix2X4.Equals(Silk.NET.Maths.Matrix2X4 other) -> bool -Silk.NET.Maths.Matrix2X4.IsIdentity.get -> bool -Silk.NET.Maths.Matrix2X4.M11.get -> T -Silk.NET.Maths.Matrix2X4.M11.set -> void -Silk.NET.Maths.Matrix2X4.M12.get -> T -Silk.NET.Maths.Matrix2X4.M12.set -> void -Silk.NET.Maths.Matrix2X4.M13.get -> T -Silk.NET.Maths.Matrix2X4.M13.set -> void -Silk.NET.Maths.Matrix2X4.M14.get -> T -Silk.NET.Maths.Matrix2X4.M14.set -> void -Silk.NET.Maths.Matrix2X4.M21.get -> T -Silk.NET.Maths.Matrix2X4.M21.set -> void -Silk.NET.Maths.Matrix2X4.M22.get -> T -Silk.NET.Maths.Matrix2X4.M22.set -> void -Silk.NET.Maths.Matrix2X4.M23.get -> T -Silk.NET.Maths.Matrix2X4.M23.set -> void -Silk.NET.Maths.Matrix2X4.M24.get -> T -Silk.NET.Maths.Matrix2X4.M24.set -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4() -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2) -> void -Silk.NET.Maths.Matrix2X4.Matrix2X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24) -> void -Silk.NET.Maths.Matrix2X4.Row1 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix2X4.Row2 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix2X4.this[int x, int j].get -> T -Silk.NET.Maths.Matrix2X4.this[int x].get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix3X2 -Silk.NET.Maths.Matrix3X2 -Silk.NET.Maths.Matrix3X2.As() -> Silk.NET.Maths.Matrix3X2 -Silk.NET.Maths.Matrix3X2.Column1.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X2.Column2.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X2.Equals(Silk.NET.Maths.Matrix3X2 other) -> bool -Silk.NET.Maths.Matrix3X2.GetDeterminant() -> T -Silk.NET.Maths.Matrix3X2.IsIdentity.get -> bool -Silk.NET.Maths.Matrix3X2.M11.get -> T -Silk.NET.Maths.Matrix3X2.M11.set -> void -Silk.NET.Maths.Matrix3X2.M12.get -> T -Silk.NET.Maths.Matrix3X2.M12.set -> void -Silk.NET.Maths.Matrix3X2.M21.get -> T -Silk.NET.Maths.Matrix3X2.M21.set -> void -Silk.NET.Maths.Matrix3X2.M22.get -> T -Silk.NET.Maths.Matrix3X2.M22.set -> void -Silk.NET.Maths.Matrix3X2.M31.get -> T -Silk.NET.Maths.Matrix3X2.M31.set -> void -Silk.NET.Maths.Matrix3X2.M32.get -> T -Silk.NET.Maths.Matrix3X2.M32.set -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2() -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Vector2D row1, Silk.NET.Maths.Vector2D row2, Silk.NET.Maths.Vector2D row3) -> void -Silk.NET.Maths.Matrix3X2.Matrix3X2(T m11, T m12, T m21, T m22, T m31, T m32) -> void -Silk.NET.Maths.Matrix3X2.Row1 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix3X2.Row2 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix3X2.Row3 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix3X2.this[int x, int y].get -> T -Silk.NET.Maths.Matrix3X2.this[int x].get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix3X3 -Silk.NET.Maths.Matrix3X3 -Silk.NET.Maths.Matrix3X3.As() -> Silk.NET.Maths.Matrix3X3 -Silk.NET.Maths.Matrix3X3.Column1.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.Column2.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.Column3.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.Equals(Silk.NET.Maths.Matrix3X3 other) -> bool -Silk.NET.Maths.Matrix3X3.GetDeterminant() -> T -Silk.NET.Maths.Matrix3X3.IsIdentity.get -> bool -Silk.NET.Maths.Matrix3X3.M11.get -> T -Silk.NET.Maths.Matrix3X3.M11.set -> void -Silk.NET.Maths.Matrix3X3.M12.get -> T -Silk.NET.Maths.Matrix3X3.M12.set -> void -Silk.NET.Maths.Matrix3X3.M13.get -> T -Silk.NET.Maths.Matrix3X3.M13.set -> void -Silk.NET.Maths.Matrix3X3.M21.get -> T -Silk.NET.Maths.Matrix3X3.M21.set -> void -Silk.NET.Maths.Matrix3X3.M22.get -> T -Silk.NET.Maths.Matrix3X3.M22.set -> void -Silk.NET.Maths.Matrix3X3.M23.get -> T -Silk.NET.Maths.Matrix3X3.M23.set -> void -Silk.NET.Maths.Matrix3X3.M31.get -> T -Silk.NET.Maths.Matrix3X3.M31.set -> void -Silk.NET.Maths.Matrix3X3.M32.get -> T -Silk.NET.Maths.Matrix3X3.M32.set -> void -Silk.NET.Maths.Matrix3X3.M33.get -> T -Silk.NET.Maths.Matrix3X3.M33.set -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3() -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix4X4 value) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Vector3D row1, Silk.NET.Maths.Vector3D row2, Silk.NET.Maths.Vector3D row3) -> void -Silk.NET.Maths.Matrix3X3.Matrix3X3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33) -> void -Silk.NET.Maths.Matrix3X3.Row1 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.Row2 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.Row3 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X3.this[int x, int i].get -> T -Silk.NET.Maths.Matrix3X3.this[int x].get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X4 -Silk.NET.Maths.Matrix3X4 -Silk.NET.Maths.Matrix3X4.As() -> Silk.NET.Maths.Matrix3X4 -Silk.NET.Maths.Matrix3X4.Column1.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X4.Column2.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X4.Column3.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X4.Column4.get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix3X4.Equals(Silk.NET.Maths.Matrix3X4 other) -> bool -Silk.NET.Maths.Matrix3X4.IsIdentity.get -> bool -Silk.NET.Maths.Matrix3X4.M11.get -> T -Silk.NET.Maths.Matrix3X4.M11.set -> void -Silk.NET.Maths.Matrix3X4.M12.get -> T -Silk.NET.Maths.Matrix3X4.M12.set -> void -Silk.NET.Maths.Matrix3X4.M13.get -> T -Silk.NET.Maths.Matrix3X4.M13.set -> void -Silk.NET.Maths.Matrix3X4.M14.get -> T -Silk.NET.Maths.Matrix3X4.M14.set -> void -Silk.NET.Maths.Matrix3X4.M21.get -> T -Silk.NET.Maths.Matrix3X4.M21.set -> void -Silk.NET.Maths.Matrix3X4.M22.get -> T -Silk.NET.Maths.Matrix3X4.M22.set -> void -Silk.NET.Maths.Matrix3X4.M23.get -> T -Silk.NET.Maths.Matrix3X4.M23.set -> void -Silk.NET.Maths.Matrix3X4.M24.get -> T -Silk.NET.Maths.Matrix3X4.M24.set -> void -Silk.NET.Maths.Matrix3X4.M31.get -> T -Silk.NET.Maths.Matrix3X4.M31.set -> void -Silk.NET.Maths.Matrix3X4.M32.get -> T -Silk.NET.Maths.Matrix3X4.M32.set -> void -Silk.NET.Maths.Matrix3X4.M33.get -> T -Silk.NET.Maths.Matrix3X4.M33.set -> void -Silk.NET.Maths.Matrix3X4.M34.get -> T -Silk.NET.Maths.Matrix3X4.M34.set -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4() -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2, Silk.NET.Maths.Vector4D row3) -> void -Silk.NET.Maths.Matrix3X4.Matrix3X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34) -> void -Silk.NET.Maths.Matrix3X4.Row1 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix3X4.Row2 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix3X4.Row3 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix3X4.this[int x, int y].get -> T -Silk.NET.Maths.Matrix3X4.this[int x].get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X2 -Silk.NET.Maths.Matrix4X2 -Silk.NET.Maths.Matrix4X2.As() -> Silk.NET.Maths.Matrix4X2 -Silk.NET.Maths.Matrix4X2.Column1.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X2.Column2.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X2.Equals(Silk.NET.Maths.Matrix4X2 other) -> bool -Silk.NET.Maths.Matrix4X2.IsIdentity.get -> bool -Silk.NET.Maths.Matrix4X2.M11.get -> T -Silk.NET.Maths.Matrix4X2.M11.set -> void -Silk.NET.Maths.Matrix4X2.M12.get -> T -Silk.NET.Maths.Matrix4X2.M12.set -> void -Silk.NET.Maths.Matrix4X2.M21.get -> T -Silk.NET.Maths.Matrix4X2.M21.set -> void -Silk.NET.Maths.Matrix4X2.M22.get -> T -Silk.NET.Maths.Matrix4X2.M22.set -> void -Silk.NET.Maths.Matrix4X2.M31.get -> T -Silk.NET.Maths.Matrix4X2.M31.set -> void -Silk.NET.Maths.Matrix4X2.M32.get -> T -Silk.NET.Maths.Matrix4X2.M32.set -> void -Silk.NET.Maths.Matrix4X2.M41.get -> T -Silk.NET.Maths.Matrix4X2.M41.set -> void -Silk.NET.Maths.Matrix4X2.M42.get -> T -Silk.NET.Maths.Matrix4X2.M42.set -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2() -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Vector2D row1, Silk.NET.Maths.Vector2D row2, Silk.NET.Maths.Vector2D row3, Silk.NET.Maths.Vector2D row4) -> void -Silk.NET.Maths.Matrix4X2.Matrix4X2(T m11, T m12, T m21, T m22, T m31, T m32, T m41, T m42) -> void -Silk.NET.Maths.Matrix4X2.Row1 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix4X2.Row2 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix4X2.Row3 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix4X2.Row4 -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix4X2.this[int x, int y].get -> T -Silk.NET.Maths.Matrix4X2.this[int x].get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Matrix4X3 -Silk.NET.Maths.Matrix4X3 -Silk.NET.Maths.Matrix4X3.As() -> Silk.NET.Maths.Matrix4X3 -Silk.NET.Maths.Matrix4X3.Column1.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X3.Column2.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X3.Column3.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X3.Equals(Silk.NET.Maths.Matrix4X3 other) -> bool -Silk.NET.Maths.Matrix4X3.IsIdentity.get -> bool -Silk.NET.Maths.Matrix4X3.M11.get -> T -Silk.NET.Maths.Matrix4X3.M11.set -> void -Silk.NET.Maths.Matrix4X3.M12.get -> T -Silk.NET.Maths.Matrix4X3.M12.set -> void -Silk.NET.Maths.Matrix4X3.M13.get -> T -Silk.NET.Maths.Matrix4X3.M13.set -> void -Silk.NET.Maths.Matrix4X3.M21.get -> T -Silk.NET.Maths.Matrix4X3.M21.set -> void -Silk.NET.Maths.Matrix4X3.M22.get -> T -Silk.NET.Maths.Matrix4X3.M22.set -> void -Silk.NET.Maths.Matrix4X3.M23.get -> T -Silk.NET.Maths.Matrix4X3.M23.set -> void -Silk.NET.Maths.Matrix4X3.M31.get -> T -Silk.NET.Maths.Matrix4X3.M31.set -> void -Silk.NET.Maths.Matrix4X3.M32.get -> T -Silk.NET.Maths.Matrix4X3.M32.set -> void -Silk.NET.Maths.Matrix4X3.M33.get -> T -Silk.NET.Maths.Matrix4X3.M33.set -> void -Silk.NET.Maths.Matrix4X3.M41.get -> T -Silk.NET.Maths.Matrix4X3.M41.set -> void -Silk.NET.Maths.Matrix4X3.M42.get -> T -Silk.NET.Maths.Matrix4X3.M42.set -> void -Silk.NET.Maths.Matrix4X3.M43.get -> T -Silk.NET.Maths.Matrix4X3.M43.set -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3() -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix4X4 value) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Vector3D row1, Silk.NET.Maths.Vector3D row2, Silk.NET.Maths.Vector3D row3, Silk.NET.Maths.Vector3D row4) -> void -Silk.NET.Maths.Matrix4X3.Matrix4X3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33, T m41, T m42, T m43) -> void -Silk.NET.Maths.Matrix4X3.Row1 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix4X3.Row2 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix4X3.Row3 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix4X3.Row4 -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix4X3.this[int x, int i].get -> T -Silk.NET.Maths.Matrix4X3.this[int x].get -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Matrix4X4 -Silk.NET.Maths.Matrix4X4 -Silk.NET.Maths.Matrix4X4.As() -> Silk.NET.Maths.Matrix4X4 -Silk.NET.Maths.Matrix4X4.Column1.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Column2.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Column3.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Column4.get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Equals(Silk.NET.Maths.Matrix4X4 other) -> bool -Silk.NET.Maths.Matrix4X4.GetDeterminant() -> T -Silk.NET.Maths.Matrix4X4.IsIdentity.get -> bool -Silk.NET.Maths.Matrix4X4.M11.get -> T -Silk.NET.Maths.Matrix4X4.M11.set -> void -Silk.NET.Maths.Matrix4X4.M12.get -> T -Silk.NET.Maths.Matrix4X4.M12.set -> void -Silk.NET.Maths.Matrix4X4.M13.get -> T -Silk.NET.Maths.Matrix4X4.M13.set -> void -Silk.NET.Maths.Matrix4X4.M14.get -> T -Silk.NET.Maths.Matrix4X4.M14.set -> void -Silk.NET.Maths.Matrix4X4.M21.get -> T -Silk.NET.Maths.Matrix4X4.M21.set -> void -Silk.NET.Maths.Matrix4X4.M22.get -> T -Silk.NET.Maths.Matrix4X4.M22.set -> void -Silk.NET.Maths.Matrix4X4.M23.get -> T -Silk.NET.Maths.Matrix4X4.M23.set -> void -Silk.NET.Maths.Matrix4X4.M24.get -> T -Silk.NET.Maths.Matrix4X4.M24.set -> void -Silk.NET.Maths.Matrix4X4.M31.get -> T -Silk.NET.Maths.Matrix4X4.M31.set -> void -Silk.NET.Maths.Matrix4X4.M32.get -> T -Silk.NET.Maths.Matrix4X4.M32.set -> void -Silk.NET.Maths.Matrix4X4.M33.get -> T -Silk.NET.Maths.Matrix4X4.M33.set -> void -Silk.NET.Maths.Matrix4X4.M34.get -> T -Silk.NET.Maths.Matrix4X4.M34.set -> void -Silk.NET.Maths.Matrix4X4.M41.get -> T -Silk.NET.Maths.Matrix4X4.M41.set -> void -Silk.NET.Maths.Matrix4X4.M42.get -> T -Silk.NET.Maths.Matrix4X4.M42.set -> void -Silk.NET.Maths.Matrix4X4.M43.get -> T -Silk.NET.Maths.Matrix4X4.M43.set -> void -Silk.NET.Maths.Matrix4X4.M44.get -> T -Silk.NET.Maths.Matrix4X4.M44.set -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4() -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2, Silk.NET.Maths.Vector4D row3, Silk.NET.Maths.Vector4D row4) -> void -Silk.NET.Maths.Matrix4X4.Matrix4X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34, T m41, T m42, T m43, T m44) -> void -Silk.NET.Maths.Matrix4X4.Row1 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Row2 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Row3 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.Row4 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix4X4.this[int x, int y].get -> T -Silk.NET.Maths.Matrix4X4.this[int x].get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4 -Silk.NET.Maths.Matrix5X4 -Silk.NET.Maths.Matrix5X4.As() -> Silk.NET.Maths.Matrix5X4 -Silk.NET.Maths.Matrix5X4.Equals(Silk.NET.Maths.Matrix5X4 other) -> bool -Silk.NET.Maths.Matrix5X4.IsIdentity.get -> bool -Silk.NET.Maths.Matrix5X4.M11.get -> T -Silk.NET.Maths.Matrix5X4.M11.set -> void -Silk.NET.Maths.Matrix5X4.M12.get -> T -Silk.NET.Maths.Matrix5X4.M12.set -> void -Silk.NET.Maths.Matrix5X4.M13.get -> T -Silk.NET.Maths.Matrix5X4.M13.set -> void -Silk.NET.Maths.Matrix5X4.M14.get -> T -Silk.NET.Maths.Matrix5X4.M14.set -> void -Silk.NET.Maths.Matrix5X4.M21.get -> T -Silk.NET.Maths.Matrix5X4.M21.set -> void -Silk.NET.Maths.Matrix5X4.M22.get -> T -Silk.NET.Maths.Matrix5X4.M22.set -> void -Silk.NET.Maths.Matrix5X4.M23.get -> T -Silk.NET.Maths.Matrix5X4.M23.set -> void -Silk.NET.Maths.Matrix5X4.M24.get -> T -Silk.NET.Maths.Matrix5X4.M24.set -> void -Silk.NET.Maths.Matrix5X4.M31.get -> T -Silk.NET.Maths.Matrix5X4.M31.set -> void -Silk.NET.Maths.Matrix5X4.M32.get -> T -Silk.NET.Maths.Matrix5X4.M32.set -> void -Silk.NET.Maths.Matrix5X4.M33.get -> T -Silk.NET.Maths.Matrix5X4.M33.set -> void -Silk.NET.Maths.Matrix5X4.M34.get -> T -Silk.NET.Maths.Matrix5X4.M34.set -> void -Silk.NET.Maths.Matrix5X4.M41.get -> T -Silk.NET.Maths.Matrix5X4.M41.set -> void -Silk.NET.Maths.Matrix5X4.M42.get -> T -Silk.NET.Maths.Matrix5X4.M42.set -> void -Silk.NET.Maths.Matrix5X4.M43.get -> T -Silk.NET.Maths.Matrix5X4.M43.set -> void -Silk.NET.Maths.Matrix5X4.M44.get -> T -Silk.NET.Maths.Matrix5X4.M44.set -> void -Silk.NET.Maths.Matrix5X4.M51.get -> T -Silk.NET.Maths.Matrix5X4.M51.set -> void -Silk.NET.Maths.Matrix5X4.M52.get -> T -Silk.NET.Maths.Matrix5X4.M52.set -> void -Silk.NET.Maths.Matrix5X4.M53.get -> T -Silk.NET.Maths.Matrix5X4.M53.set -> void -Silk.NET.Maths.Matrix5X4.M54.get -> T -Silk.NET.Maths.Matrix5X4.M54.set -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4() -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix2X4 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X2 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X3 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X4 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix4X2 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix4X3 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix4X4 value) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2, Silk.NET.Maths.Vector4D row3, Silk.NET.Maths.Vector4D row4, Silk.NET.Maths.Vector4D row5) -> void -Silk.NET.Maths.Matrix5X4.Matrix5X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34, T m41, T m42, T m43, T m44, T m51, T m52, T m53, T m54) -> void -Silk.NET.Maths.Matrix5X4.Row1 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4.Row2 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4.Row3 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4.Row4 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4.Row5 -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Matrix5X4.this[int x, int y].get -> T -Silk.NET.Maths.Matrix5X4.this[int x].get -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Plane -Silk.NET.Maths.Plane -Silk.NET.Maths.Plane.As() -> Silk.NET.Maths.Plane -Silk.NET.Maths.Plane.Distance -> T -Silk.NET.Maths.Plane.Equals(Silk.NET.Maths.Plane other) -> bool -Silk.NET.Maths.Plane.Normal -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Plane.Plane() -> void -Silk.NET.Maths.Plane.Plane(Silk.NET.Maths.Vector3D normal, T distance) -> void -Silk.NET.Maths.Plane.Plane(Silk.NET.Maths.Vector4D value) -> void -Silk.NET.Maths.Plane.Plane(T x, T y, T z, T distance) -> void -Silk.NET.Maths.Quaternion -Silk.NET.Maths.Quaternion.As() -> Silk.NET.Maths.Quaternion -Silk.NET.Maths.Quaternion.Equals(Silk.NET.Maths.Quaternion other) -> bool -Silk.NET.Maths.Quaternion.IsIdentity.get -> bool -Silk.NET.Maths.Quaternion.Length() -> T -Silk.NET.Maths.Quaternion.LengthSquared() -> T -Silk.NET.Maths.Quaternion.Quaternion() -> void -Silk.NET.Maths.Quaternion.Quaternion(Silk.NET.Maths.Vector3D vectorPart, T scalarPart) -> void -Silk.NET.Maths.Quaternion.Quaternion(T x, T y, T z, T w) -> void -Silk.NET.Maths.Quaternion.W -> T -Silk.NET.Maths.Quaternion.X -> T -Silk.NET.Maths.Quaternion.Y -> T -Silk.NET.Maths.Quaternion.Z -> T -Silk.NET.Maths.Ray2D -Silk.NET.Maths.Ray2D.As() -> Silk.NET.Maths.Ray2D -Silk.NET.Maths.Ray2D.Direction -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Ray2D.Equals(Silk.NET.Maths.Ray2D other) -> bool -Silk.NET.Maths.Ray2D.GetPoint(T distance) -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Ray2D.Origin -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Ray2D.Ray2D() -> void -Silk.NET.Maths.Ray2D.Ray2D(Silk.NET.Maths.Vector2D origin, Silk.NET.Maths.Vector2D direction) -> void -Silk.NET.Maths.Ray2D.Ray2D(Silk.NET.Maths.Vector2D origin, T directionX, T directionY) -> void -Silk.NET.Maths.Ray2D.Ray2D(T originX, T originY, Silk.NET.Maths.Vector2D direction) -> void -Silk.NET.Maths.Ray2D.Ray2D(T originX, T originY, T directionX, T directionY) -> void -Silk.NET.Maths.Ray3D -Silk.NET.Maths.Ray3D.As() -> Silk.NET.Maths.Ray3D -Silk.NET.Maths.Ray3D.Direction -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Ray3D.Equals(Silk.NET.Maths.Ray3D other) -> bool -Silk.NET.Maths.Ray3D.GetPoint(T distance) -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Ray3D.Origin -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Ray3D.Ray3D() -> void -Silk.NET.Maths.Ray3D.Ray3D(Silk.NET.Maths.Vector3D origin, Silk.NET.Maths.Vector3D direction) -> void -Silk.NET.Maths.Ray3D.Ray3D(Silk.NET.Maths.Vector3D origin, T directionX, T directionY, T directionZ) -> void -Silk.NET.Maths.Ray3D.Ray3D(T originX, T originY, T originZ, Silk.NET.Maths.Vector3D direction) -> void -Silk.NET.Maths.Ray3D.Ray3D(T originX, T originY, T originZ, T directionX, T directionY, T directionZ) -> void -Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle.As() -> Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle.Center.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Rectangle.Contains(Silk.NET.Maths.Rectangle other) -> bool -Silk.NET.Maths.Rectangle.Contains(Silk.NET.Maths.Vector2D point) -> bool -Silk.NET.Maths.Rectangle.Equals(Silk.NET.Maths.Rectangle other) -> bool -Silk.NET.Maths.Rectangle.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T -Silk.NET.Maths.Rectangle.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Rectangle -Silk.NET.Maths.Rectangle.HalfSize.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Rectangle.Max.get -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Rectangle.Origin -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Rectangle.Rectangle() -> void -Silk.NET.Maths.Rectangle.Rectangle(Silk.NET.Maths.Vector2D origin, Silk.NET.Maths.Vector2D size) -> void -Silk.NET.Maths.Rectangle.Rectangle(Silk.NET.Maths.Vector2D origin, T sizeX, T sizeY) -> void -Silk.NET.Maths.Rectangle.Rectangle(T originX, T originY, Silk.NET.Maths.Vector2D size) -> void -Silk.NET.Maths.Rectangle.Rectangle(T originX, T originY, T sizeX, T sizeY) -> void -Silk.NET.Maths.Rectangle.Size -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Scalar -Silk.NET.Maths.Scalar -Silk.NET.Maths.Sphere -Silk.NET.Maths.Sphere.As() -> Silk.NET.Maths.Sphere -Silk.NET.Maths.Sphere.Center -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Sphere.Contains(Silk.NET.Maths.Sphere other) -> bool -Silk.NET.Maths.Sphere.Contains(Silk.NET.Maths.Vector3D point) -> bool -Silk.NET.Maths.Sphere.Diameter.get -> T -Silk.NET.Maths.Sphere.Equals(Silk.NET.Maths.Sphere other) -> bool -Silk.NET.Maths.Sphere.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T -Silk.NET.Maths.Sphere.GetDistanceToNearestEdgeSquared(Silk.NET.Maths.Vector3D point) -> T -Silk.NET.Maths.Sphere.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Sphere -Silk.NET.Maths.Sphere.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Sphere -Silk.NET.Maths.Sphere.Radius -> T -Silk.NET.Maths.Sphere.Sphere() -> void -Silk.NET.Maths.Sphere.Sphere(Silk.NET.Maths.Vector3D center, T radius) -> void -Silk.NET.Maths.Sphere.Sphere(T centerX, T centerY, T centerZ, T radius) -> void -Silk.NET.Maths.Sphere.SquaredRadius.get -> T -Silk.NET.Maths.SystemNumericsExtensions -Silk.NET.Maths.Vector2D -Silk.NET.Maths.Vector2D -Silk.NET.Maths.Vector2D.As() -> Silk.NET.Maths.Vector2D -Silk.NET.Maths.Vector2D.CopyTo(T[]? array) -> void -Silk.NET.Maths.Vector2D.CopyTo(T[]? array, int index) -> void -Silk.NET.Maths.Vector2D.Equals(Silk.NET.Maths.Vector2D other) -> bool -Silk.NET.Maths.Vector2D.Length.get -> T -Silk.NET.Maths.Vector2D.LengthSquared.get -> T -Silk.NET.Maths.Vector2D.this[int i].get -> T -Silk.NET.Maths.Vector2D.ToString(string? format) -> string! -Silk.NET.Maths.Vector2D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! -Silk.NET.Maths.Vector2D.Vector2D() -> void -Silk.NET.Maths.Vector2D.Vector2D(T value) -> void -Silk.NET.Maths.Vector2D.Vector2D(T x, T y) -> void -Silk.NET.Maths.Vector2D.X -> T -Silk.NET.Maths.Vector2D.Y -> T -Silk.NET.Maths.Vector3D -Silk.NET.Maths.Vector3D -Silk.NET.Maths.Vector3D.As() -> Silk.NET.Maths.Vector3D -Silk.NET.Maths.Vector3D.CopyTo(T[]? array) -> void -Silk.NET.Maths.Vector3D.CopyTo(T[]? array, int index) -> void -Silk.NET.Maths.Vector3D.Equals(Silk.NET.Maths.Vector3D other) -> bool -Silk.NET.Maths.Vector3D.Length.get -> T -Silk.NET.Maths.Vector3D.LengthSquared.get -> T -Silk.NET.Maths.Vector3D.this[int i].get -> T -Silk.NET.Maths.Vector3D.ToString(string? format) -> string! -Silk.NET.Maths.Vector3D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! -Silk.NET.Maths.Vector3D.Vector3D() -> void -Silk.NET.Maths.Vector3D.Vector3D(Silk.NET.Maths.Vector2D value, T z) -> void -Silk.NET.Maths.Vector3D.Vector3D(T value) -> void -Silk.NET.Maths.Vector3D.Vector3D(T x, T y, T z) -> void -Silk.NET.Maths.Vector3D.X -> T -Silk.NET.Maths.Vector3D.Y -> T -Silk.NET.Maths.Vector3D.Z -> T -Silk.NET.Maths.Vector4D -Silk.NET.Maths.Vector4D -Silk.NET.Maths.Vector4D.As() -> Silk.NET.Maths.Vector4D -Silk.NET.Maths.Vector4D.CopyTo(T[]? array) -> void -Silk.NET.Maths.Vector4D.CopyTo(T[]? array, int index) -> void -Silk.NET.Maths.Vector4D.Equals(Silk.NET.Maths.Vector4D other) -> bool -Silk.NET.Maths.Vector4D.Length.get -> T -Silk.NET.Maths.Vector4D.LengthSquared.get -> T -Silk.NET.Maths.Vector4D.this[int i].get -> T -Silk.NET.Maths.Vector4D.ToString(string? format) -> string! -Silk.NET.Maths.Vector4D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! -Silk.NET.Maths.Vector4D.Vector4D() -> void -Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector2D value, T z, T w) -> void -Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector3D value, T w) -> void -Silk.NET.Maths.Vector4D.Vector4D(T value) -> void -Silk.NET.Maths.Vector4D.Vector4D(T x, T y, T z, T w) -> void -Silk.NET.Maths.Vector4D.W -> T -Silk.NET.Maths.Vector4D.X -> T -Silk.NET.Maths.Vector4D.Y -> T -Silk.NET.Maths.Vector4D.Z -> T -static readonly Silk.NET.Maths.Scalar.DegreesPerRadian -> T -static readonly Silk.NET.Maths.Scalar.E -> T -static readonly Silk.NET.Maths.Scalar.Epsilon -> T -static readonly Silk.NET.Maths.Scalar.MaxValue -> T -static readonly Silk.NET.Maths.Scalar.MinusOne -> T -static readonly Silk.NET.Maths.Scalar.MinusTwo -> T -static readonly Silk.NET.Maths.Scalar.MinValue -> T -static readonly Silk.NET.Maths.Scalar.NaN -> T -static readonly Silk.NET.Maths.Scalar.NegativeInfinity -> T -static readonly Silk.NET.Maths.Scalar.One -> T -static readonly Silk.NET.Maths.Scalar.Pi -> T -static readonly Silk.NET.Maths.Scalar.PiOver2 -> T -static readonly Silk.NET.Maths.Scalar.PositiveInfinity -> T -static readonly Silk.NET.Maths.Scalar.RadiansPerDegree -> T -static readonly Silk.NET.Maths.Scalar.Tau -> T -static readonly Silk.NET.Maths.Scalar.Two -> T -static readonly Silk.NET.Maths.Scalar.Zero -> T -static Silk.NET.Maths.Box2D.operator !=(Silk.NET.Maths.Box2D value1, Silk.NET.Maths.Box2D value2) -> bool -static Silk.NET.Maths.Box2D.operator ==(Silk.NET.Maths.Box2D value1, Silk.NET.Maths.Box2D value2) -> bool -static Silk.NET.Maths.Box3D.operator !=(Silk.NET.Maths.Box3D value1, Silk.NET.Maths.Box3D value2) -> bool -static Silk.NET.Maths.Box3D.operator ==(Silk.NET.Maths.Box3D value1, Silk.NET.Maths.Box3D value2) -> bool -static Silk.NET.Maths.Circle.operator !=(Silk.NET.Maths.Circle value1, Silk.NET.Maths.Circle value2) -> bool -static Silk.NET.Maths.Circle.operator ==(Silk.NET.Maths.Circle value1, Silk.NET.Maths.Circle value2) -> bool -static Silk.NET.Maths.Cube.operator !=(Silk.NET.Maths.Cube value1, Silk.NET.Maths.Cube value2) -> bool -static Silk.NET.Maths.Cube.operator ==(Silk.NET.Maths.Cube value1, Silk.NET.Maths.Cube value2) -> bool -static Silk.NET.Maths.Matrix2X2.Add(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Lerp(Silk.NET.Maths.Matrix2X2 matrix1, Silk.NET.Maths.Matrix2X2 matrix2, T amount) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 value1, T value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix2X2.Negate(Silk.NET.Maths.Matrix2X2 value) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Subtract(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.Identity.get -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator !=(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> bool -static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 value1, T value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix2X2.operator +(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 value) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X2.operator ==(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> bool -static Silk.NET.Maths.Matrix2X3.Add(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Lerp(Silk.NET.Maths.Matrix2X3 matrix1, Silk.NET.Maths.Matrix2X3 matrix2, T amount) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, T value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix2X3.Negate(Silk.NET.Maths.Matrix2X3 value) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Subtract(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Transform(Silk.NET.Maths.Matrix2X3 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.Identity.get -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator !=(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> bool -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 value1, T value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix2X3.operator +(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 value) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X3.operator ==(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2) -> bool -static Silk.NET.Maths.Matrix2X4.Add(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Lerp(Silk.NET.Maths.Matrix2X4 matrix1, Silk.NET.Maths.Matrix2X4 matrix2, T amount) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.Identity.get -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator !=(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> bool -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 value1, T value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix2X4.operator +(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 value) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix2X4.operator ==(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2) -> bool -static Silk.NET.Maths.Matrix3X2.Add(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateRotation(T radians) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateRotation(T radians, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateScale(Silk.NET.Maths.Vector2D scales) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateScale(Silk.NET.Maths.Vector2D scales, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateScale(T scale) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateScale(T scale, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateScale(T xScale, T yScale) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateScale(T xScale, T yScale, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateSkew(T radiansX, T radiansY) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateSkew(T radiansX, T radiansY, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateTranslation(Silk.NET.Maths.Vector2D position) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.CreateTranslation(T xPosition, T yPosition) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Invert(Silk.NET.Maths.Matrix3X2 matrix, out Silk.NET.Maths.Matrix3X2 result) -> bool -static Silk.NET.Maths.Matrix3X2.Lerp(Silk.NET.Maths.Matrix3X2 matrix1, Silk.NET.Maths.Matrix3X2 matrix2, T amount) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 value1, T value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix3X2.Negate(Silk.NET.Maths.Matrix3X2 value) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.Subtract(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.explicit operator System.Numerics.Matrix3x2(Silk.NET.Maths.Matrix3X2 from) -> System.Numerics.Matrix3x2 -static Silk.NET.Maths.Matrix3X2.Identity.get -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator !=(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> bool -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 value1, T value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix3X2.operator +(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 value) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X2.operator ==(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2) -> bool -static Silk.NET.Maths.Matrix3X3.Add(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateRotationX(T radians) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateRotationY(T radians) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateRotationZ(T radians) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateScale(Silk.NET.Maths.Vector3D scales) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateScale(T scale) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.CreateScale(T xScale, T yScale, T zScale) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Decompose(Silk.NET.Maths.Matrix3X3 matrix, out Silk.NET.Maths.Vector3D scale, out Silk.NET.Maths.Quaternion rotation) -> bool -static Silk.NET.Maths.Matrix3X3.Lerp(Silk.NET.Maths.Matrix3X3 matrix1, Silk.NET.Maths.Matrix3X3 matrix2, T amount) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix2X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 value1, T value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix3X3.Negate(Silk.NET.Maths.Matrix3X3 value) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Subtract(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Transform(Silk.NET.Maths.Matrix3X3 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Transpose(Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.Identity.get -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator !=(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> bool -static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 value1, T value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix3X3.operator +(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 value) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X3.operator ==(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> bool -static Silk.NET.Maths.Matrix3X4.Add(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Lerp(Silk.NET.Maths.Matrix3X4 matrix1, Silk.NET.Maths.Matrix3X4 matrix2, T amount) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 value1, T value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix3X4.Negate(Silk.NET.Maths.Matrix3X4 value) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Subtract(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.Identity.get -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator !=(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> bool -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 value1, T value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix3X4.operator +(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 value) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix3X4.operator ==(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2) -> bool -static Silk.NET.Maths.Matrix4X2.Add(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Lerp(Silk.NET.Maths.Matrix4X2 matrix1, Silk.NET.Maths.Matrix4X2 matrix2, T amount) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix4X2.Negate(Silk.NET.Maths.Matrix4X2 value) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Subtract(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.Identity.get -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator !=(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> bool -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix2X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 value1, T value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Matrix4X2.operator +(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 value) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X2.operator ==(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2) -> bool -static Silk.NET.Maths.Matrix4X3.Add(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Lerp(Silk.NET.Maths.Matrix4X3 matrix1, Silk.NET.Maths.Matrix4X3 matrix2, T amount) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix3X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 value1, T value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix4X3.Negate(Silk.NET.Maths.Matrix4X3 value) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Subtract(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.Identity.get -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator !=(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> bool -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 value1, T value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Matrix4X3.operator +(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 value) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X3.operator ==(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2) -> bool -static Silk.NET.Maths.Matrix4X4.Add(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateConstrainedBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D rotateAxis, Silk.NET.Maths.Vector3D cameraForwardVector, Silk.NET.Maths.Vector3D objectForwardVector) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateLookAt(Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraTarget, Silk.NET.Maths.Vector3D cameraUpVector) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateOrthographic(T width, T height, T zNearPlane, T zFarPlane) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateOrthographicOffCenter(T left, T right, T bottom, T top, T zNearPlane, T zFarPlane) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreatePerspective(T width, T height, T nearPlaneDistance, T farPlaneDistance) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreatePerspectiveFieldOfView(T fieldOfView, T aspectRatio, T nearPlaneDistance, T farPlaneDistance) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreatePerspectiveOffCenter(T left, T right, T bottom, T top, T nearPlaneDistance, T farPlaneDistance) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateReflection(Silk.NET.Maths.Plane value) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateRotationX(T radians) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateRotationX(T radians, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateRotationY(T radians) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateRotationY(T radians, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateRotationZ(T radians) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateRotationZ(T radians, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateScale(Silk.NET.Maths.Vector3D scales) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateScale(Silk.NET.Maths.Vector3D scales, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateScale(T scale) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateScale(T scale, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateScale(T xScale, T yScale, T zScale) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateScale(T xScale, T yScale, T zScale, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateShadow(Silk.NET.Maths.Vector3D lightDirection, Silk.NET.Maths.Plane plane) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateTranslation(Silk.NET.Maths.Vector3D position) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateTranslation(T xPosition, T yPosition, T zPosition) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.CreateWorld(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Vector3D forward, Silk.NET.Maths.Vector3D up) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Decompose(Silk.NET.Maths.Matrix4X4 matrix, out Silk.NET.Maths.Vector3D scale, out Silk.NET.Maths.Quaternion rotation, out Silk.NET.Maths.Vector3D translation) -> bool -static Silk.NET.Maths.Matrix4X4.Invert(Silk.NET.Maths.Matrix4X4 matrix, out Silk.NET.Maths.Matrix4X4 result) -> bool -static Silk.NET.Maths.Matrix4X4.Lerp(Silk.NET.Maths.Matrix4X4 matrix1, Silk.NET.Maths.Matrix4X4 matrix2, T amount) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix2X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Matrix4X2 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 value1, T value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix4X4.Negate(Silk.NET.Maths.Matrix4X4 value) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Subtract(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Transform(Silk.NET.Maths.Matrix4X4 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Transpose(Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.Identity.get -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator !=(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> bool -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix3X4 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Matrix4X3 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 value1, T value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix4X4.operator +(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 value) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.Matrix4X4.operator ==(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2) -> bool -static Silk.NET.Maths.Matrix5X4.Add(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Lerp(Silk.NET.Maths.Matrix5X4 matrix1, Silk.NET.Maths.Matrix5X4 matrix2, T amount) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Matrix5X4 value1, T value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix5X4.Negate(Silk.NET.Maths.Matrix5X4 value) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Subtract(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.Identity.get -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator !=(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> bool -static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Matrix5X4 value1, T value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Matrix5X4.operator +(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 value) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Matrix5X4 -static Silk.NET.Maths.Matrix5X4.operator ==(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2) -> bool -static Silk.NET.Maths.Plane.CreateFromVertices(Silk.NET.Maths.Vector3D point1, Silk.NET.Maths.Vector3D point2, Silk.NET.Maths.Vector3D point3) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.Dot(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector4D value) -> T -static Silk.NET.Maths.Plane.DotCoordinate(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector3D value) -> T -static Silk.NET.Maths.Plane.DotNormal(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector3D value) -> T -static Silk.NET.Maths.Plane.Normalize(Silk.NET.Maths.Plane value) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.Transform(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.Transform(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.Plane.explicit operator System.Numerics.Plane(Silk.NET.Maths.Plane from) -> System.Numerics.Plane -static Silk.NET.Maths.Plane.operator !=(Silk.NET.Maths.Plane value1, Silk.NET.Maths.Plane value2) -> bool -static Silk.NET.Maths.Plane.operator ==(Silk.NET.Maths.Plane value1, Silk.NET.Maths.Plane value2) -> bool -static Silk.NET.Maths.Quaternion.Add(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Concatenate(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Conjugate(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.CreateFromRotationMatrix(Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.CreateFromRotationMatrix(Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Divide(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Dot(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2) -> T -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.explicit operator System.Numerics.Quaternion(Silk.NET.Maths.Quaternion from) -> System.Numerics.Quaternion -static Silk.NET.Maths.Quaternion.Identity.get -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Inverse(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Lerp(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2, T amount) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Multiply(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Multiply(Silk.NET.Maths.Quaternion value1, T value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Negate(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Normalize(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator !=(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> bool -static Silk.NET.Maths.Quaternion.operator *(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator *(Silk.NET.Maths.Quaternion value1, T value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator +(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator -(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator -(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator /(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.operator ==(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> bool -static Silk.NET.Maths.Quaternion.Slerp(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2, T amount) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Quaternion.Subtract(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.Ray2D.operator !=(Silk.NET.Maths.Ray2D value1, Silk.NET.Maths.Ray2D value2) -> bool -static Silk.NET.Maths.Ray2D.operator ==(Silk.NET.Maths.Ray2D value1, Silk.NET.Maths.Ray2D value2) -> bool -static Silk.NET.Maths.Ray3D.operator !=(Silk.NET.Maths.Ray3D value1, Silk.NET.Maths.Ray3D value2) -> bool -static Silk.NET.Maths.Ray3D.operator ==(Silk.NET.Maths.Ray3D value1, Silk.NET.Maths.Ray3D value2) -> bool -static Silk.NET.Maths.Rectangle.FromLTRB(T left, T top, T right, T bottom) -> Silk.NET.Maths.Rectangle -static Silk.NET.Maths.Rectangle.operator !=(Silk.NET.Maths.Rectangle value1, Silk.NET.Maths.Rectangle value2) -> bool -static Silk.NET.Maths.Rectangle.operator ==(Silk.NET.Maths.Rectangle value1, Silk.NET.Maths.Rectangle value2) -> bool -static Silk.NET.Maths.Scalar.Abs(T x) -> T -static Silk.NET.Maths.Scalar.Acos(T x) -> T -static Silk.NET.Maths.Scalar.Acosh(T x) -> T -static Silk.NET.Maths.Scalar.Add(T left, T right) -> T -static Silk.NET.Maths.Scalar.And(T left, T right) -> T -static Silk.NET.Maths.Scalar.As(TFrom val) -> TTo -static Silk.NET.Maths.Scalar.Asin(T x) -> T -static Silk.NET.Maths.Scalar.Asinh(T x) -> T -static Silk.NET.Maths.Scalar.Atan2(T y, T x) -> T -static Silk.NET.Maths.Scalar.Atan(T x) -> T -static Silk.NET.Maths.Scalar.Atanh(T x) -> T -static Silk.NET.Maths.Scalar.Cbrt(T x) -> T -static Silk.NET.Maths.Scalar.Ceiling(T x) -> T -static Silk.NET.Maths.Scalar.Cos(T x) -> T -static Silk.NET.Maths.Scalar.Cosh(T x) -> T -static Silk.NET.Maths.Scalar.DegreesToRadians(T degrees) -> T -static Silk.NET.Maths.Scalar.Divide(T left, T right) -> T -static Silk.NET.Maths.Scalar.Equal(T left, T right) -> bool -static Silk.NET.Maths.Scalar.Exp(T x) -> T -static Silk.NET.Maths.Scalar.Floor(T x) -> T -static Silk.NET.Maths.Scalar.GreaterThan(T left, T right) -> bool -static Silk.NET.Maths.Scalar.GreaterThanOrEqual(T left, T right) -> bool -static Silk.NET.Maths.Scalar.IEEERemainder(T x, T y) -> T -static Silk.NET.Maths.Scalar.IsFinite(T f) -> bool -static Silk.NET.Maths.Scalar.IsHardwareAccelerated.get -> bool -static Silk.NET.Maths.Scalar.IsInfinity(T f) -> bool -static Silk.NET.Maths.Scalar.IsNaN(T f) -> bool -static Silk.NET.Maths.Scalar.IsNegative(T f) -> bool -static Silk.NET.Maths.Scalar.IsNegativeInfinity(T f) -> bool -static Silk.NET.Maths.Scalar.IsNormal(T f) -> bool -static Silk.NET.Maths.Scalar.IsPositiveInfinity(T f) -> bool -static Silk.NET.Maths.Scalar.IsSubnormal(T f) -> bool -static Silk.NET.Maths.Scalar.LessThan(T left, T right) -> bool -static Silk.NET.Maths.Scalar.LessThanOrEqual(T left, T right) -> bool -static Silk.NET.Maths.Scalar.Log10(T x) -> T -static Silk.NET.Maths.Scalar.Log(T x) -> T -static Silk.NET.Maths.Scalar.Log(T x, T y) -> T -static Silk.NET.Maths.Scalar.Max(T x, T y) -> T -static Silk.NET.Maths.Scalar.Min(T x, T y) -> T -static Silk.NET.Maths.Scalar.Multiply(T left, T right) -> T -static Silk.NET.Maths.Scalar.Negate(T x) -> T -static Silk.NET.Maths.Scalar.Not(T value) -> T -static Silk.NET.Maths.Scalar.NotEqual(T left, T right) -> bool -static Silk.NET.Maths.Scalar.Or(T left, T right) -> T -static Silk.NET.Maths.Scalar.Pow(T x, T y) -> T -static Silk.NET.Maths.Scalar.RadiansToDegrees(T radians) -> T -static Silk.NET.Maths.Scalar.Reciprocal(T x) -> T -static Silk.NET.Maths.Scalar.RotateLeft(T value, int offset) -> T -static Silk.NET.Maths.Scalar.RotateRight(T value, int offset) -> T -static Silk.NET.Maths.Scalar.Round(T x) -> T -static Silk.NET.Maths.Scalar.Round(T x, int digits) -> T -static Silk.NET.Maths.Scalar.Round(T x, int digits, System.MidpointRounding mode) -> T -static Silk.NET.Maths.Scalar.Round(T x, System.MidpointRounding mode) -> T -static Silk.NET.Maths.Scalar.ShiftLeft(T value, int offset) -> T -static Silk.NET.Maths.Scalar.ShiftRight(T value, int offset) -> T -static Silk.NET.Maths.Scalar.Sign(T x) -> int -static Silk.NET.Maths.Scalar.Sin(T x) -> T -static Silk.NET.Maths.Scalar.Sinh(T x) -> T -static Silk.NET.Maths.Scalar.Sqrt(T x) -> T -static Silk.NET.Maths.Scalar.Subtract(T left, T right) -> T -static Silk.NET.Maths.Scalar.Tan(T x) -> T -static Silk.NET.Maths.Scalar.Tanh(T x) -> T -static Silk.NET.Maths.Scalar.Truncate(T x) -> T -static Silk.NET.Maths.Scalar.Xor(T left, T right) -> T -static Silk.NET.Maths.Sphere.operator !=(Silk.NET.Maths.Sphere value1, Silk.NET.Maths.Sphere value2) -> bool -static Silk.NET.Maths.Sphere.operator ==(Silk.NET.Maths.Sphere value1, Silk.NET.Maths.Sphere value2) -> bool -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Matrix3x2 value) -> Silk.NET.Maths.Matrix3X2 -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Matrix4x4 value) -> Silk.NET.Maths.Matrix4X4 -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Plane value) -> Silk.NET.Maths.Plane -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2 value) -> System.Numerics.Matrix3x2 -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4 value) -> System.Numerics.Matrix4x4 -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane value) -> System.Numerics.Plane -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion value) -> System.Numerics.Quaternion -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D value) -> System.Numerics.Vector2 -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D value) -> System.Numerics.Vector3 -static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D value) -> System.Numerics.Vector4 -static Silk.NET.Maths.Vector2D.Abs(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Add(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Clamp(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Distance(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T -static Silk.NET.Maths.Vector2D.DistanceSquared(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T -static Silk.NET.Maths.Vector2D.Divide(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Divide(Silk.NET.Maths.Vector2D left, T divisor) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Dot(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T -static Silk.NET.Maths.Vector2D.Lerp(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2, T amount) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Max(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Min(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D left, T right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Matrix2X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector2D.Multiply(T left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Negate(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Normalize(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Reflect(Silk.NET.Maths.Vector2D vector, Silk.NET.Maths.Vector2D normal) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.SquareRoot(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Subtract(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Transform(Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Transform(Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Transform(Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.TransformNormal(Silk.NET.Maths.Vector2D normal, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.TransformNormal(Silk.NET.Maths.Vector2D normal, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.explicit operator System.Numerics.Vector2(Silk.NET.Maths.Vector2D from) -> System.Numerics.Vector2 -static Silk.NET.Maths.Vector2D.One.get -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator !=(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> bool -static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D left, T right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator *(T left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D value1, T value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.operator ==(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> bool -static Silk.NET.Maths.Vector2D.UnitX.get -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.UnitY.get -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector2D.Zero.get -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector3D.Abs(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Add(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Clamp(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D min, Silk.NET.Maths.Vector3D max) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Cross(Silk.NET.Maths.Vector3D vector1, Silk.NET.Maths.Vector3D vector2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Distance(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> T -static Silk.NET.Maths.Vector3D.DistanceSquared(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> T -static Silk.NET.Maths.Vector3D.Divide(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Divide(Silk.NET.Maths.Vector3D left, T divisor) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Dot(Silk.NET.Maths.Vector3D vector1, Silk.NET.Maths.Vector3D vector2) -> T -static Silk.NET.Maths.Vector3D.Lerp(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2, T amount) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Max(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Min(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D left, T right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Matrix3X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector3D.Multiply(T left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Negate(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Normalize(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Reflect(Silk.NET.Maths.Vector3D vector, Silk.NET.Maths.Vector3D normal) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.SquareRoot(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Subtract(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Transform(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Transform(Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.TransformNormal(Silk.NET.Maths.Vector3D normal, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.explicit operator System.Numerics.Vector3(Silk.NET.Maths.Vector3D from) -> System.Numerics.Vector3 -static Silk.NET.Maths.Vector3D.One.get -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator !=(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> bool -static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D left, T right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator *(T left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D value1, T value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.operator ==(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> bool -static Silk.NET.Maths.Vector3D.UnitX.get -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.UnitY.get -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.UnitZ.get -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector3D.Zero.get -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector4D.Abs(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Add(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Clamp(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D min, Silk.NET.Maths.Vector4D max) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Distance(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> T -static Silk.NET.Maths.Vector4D.DistanceSquared(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> T -static Silk.NET.Maths.Vector4D.Divide(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Divide(Silk.NET.Maths.Vector4D left, T divisor) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Dot(Silk.NET.Maths.Vector4D vector1, Silk.NET.Maths.Vector4D vector2) -> T -static Silk.NET.Maths.Vector4D.Lerp(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2, T amount) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Max(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Min(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D left, T right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X2 value2) -> Silk.NET.Maths.Vector2D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X3 value2) -> Silk.NET.Maths.Vector3D -static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix4X4 value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Multiply(T left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Negate(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Normalize(Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.SquareRoot(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Subtract(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector2D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector4D value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Transform(Silk.NET.Maths.Vector4D vector, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.explicit operator System.Numerics.Vector4(Silk.NET.Maths.Vector4D from) -> System.Numerics.Vector4 -static Silk.NET.Maths.Vector4D.One.get -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator !=(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> bool -static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D left, T right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator *(T left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D value1, T value2) -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.operator ==(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> bool -static Silk.NET.Maths.Vector4D.UnitW.get -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.UnitX.get -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.UnitY.get -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.UnitZ.get -> Silk.NET.Maths.Vector4D -static Silk.NET.Maths.Vector4D.Zero.get -> Silk.NET.Maths.Vector4D diff --git a/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Unshipped.txt b/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Unshipped.txt index 7dc5c58110..58088aad41 100644 --- a/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Unshipped.txt +++ b/sources/Maths/Maths/PublicAPI/net8.0/PublicAPI.Unshipped.txt @@ -1 +1,1826 @@ #nullable enable +override Silk.NET.Maths.Box2D.Equals(object? obj) -> bool +override Silk.NET.Maths.Box2D.GetHashCode() -> int +override Silk.NET.Maths.Box3D.Equals(object? obj) -> bool +override Silk.NET.Maths.Box3D.GetHashCode() -> int +override Silk.NET.Maths.Circle.Equals(object? obj) -> bool +override Silk.NET.Maths.Circle.GetHashCode() -> int +override Silk.NET.Maths.Cube.Equals(object? obj) -> bool +override Silk.NET.Maths.Cube.GetHashCode() -> int +override Silk.NET.Maths.Matrix2X2.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix2X2.GetHashCode() -> int +override Silk.NET.Maths.Matrix2X2.ToString() -> string! +override Silk.NET.Maths.Matrix2X3.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix2X3.GetHashCode() -> int +override Silk.NET.Maths.Matrix2X3.ToString() -> string! +override Silk.NET.Maths.Matrix2X4.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix2X4.GetHashCode() -> int +override Silk.NET.Maths.Matrix2X4.ToString() -> string! +override Silk.NET.Maths.Matrix3X2.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix3X2.GetHashCode() -> int +override Silk.NET.Maths.Matrix3X2.ToString() -> string! +override Silk.NET.Maths.Matrix3X3.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix3X3.GetHashCode() -> int +override Silk.NET.Maths.Matrix3X3.ToString() -> string! +override Silk.NET.Maths.Matrix3X4.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix3X4.GetHashCode() -> int +override Silk.NET.Maths.Matrix3X4.ToString() -> string! +override Silk.NET.Maths.Matrix4X2.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix4X2.GetHashCode() -> int +override Silk.NET.Maths.Matrix4X2.ToString() -> string! +override Silk.NET.Maths.Matrix4X3.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix4X3.GetHashCode() -> int +override Silk.NET.Maths.Matrix4X3.ToString() -> string! +override Silk.NET.Maths.Matrix4X4.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix4X4.GetHashCode() -> int +override Silk.NET.Maths.Matrix4X4.ToString() -> string! +override Silk.NET.Maths.Matrix5X4.Equals(object? obj) -> bool +override Silk.NET.Maths.Matrix5X4.GetHashCode() -> int +override Silk.NET.Maths.Matrix5X4.ToString() -> string! +override Silk.NET.Maths.Plane.Equals(object? obj) -> bool +override Silk.NET.Maths.Plane.GetHashCode() -> int +override Silk.NET.Maths.Plane.ToString() -> string! +override Silk.NET.Maths.Quaternion.Equals(object? obj) -> bool +override Silk.NET.Maths.Quaternion.GetHashCode() -> int +override Silk.NET.Maths.Quaternion.ToString() -> string! +override Silk.NET.Maths.Ray2D.Equals(object? obj) -> bool +override Silk.NET.Maths.Ray2D.GetHashCode() -> int +override Silk.NET.Maths.Ray3D.Equals(object? obj) -> bool +override Silk.NET.Maths.Ray3D.GetHashCode() -> int +override Silk.NET.Maths.Rectangle.Equals(object? obj) -> bool +override Silk.NET.Maths.Rectangle.GetHashCode() -> int +override Silk.NET.Maths.Sphere.Equals(object? obj) -> bool +override Silk.NET.Maths.Sphere.GetHashCode() -> int +override Silk.NET.Maths.Vector2D.Equals(object? obj) -> bool +override Silk.NET.Maths.Vector2D.GetHashCode() -> int +override Silk.NET.Maths.Vector2D.ToString() -> string! +override Silk.NET.Maths.Vector3D.Equals(object? obj) -> bool +override Silk.NET.Maths.Vector3D.GetHashCode() -> int +override Silk.NET.Maths.Vector3D.ToString() -> string! +override Silk.NET.Maths.Vector4D.Equals(object? obj) -> bool +override Silk.NET.Maths.Vector4D.GetHashCode() -> int +override Silk.NET.Maths.Vector4D.ToString() -> string! +Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.As() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.AsChecked() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.AsSaturating() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.AsTruncating() -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.Box2D() -> void +Silk.NET.Maths.Box2D.Box2D(Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> void +Silk.NET.Maths.Box2D.Box2D(Silk.NET.Maths.Vector2D min, T maxX, T maxY) -> void +Silk.NET.Maths.Box2D.Box2D(T minX, T minY, Silk.NET.Maths.Vector2D max) -> void +Silk.NET.Maths.Box2D.Box2D(T minX, T minY, T maxX, T maxY) -> void +Silk.NET.Maths.Box2D.Center.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Box2D.Contains(Silk.NET.Maths.Box2D other) -> bool +Silk.NET.Maths.Box2D.Contains(Silk.NET.Maths.Vector2D point) -> bool +Silk.NET.Maths.Box2D.Equals(Silk.NET.Maths.Box2D other) -> bool +Silk.NET.Maths.Box2D.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Box2D +Silk.NET.Maths.Box2D.Max -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Box2D.Min -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Box2D.Size.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D.As() -> Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D.Box3D() -> void +Silk.NET.Maths.Box3D.Box3D(Silk.NET.Maths.Vector3D min, Silk.NET.Maths.Vector3D max) -> void +Silk.NET.Maths.Box3D.Box3D(Silk.NET.Maths.Vector3D min, T maxX, T maxY, T maxZ) -> void +Silk.NET.Maths.Box3D.Box3D(T minX, T minY, T minZ, Silk.NET.Maths.Vector3D max) -> void +Silk.NET.Maths.Box3D.Box3D(T minX, T minY, T minZ, T maxX, T maxY, T maxZ) -> void +Silk.NET.Maths.Box3D.Center.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Box3D.Contains(Silk.NET.Maths.Box3D other) -> bool +Silk.NET.Maths.Box3D.Contains(Silk.NET.Maths.Vector3D point) -> bool +Silk.NET.Maths.Box3D.Equals(Silk.NET.Maths.Box3D other) -> bool +Silk.NET.Maths.Box3D.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Box3D +Silk.NET.Maths.Box3D.Max -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Box3D.Min -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Box3D.Size.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Circle +Silk.NET.Maths.Circle +Silk.NET.Maths.Circle.As() -> Silk.NET.Maths.Circle +Silk.NET.Maths.Circle.Center -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Circle.Circle() -> void +Silk.NET.Maths.Circle.Circle(Silk.NET.Maths.Vector2D center, T radius) -> void +Silk.NET.Maths.Circle.Circle(T centerX, T centerY, T radius) -> void +Silk.NET.Maths.Circle.Circumference.get -> T +Silk.NET.Maths.Circle.Diameter.get -> T +Silk.NET.Maths.Circle.Equals(Silk.NET.Maths.Circle other) -> bool +Silk.NET.Maths.Circle.GetDistanceToNearestEdge(Silk.NET.Maths.Vector2D point) -> T +Silk.NET.Maths.Circle.GetDistanceToNearestEdgeSquared(Silk.NET.Maths.Vector2D point) -> T +Silk.NET.Maths.Circle.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Circle +Silk.NET.Maths.Circle.Radius -> T +Silk.NET.Maths.Circle.SquaredRadius.get -> T +Silk.NET.Maths.Cube +Silk.NET.Maths.Cube +Silk.NET.Maths.Cube.As() -> Silk.NET.Maths.Cube +Silk.NET.Maths.Cube.Center.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Cube.Contains(Silk.NET.Maths.Cube other) -> bool +Silk.NET.Maths.Cube.Contains(Silk.NET.Maths.Vector3D point) -> bool +Silk.NET.Maths.Cube.Cube() -> void +Silk.NET.Maths.Cube.Cube(Silk.NET.Maths.Vector3D origin, Silk.NET.Maths.Vector3D size) -> void +Silk.NET.Maths.Cube.Cube(Silk.NET.Maths.Vector3D origin, T sizeX, T sizeY, T sizeZ) -> void +Silk.NET.Maths.Cube.Cube(T originX, T originY, T originZ, Silk.NET.Maths.Vector3D size) -> void +Silk.NET.Maths.Cube.Cube(T originX, T originY, T originZ, T sizeX, T sizeY, T sizeZ) -> void +Silk.NET.Maths.Cube.Equals(Silk.NET.Maths.Cube other) -> bool +Silk.NET.Maths.Cube.GetInflated(Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Cube +Silk.NET.Maths.Cube.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Cube +Silk.NET.Maths.Cube.GetScaled(Silk.NET.Maths.Vector3D scale, Silk.NET.Maths.Vector3D anchor) -> Silk.NET.Maths.Cube +Silk.NET.Maths.Cube.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Cube +Silk.NET.Maths.Cube.HalfSize.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Cube.Max.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Cube.Origin -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Cube.Size -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.As() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.AsChecked() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.AsSaturating() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.AsTruncating() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X2.Column1.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.Column2.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.Equals(Silk.NET.Maths.Matrix2X2 other) -> bool +Silk.NET.Maths.Matrix2X2.GetDeterminant() -> T +Silk.NET.Maths.Matrix2X2.IsIdentity.get -> bool +Silk.NET.Maths.Matrix2X2.M11.get -> T +Silk.NET.Maths.Matrix2X2.M12.get -> T +Silk.NET.Maths.Matrix2X2.M21.get -> T +Silk.NET.Maths.Matrix2X2.M22.get -> T +Silk.NET.Maths.Matrix2X2.Matrix2X2() -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(Silk.NET.Maths.Vector2D row1, Silk.NET.Maths.Vector2D row2) -> void +Silk.NET.Maths.Matrix2X2.Matrix2X2(T m11, T m12, T m21, T m22) -> void +Silk.NET.Maths.Matrix2X2.Row1 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.Row2 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.this[int row, int column].get -> T +Silk.NET.Maths.Matrix2X2.this[int row].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X2.Transpose() -> Silk.NET.Maths.Matrix2X2 +Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.As() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.AsChecked() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.AsSaturating() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.AsTruncating() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix2X3.Column1.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X3.Column2.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X3.Column3.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X3.Equals(Silk.NET.Maths.Matrix2X3 other) -> bool +Silk.NET.Maths.Matrix2X3.IsIdentity.get -> bool +Silk.NET.Maths.Matrix2X3.M11.get -> T +Silk.NET.Maths.Matrix2X3.M12.get -> T +Silk.NET.Maths.Matrix2X3.M13.get -> T +Silk.NET.Maths.Matrix2X3.M21.get -> T +Silk.NET.Maths.Matrix2X3.M22.get -> T +Silk.NET.Maths.Matrix2X3.M23.get -> T +Silk.NET.Maths.Matrix2X3.Matrix2X3() -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(Silk.NET.Maths.Vector3D row1, Silk.NET.Maths.Vector3D row2) -> void +Silk.NET.Maths.Matrix2X3.Matrix2X3(T m11, T m12, T m13, T m21, T m22, T m23) -> void +Silk.NET.Maths.Matrix2X3.Row1 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix2X3.Row2 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix2X3.this[int row, int column].get -> T +Silk.NET.Maths.Matrix2X3.this[int row].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix2X3.Transpose() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.As() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.AsChecked() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.AsSaturating() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.AsTruncating() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix2X4.Column1.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X4.Column2.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X4.Column3.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X4.Column4.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix2X4.Equals(Silk.NET.Maths.Matrix2X4 other) -> bool +Silk.NET.Maths.Matrix2X4.IsIdentity.get -> bool +Silk.NET.Maths.Matrix2X4.M11.get -> T +Silk.NET.Maths.Matrix2X4.M12.get -> T +Silk.NET.Maths.Matrix2X4.M13.get -> T +Silk.NET.Maths.Matrix2X4.M14.get -> T +Silk.NET.Maths.Matrix2X4.M21.get -> T +Silk.NET.Maths.Matrix2X4.M22.get -> T +Silk.NET.Maths.Matrix2X4.M23.get -> T +Silk.NET.Maths.Matrix2X4.M24.get -> T +Silk.NET.Maths.Matrix2X4.Matrix2X4() -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2) -> void +Silk.NET.Maths.Matrix2X4.Matrix2X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24) -> void +Silk.NET.Maths.Matrix2X4.Row1 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix2X4.Row2 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix2X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix2X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix2X4.Transpose() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.As() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.AsChecked() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.AsSaturating() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.AsTruncating() -> Silk.NET.Maths.Matrix3X2 +Silk.NET.Maths.Matrix3X2.Column1.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X2.Column2.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X2.Equals(Silk.NET.Maths.Matrix3X2 other) -> bool +Silk.NET.Maths.Matrix3X2.GetDeterminant() -> T +Silk.NET.Maths.Matrix3X2.IsIdentity.get -> bool +Silk.NET.Maths.Matrix3X2.M11.get -> T +Silk.NET.Maths.Matrix3X2.M12.get -> T +Silk.NET.Maths.Matrix3X2.M21.get -> T +Silk.NET.Maths.Matrix3X2.M22.get -> T +Silk.NET.Maths.Matrix3X2.M31.get -> T +Silk.NET.Maths.Matrix3X2.M32.get -> T +Silk.NET.Maths.Matrix3X2.Matrix3X2() -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(Silk.NET.Maths.Vector2D row1, Silk.NET.Maths.Vector2D row2, Silk.NET.Maths.Vector2D row3) -> void +Silk.NET.Maths.Matrix3X2.Matrix3X2(T m11, T m12, T m21, T m22, T m31, T m32) -> void +Silk.NET.Maths.Matrix3X2.Row1 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix3X2.Row2 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix3X2.Row3 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix3X2.this[int row, int column].get -> T +Silk.NET.Maths.Matrix3X2.this[int row].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix3X2.Transpose() -> Silk.NET.Maths.Matrix2X3 +Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.As() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.AsChecked() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.AsSaturating() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.AsTruncating() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X3.Column1.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Column2.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Column3.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Equals(Silk.NET.Maths.Matrix3X3 other) -> bool +Silk.NET.Maths.Matrix3X3.GetDeterminant() -> T +Silk.NET.Maths.Matrix3X3.IsIdentity.get -> bool +Silk.NET.Maths.Matrix3X3.M11.get -> T +Silk.NET.Maths.Matrix3X3.M12.get -> T +Silk.NET.Maths.Matrix3X3.M13.get -> T +Silk.NET.Maths.Matrix3X3.M21.get -> T +Silk.NET.Maths.Matrix3X3.M22.get -> T +Silk.NET.Maths.Matrix3X3.M23.get -> T +Silk.NET.Maths.Matrix3X3.M31.get -> T +Silk.NET.Maths.Matrix3X3.M32.get -> T +Silk.NET.Maths.Matrix3X3.M33.get -> T +Silk.NET.Maths.Matrix3X3.Matrix3X3() -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Matrix4X4 value) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(Silk.NET.Maths.Vector3D row1, Silk.NET.Maths.Vector3D row2, Silk.NET.Maths.Vector3D row3) -> void +Silk.NET.Maths.Matrix3X3.Matrix3X3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33) -> void +Silk.NET.Maths.Matrix3X3.Row1 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Row2 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Row3 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.this[int row, int column].get -> T +Silk.NET.Maths.Matrix3X3.this[int row].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X3.Transpose() -> Silk.NET.Maths.Matrix3X3 +Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.As() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.AsChecked() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.AsSaturating() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.AsTruncating() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix3X4.Column1.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X4.Column2.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X4.Column3.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X4.Column4.get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix3X4.Equals(Silk.NET.Maths.Matrix3X4 other) -> bool +Silk.NET.Maths.Matrix3X4.IsIdentity.get -> bool +Silk.NET.Maths.Matrix3X4.M11.get -> T +Silk.NET.Maths.Matrix3X4.M12.get -> T +Silk.NET.Maths.Matrix3X4.M13.get -> T +Silk.NET.Maths.Matrix3X4.M14.get -> T +Silk.NET.Maths.Matrix3X4.M21.get -> T +Silk.NET.Maths.Matrix3X4.M22.get -> T +Silk.NET.Maths.Matrix3X4.M23.get -> T +Silk.NET.Maths.Matrix3X4.M24.get -> T +Silk.NET.Maths.Matrix3X4.M31.get -> T +Silk.NET.Maths.Matrix3X4.M32.get -> T +Silk.NET.Maths.Matrix3X4.M33.get -> T +Silk.NET.Maths.Matrix3X4.M34.get -> T +Silk.NET.Maths.Matrix3X4.Matrix3X4() -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2, Silk.NET.Maths.Vector4D row3) -> void +Silk.NET.Maths.Matrix3X4.Matrix3X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34) -> void +Silk.NET.Maths.Matrix3X4.Row1 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix3X4.Row2 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix3X4.Row3 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix3X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix3X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix3X4.Transpose() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.As() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.AsChecked() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.AsSaturating() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.AsTruncating() -> Silk.NET.Maths.Matrix4X2 +Silk.NET.Maths.Matrix4X2.Column1.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X2.Column2.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X2.Equals(Silk.NET.Maths.Matrix4X2 other) -> bool +Silk.NET.Maths.Matrix4X2.IsIdentity.get -> bool +Silk.NET.Maths.Matrix4X2.M11.get -> T +Silk.NET.Maths.Matrix4X2.M12.get -> T +Silk.NET.Maths.Matrix4X2.M21.get -> T +Silk.NET.Maths.Matrix4X2.M22.get -> T +Silk.NET.Maths.Matrix4X2.M31.get -> T +Silk.NET.Maths.Matrix4X2.M32.get -> T +Silk.NET.Maths.Matrix4X2.M41.get -> T +Silk.NET.Maths.Matrix4X2.M42.get -> T +Silk.NET.Maths.Matrix4X2.Matrix4X2() -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(Silk.NET.Maths.Vector2D row1, Silk.NET.Maths.Vector2D row2, Silk.NET.Maths.Vector2D row3, Silk.NET.Maths.Vector2D row4) -> void +Silk.NET.Maths.Matrix4X2.Matrix4X2(T m11, T m12, T m21, T m22, T m31, T m32, T m41, T m42) -> void +Silk.NET.Maths.Matrix4X2.Row1 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.Row2 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.Row3 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.Row4 -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.this[int row, int column].get -> T +Silk.NET.Maths.Matrix4X2.this[int row].get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Matrix4X2.Transpose() -> Silk.NET.Maths.Matrix2X4 +Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.As() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.AsChecked() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.AsSaturating() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.AsTruncating() -> Silk.NET.Maths.Matrix4X3 +Silk.NET.Maths.Matrix4X3.Column1.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X3.Column2.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X3.Column3.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X3.Equals(Silk.NET.Maths.Matrix4X3 other) -> bool +Silk.NET.Maths.Matrix4X3.IsIdentity.get -> bool +Silk.NET.Maths.Matrix4X3.M11.get -> T +Silk.NET.Maths.Matrix4X3.M12.get -> T +Silk.NET.Maths.Matrix4X3.M13.get -> T +Silk.NET.Maths.Matrix4X3.M21.get -> T +Silk.NET.Maths.Matrix4X3.M22.get -> T +Silk.NET.Maths.Matrix4X3.M23.get -> T +Silk.NET.Maths.Matrix4X3.M31.get -> T +Silk.NET.Maths.Matrix4X3.M32.get -> T +Silk.NET.Maths.Matrix4X3.M33.get -> T +Silk.NET.Maths.Matrix4X3.M41.get -> T +Silk.NET.Maths.Matrix4X3.M42.get -> T +Silk.NET.Maths.Matrix4X3.M43.get -> T +Silk.NET.Maths.Matrix4X3.Matrix4X3() -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Matrix4X4 value) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(Silk.NET.Maths.Vector3D row1, Silk.NET.Maths.Vector3D row2, Silk.NET.Maths.Vector3D row3, Silk.NET.Maths.Vector3D row4) -> void +Silk.NET.Maths.Matrix4X3.Matrix4X3(T m11, T m12, T m13, T m21, T m22, T m23, T m31, T m32, T m33, T m41, T m42, T m43) -> void +Silk.NET.Maths.Matrix4X3.Row1 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.Row2 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.Row3 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.Row4 -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.this[int row, int column].get -> T +Silk.NET.Maths.Matrix4X3.this[int row].get -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Matrix4X3.Transpose() -> Silk.NET.Maths.Matrix3X4 +Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.As() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.AsChecked() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.AsSaturating() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.AsTruncating() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix4X4.Column1.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Column2.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Column3.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Column4.get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Equals(Silk.NET.Maths.Matrix4X4 other) -> bool +Silk.NET.Maths.Matrix4X4.GetDeterminant() -> T +Silk.NET.Maths.Matrix4X4.IsIdentity.get -> bool +Silk.NET.Maths.Matrix4X4.M11.get -> T +Silk.NET.Maths.Matrix4X4.M12.get -> T +Silk.NET.Maths.Matrix4X4.M13.get -> T +Silk.NET.Maths.Matrix4X4.M14.get -> T +Silk.NET.Maths.Matrix4X4.M21.get -> T +Silk.NET.Maths.Matrix4X4.M22.get -> T +Silk.NET.Maths.Matrix4X4.M23.get -> T +Silk.NET.Maths.Matrix4X4.M24.get -> T +Silk.NET.Maths.Matrix4X4.M31.get -> T +Silk.NET.Maths.Matrix4X4.M32.get -> T +Silk.NET.Maths.Matrix4X4.M33.get -> T +Silk.NET.Maths.Matrix4X4.M34.get -> T +Silk.NET.Maths.Matrix4X4.M41.get -> T +Silk.NET.Maths.Matrix4X4.M42.get -> T +Silk.NET.Maths.Matrix4X4.M43.get -> T +Silk.NET.Maths.Matrix4X4.M44.get -> T +Silk.NET.Maths.Matrix4X4.Matrix4X4() -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2, Silk.NET.Maths.Vector4D row3, Silk.NET.Maths.Vector4D row4) -> void +Silk.NET.Maths.Matrix4X4.Matrix4X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34, T m41, T m42, T m43, T m44) -> void +Silk.NET.Maths.Matrix4X4.Row1 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Row2 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Row3 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Row4 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix4X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix4X4.Transpose() -> Silk.NET.Maths.Matrix4X4 +Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.As() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.AsChecked() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.AsSaturating() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.AsTruncating() -> Silk.NET.Maths.Matrix5X4 +Silk.NET.Maths.Matrix5X4.Equals(Silk.NET.Maths.Matrix5X4 other) -> bool +Silk.NET.Maths.Matrix5X4.IsIdentity.get -> bool +Silk.NET.Maths.Matrix5X4.M11.get -> T +Silk.NET.Maths.Matrix5X4.M12.get -> T +Silk.NET.Maths.Matrix5X4.M13.get -> T +Silk.NET.Maths.Matrix5X4.M14.get -> T +Silk.NET.Maths.Matrix5X4.M21.get -> T +Silk.NET.Maths.Matrix5X4.M22.get -> T +Silk.NET.Maths.Matrix5X4.M23.get -> T +Silk.NET.Maths.Matrix5X4.M24.get -> T +Silk.NET.Maths.Matrix5X4.M31.get -> T +Silk.NET.Maths.Matrix5X4.M32.get -> T +Silk.NET.Maths.Matrix5X4.M33.get -> T +Silk.NET.Maths.Matrix5X4.M34.get -> T +Silk.NET.Maths.Matrix5X4.M41.get -> T +Silk.NET.Maths.Matrix5X4.M42.get -> T +Silk.NET.Maths.Matrix5X4.M43.get -> T +Silk.NET.Maths.Matrix5X4.M44.get -> T +Silk.NET.Maths.Matrix5X4.M51.get -> T +Silk.NET.Maths.Matrix5X4.M52.get -> T +Silk.NET.Maths.Matrix5X4.M53.get -> T +Silk.NET.Maths.Matrix5X4.M54.get -> T +Silk.NET.Maths.Matrix5X4.Matrix5X4() -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix2X4 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X2 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X3 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix3X4 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix4X2 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix4X3 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Matrix4X4 value) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(Silk.NET.Maths.Vector4D row1, Silk.NET.Maths.Vector4D row2, Silk.NET.Maths.Vector4D row3, Silk.NET.Maths.Vector4D row4, Silk.NET.Maths.Vector4D row5) -> void +Silk.NET.Maths.Matrix5X4.Matrix5X4(T m11, T m12, T m13, T m14, T m21, T m22, T m23, T m24, T m31, T m32, T m33, T m34, T m41, T m42, T m43, T m44, T m51, T m52, T m53, T m54) -> void +Silk.NET.Maths.Matrix5X4.Row1 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix5X4.Row2 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix5X4.Row3 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix5X4.Row4 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix5X4.Row5 -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Matrix5X4.this[int row, int column].get -> T +Silk.NET.Maths.Matrix5X4.this[int row].get -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Plane +Silk.NET.Maths.Plane +Silk.NET.Maths.Plane.As() -> Silk.NET.Maths.Plane +Silk.NET.Maths.Plane.Distance -> T +Silk.NET.Maths.Plane.Equals(Silk.NET.Maths.Plane other) -> bool +Silk.NET.Maths.Plane.Normal -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Plane.Plane() -> void +Silk.NET.Maths.Plane.Plane(Silk.NET.Maths.Vector3D normal, T distance) -> void +Silk.NET.Maths.Plane.Plane(Silk.NET.Maths.Vector4D value) -> void +Silk.NET.Maths.Plane.Plane(T x, T y, T z, T distance) -> void +Silk.NET.Maths.Quaternion +Silk.NET.Maths.Quaternion.Angle.get -> T +Silk.NET.Maths.Quaternion.As() -> Silk.NET.Maths.Quaternion +Silk.NET.Maths.Quaternion.Equals(Silk.NET.Maths.Quaternion other) -> bool +Silk.NET.Maths.Quaternion.IsIdentity.get -> bool +Silk.NET.Maths.Quaternion.Length() -> T +Silk.NET.Maths.Quaternion.LengthSquared() -> T +Silk.NET.Maths.Quaternion.Quaternion() -> void +Silk.NET.Maths.Quaternion.Quaternion(Silk.NET.Maths.Vector3D vectorPart, T scalarPart) -> void +Silk.NET.Maths.Quaternion.Quaternion(T x, T y, T z, T w) -> void +Silk.NET.Maths.Quaternion.this[int index].get -> T +Silk.NET.Maths.Quaternion.W -> T +Silk.NET.Maths.Quaternion.X -> T +Silk.NET.Maths.Quaternion.Y -> T +Silk.NET.Maths.Quaternion.Z -> T +Silk.NET.Maths.Ray2D +Silk.NET.Maths.Ray2D.As() -> Silk.NET.Maths.Ray2D +Silk.NET.Maths.Ray2D.Direction -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Ray2D.Equals(Silk.NET.Maths.Ray2D other) -> bool +Silk.NET.Maths.Ray2D.GetPoint(T distance) -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Ray2D.Origin -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Ray2D.Ray2D() -> void +Silk.NET.Maths.Ray2D.Ray2D(Silk.NET.Maths.Vector2D origin, Silk.NET.Maths.Vector2D direction) -> void +Silk.NET.Maths.Ray2D.Ray2D(Silk.NET.Maths.Vector2D origin, T directionX, T directionY) -> void +Silk.NET.Maths.Ray2D.Ray2D(T originX, T originY, Silk.NET.Maths.Vector2D direction) -> void +Silk.NET.Maths.Ray2D.Ray2D(T originX, T originY, T directionX, T directionY) -> void +Silk.NET.Maths.Ray3D +Silk.NET.Maths.Ray3D.As() -> Silk.NET.Maths.Ray3D +Silk.NET.Maths.Ray3D.Direction -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Ray3D.Equals(Silk.NET.Maths.Ray3D other) -> bool +Silk.NET.Maths.Ray3D.GetPoint(T distance) -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Ray3D.Origin -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Ray3D.Ray3D() -> void +Silk.NET.Maths.Ray3D.Ray3D(Silk.NET.Maths.Vector3D origin, Silk.NET.Maths.Vector3D direction) -> void +Silk.NET.Maths.Ray3D.Ray3D(Silk.NET.Maths.Vector3D origin, T directionX, T directionY, T directionZ) -> void +Silk.NET.Maths.Ray3D.Ray3D(T originX, T originY, T originZ, Silk.NET.Maths.Vector3D direction) -> void +Silk.NET.Maths.Ray3D.Ray3D(T originX, T originY, T originZ, T directionX, T directionY, T directionZ) -> void +Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle.As() -> Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle.Center.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Rectangle.Contains(Silk.NET.Maths.Rectangle other) -> bool +Silk.NET.Maths.Rectangle.Contains(Silk.NET.Maths.Vector2D point) -> bool +Silk.NET.Maths.Rectangle.Equals(Silk.NET.Maths.Rectangle other) -> bool +Silk.NET.Maths.Rectangle.GetInflated(Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle.GetScaled(Silk.NET.Maths.Vector2D scale, Silk.NET.Maths.Vector2D anchor) -> Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle.GetTranslated(Silk.NET.Maths.Vector2D distance) -> Silk.NET.Maths.Rectangle +Silk.NET.Maths.Rectangle.HalfSize.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Rectangle.Max.get -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Rectangle.Origin -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Rectangle.Rectangle() -> void +Silk.NET.Maths.Rectangle.Rectangle(Silk.NET.Maths.Vector2D origin, Silk.NET.Maths.Vector2D size) -> void +Silk.NET.Maths.Rectangle.Rectangle(Silk.NET.Maths.Vector2D origin, T sizeX, T sizeY) -> void +Silk.NET.Maths.Rectangle.Rectangle(T originX, T originY, Silk.NET.Maths.Vector2D size) -> void +Silk.NET.Maths.Rectangle.Rectangle(T originX, T originY, T sizeX, T sizeY) -> void +Silk.NET.Maths.Rectangle.Size -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Sphere +Silk.NET.Maths.Sphere +Silk.NET.Maths.Sphere.As() -> Silk.NET.Maths.Sphere +Silk.NET.Maths.Sphere.Center -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Sphere.Diameter.get -> T +Silk.NET.Maths.Sphere.Equals(Silk.NET.Maths.Sphere other) -> bool +Silk.NET.Maths.Sphere.GetDistanceToNearestEdge(Silk.NET.Maths.Vector3D point) -> T +Silk.NET.Maths.Sphere.GetDistanceToNearestEdgeSquared(Silk.NET.Maths.Vector3D point) -> T +Silk.NET.Maths.Sphere.GetTranslated(Silk.NET.Maths.Vector3D distance) -> Silk.NET.Maths.Sphere +Silk.NET.Maths.Sphere.Radius -> T +Silk.NET.Maths.Sphere.Sphere() -> void +Silk.NET.Maths.Sphere.Sphere(Silk.NET.Maths.Vector3D center, T radius) -> void +Silk.NET.Maths.Sphere.Sphere(T centerX, T centerY, T centerZ, T radius) -> void +Silk.NET.Maths.Sphere.SquaredRadius.get -> T +Silk.NET.Maths.SystemNumericsExtensions +Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.extension(Silk.NET.Maths.Vector2D) +Silk.NET.Maths.Vector2D.extension(Silk.NET.Maths.Vector2D).Length.get -> T +Silk.NET.Maths.Vector2D.extension(Silk.NET.Maths.Vector2D).LengthSquared.get -> T +Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.As() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.AsChecked() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.AsSaturating() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.AsSpan() -> System.Span +Silk.NET.Maths.Vector2D.AsTruncating() -> Silk.NET.Maths.Vector2D +Silk.NET.Maths.Vector2D.CopyTo(System.Span span) -> void +Silk.NET.Maths.Vector2D.CopyTo(System.Span span, int startIndex) -> void +Silk.NET.Maths.Vector2D.CopyTo(T[]! array) -> void +Silk.NET.Maths.Vector2D.CopyTo(T[]! array, int startIndex) -> void +Silk.NET.Maths.Vector2D.Count.get -> int +Silk.NET.Maths.Vector2D.Equals(Silk.NET.Maths.Vector2D other) -> bool +Silk.NET.Maths.Vector2D.GetEnumerator() -> System.Collections.Generic.IEnumerator! +Silk.NET.Maths.Vector2D.this[int index].get -> T +Silk.NET.Maths.Vector2D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +Silk.NET.Maths.Vector2D.TryFormat(System.Span utf8Destination, out int bytesWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector2D.TryFormat(System.Span destination, out int charsWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector2D.Vector2D() -> void +Silk.NET.Maths.Vector2D.Vector2D(System.ReadOnlySpan values) -> void +Silk.NET.Maths.Vector2D.Vector2D(T value) -> void +Silk.NET.Maths.Vector2D.Vector2D(T x, T y) -> void +Silk.NET.Maths.Vector2D.X -> T +Silk.NET.Maths.Vector2D.Y -> T +Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.extension(Silk.NET.Maths.Vector3D) +Silk.NET.Maths.Vector3D.extension(Silk.NET.Maths.Vector3D).Length.get -> T +Silk.NET.Maths.Vector3D.extension(Silk.NET.Maths.Vector3D).LengthSquared.get -> T +Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.As() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.AsChecked() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.AsSaturating() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.AsSpan() -> System.Span +Silk.NET.Maths.Vector3D.AsTruncating() -> Silk.NET.Maths.Vector3D +Silk.NET.Maths.Vector3D.CopyTo(System.Span span) -> void +Silk.NET.Maths.Vector3D.CopyTo(System.Span span, int startIndex) -> void +Silk.NET.Maths.Vector3D.CopyTo(T[]! array) -> void +Silk.NET.Maths.Vector3D.CopyTo(T[]! array, int startIndex) -> void +Silk.NET.Maths.Vector3D.Count.get -> int +Silk.NET.Maths.Vector3D.Equals(Silk.NET.Maths.Vector3D other) -> bool +Silk.NET.Maths.Vector3D.GetEnumerator() -> System.Collections.Generic.IEnumerator! +Silk.NET.Maths.Vector3D.this[int index].get -> T +Silk.NET.Maths.Vector3D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +Silk.NET.Maths.Vector3D.TryFormat(System.Span utf8Destination, out int bytesWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector3D.TryFormat(System.Span destination, out int charsWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector3D.Vector3D() -> void +Silk.NET.Maths.Vector3D.Vector3D(Silk.NET.Maths.Vector2D other, T z) -> void +Silk.NET.Maths.Vector3D.Vector3D(System.ReadOnlySpan values) -> void +Silk.NET.Maths.Vector3D.Vector3D(T value) -> void +Silk.NET.Maths.Vector3D.Vector3D(T x, T y, T z) -> void +Silk.NET.Maths.Vector3D.X -> T +Silk.NET.Maths.Vector3D.Y -> T +Silk.NET.Maths.Vector3D.Z -> T +Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.extension(Silk.NET.Maths.Vector4D) +Silk.NET.Maths.Vector4D.extension(Silk.NET.Maths.Vector4D).Length.get -> T +Silk.NET.Maths.Vector4D.extension(Silk.NET.Maths.Vector4D).LengthSquared.get -> T +Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.As() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.AsChecked() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.AsSaturating() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.AsSpan() -> System.Span +Silk.NET.Maths.Vector4D.AsTruncating() -> Silk.NET.Maths.Vector4D +Silk.NET.Maths.Vector4D.CopyTo(System.Span span) -> void +Silk.NET.Maths.Vector4D.CopyTo(System.Span span, int startIndex) -> void +Silk.NET.Maths.Vector4D.CopyTo(T[]! array) -> void +Silk.NET.Maths.Vector4D.CopyTo(T[]! array, int startIndex) -> void +Silk.NET.Maths.Vector4D.Count.get -> int +Silk.NET.Maths.Vector4D.Equals(Silk.NET.Maths.Vector4D other) -> bool +Silk.NET.Maths.Vector4D.GetEnumerator() -> System.Collections.Generic.IEnumerator! +Silk.NET.Maths.Vector4D.this[int index].get -> T +Silk.NET.Maths.Vector4D.ToString(string? format, System.IFormatProvider? formatProvider) -> string! +Silk.NET.Maths.Vector4D.TryFormat(System.Span utf8Destination, out int bytesWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector4D.TryFormat(System.Span destination, out int charsWritten, System.ReadOnlySpan format, System.IFormatProvider? provider) -> bool +Silk.NET.Maths.Vector4D.Vector4D() -> void +Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector2D other, T z, T w) -> void +Silk.NET.Maths.Vector4D.Vector4D(Silk.NET.Maths.Vector3D other, T w) -> void +Silk.NET.Maths.Vector4D.Vector4D(System.ReadOnlySpan values) -> void +Silk.NET.Maths.Vector4D.Vector4D(T value) -> void +Silk.NET.Maths.Vector4D.Vector4D(T x, T y, T z, T w) -> void +Silk.NET.Maths.Vector4D.W -> T +Silk.NET.Maths.Vector4D.X -> T +Silk.NET.Maths.Vector4D.Y -> T +Silk.NET.Maths.Vector4D.Z -> T +static Silk.NET.Maths.Box2D.GetDistanceToNearestEdge(this Silk.NET.Maths.Box2D box, Silk.NET.Maths.Vector2D point) -> T +static Silk.NET.Maths.Box2D.operator !=(Silk.NET.Maths.Box2D value1, Silk.NET.Maths.Box2D value2) -> bool +static Silk.NET.Maths.Box2D.operator ==(Silk.NET.Maths.Box2D value1, Silk.NET.Maths.Box2D value2) -> bool +static Silk.NET.Maths.Box3D.GetDistanceToNearestEdge(this Silk.NET.Maths.Box3D box, Silk.NET.Maths.Vector3D point) -> T +static Silk.NET.Maths.Box3D.operator !=(Silk.NET.Maths.Box3D value1, Silk.NET.Maths.Box3D value2) -> bool +static Silk.NET.Maths.Box3D.operator ==(Silk.NET.Maths.Box3D value1, Silk.NET.Maths.Box3D value2) -> bool +static Silk.NET.Maths.Circle.Contains(this Silk.NET.Maths.Circle circle, Silk.NET.Maths.Circle other) -> bool +static Silk.NET.Maths.Circle.Contains(this Silk.NET.Maths.Circle circle, Silk.NET.Maths.Vector2D point) -> bool +static Silk.NET.Maths.Circle.GetInflated(this Silk.NET.Maths.Circle circle, Silk.NET.Maths.Vector2D point) -> Silk.NET.Maths.Circle +static Silk.NET.Maths.Circle.operator !=(Silk.NET.Maths.Circle value1, Silk.NET.Maths.Circle value2) -> bool +static Silk.NET.Maths.Circle.operator ==(Silk.NET.Maths.Circle value1, Silk.NET.Maths.Circle value2) -> bool +static Silk.NET.Maths.Cube.GetDistanceToNearestEdge(Silk.NET.Maths.Cube cube, Silk.NET.Maths.Vector3D point) -> T +static Silk.NET.Maths.Cube.operator !=(Silk.NET.Maths.Cube value1, Silk.NET.Maths.Cube value2) -> bool +static Silk.NET.Maths.Cube.operator ==(Silk.NET.Maths.Cube value1, Silk.NET.Maths.Cube value2) -> bool +static Silk.NET.Maths.Matrix2X2.Add(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Lerp(Silk.NET.Maths.Matrix2X2 value1, Silk.NET.Maths.Matrix2X2 value2, T amount) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 left, T right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix2X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix2X2.Multiply(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.Multiply(T left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Negate(Silk.NET.Maths.Matrix2X2 value) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Subtract(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.CreateChecked(Silk.NET.Maths.Matrix2X2 other) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.CreateSaturating(Silk.NET.Maths.Matrix2X2 other) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.CreateTruncating(Silk.NET.Maths.Matrix2X2 other) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator checked Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.explicit operator Silk.NET.Maths.Matrix2X2(Silk.NET.Maths.Matrix2X2 from) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.Identity.get -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator !=(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> bool +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 left, T right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Matrix2X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.operator *(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X2.operator *(T left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator +(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator -(Silk.NET.Maths.Matrix2X2 value) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X2.operator ==(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X2 right) -> bool +static Silk.NET.Maths.Matrix2X3.Add(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Lerp(Silk.NET.Maths.Matrix2X3 value1, Silk.NET.Maths.Matrix2X3 value2, T amount) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 left, T right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix2X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix2X3.Multiply(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix2X3.Multiply(T left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Negate(Silk.NET.Maths.Matrix2X3 value) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Subtract(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Transform(Silk.NET.Maths.Matrix2X3 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateChecked(Silk.NET.Maths.Matrix2X3 other) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateSaturating(Silk.NET.Maths.Matrix2X3 other) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.CreateTruncating(Silk.NET.Maths.Matrix2X3 other) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator checked Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.explicit operator Silk.NET.Maths.Matrix2X3(Silk.NET.Maths.Matrix2X3 from) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.Identity.get -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator !=(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> bool +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 left, T right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Matrix2X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X3.operator *(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix2X3.operator *(T left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator +(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator -(Silk.NET.Maths.Matrix2X3 value) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X3.operator ==(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix2X3 right) -> bool +static Silk.NET.Maths.Matrix2X4.Add(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Lerp(Silk.NET.Maths.Matrix2X4 value1, Silk.NET.Maths.Matrix2X4 value2, T amount) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 left, T right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix2X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix2X4.Multiply(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix2X4.Multiply(T left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Negate(Silk.NET.Maths.Matrix2X4 value) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Subtract(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.CreateChecked(Silk.NET.Maths.Matrix2X4 other) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.CreateSaturating(Silk.NET.Maths.Matrix2X4 other) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.CreateTruncating(Silk.NET.Maths.Matrix2X4 other) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator checked Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.explicit operator Silk.NET.Maths.Matrix2X4(Silk.NET.Maths.Matrix2X4 from) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.Identity.get -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator !=(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> bool +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 left, T right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix2X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix2X4.operator *(Silk.NET.Maths.Vector2D rowVector, Silk.NET.Maths.Matrix2X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix2X4.operator *(T left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator +(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator -(Silk.NET.Maths.Matrix2X4 value) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix2X4.operator ==(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix2X4 right) -> bool +static Silk.NET.Maths.Matrix3X2.Add(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateRotation(T radians) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateRotation(T radians, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateScale(Silk.NET.Maths.Vector2D scales) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateScale(Silk.NET.Maths.Vector2D scales, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateScale(T scale) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateScale(T scale, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateScale(T xScale, T yScale) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateScale(T xScale, T yScale, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateSkew(T radiansX, T radiansY) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateSkew(T radiansX, T radiansY, Silk.NET.Maths.Vector2D centerPoint) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateTranslation(Silk.NET.Maths.Vector2D position) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateTranslation(T xPosition, T yPosition) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Invert(Silk.NET.Maths.Matrix3X2 matrix, out Silk.NET.Maths.Matrix3X2 result) -> bool +static Silk.NET.Maths.Matrix3X2.Lerp(Silk.NET.Maths.Matrix3X2 value1, Silk.NET.Maths.Matrix3X2 value2, T amount) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 left, T right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix3X2.Multiply(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix3X2.Multiply(T left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Negate(Silk.NET.Maths.Matrix3X2 value) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.Subtract(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateChecked(Silk.NET.Maths.Matrix3X2 other) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateSaturating(Silk.NET.Maths.Matrix3X2 other) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.CreateTruncating(Silk.NET.Maths.Matrix3X2 other) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(System.Numerics.Matrix3x2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator checked System.Numerics.Matrix3x2(Silk.NET.Maths.Matrix3X2 from) -> System.Numerics.Matrix3x2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(System.Numerics.Matrix3x2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator Silk.NET.Maths.Matrix3X2(Silk.NET.Maths.Matrix3X2 from) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.explicit operator System.Numerics.Matrix3x2(Silk.NET.Maths.Matrix3X2 from) -> System.Numerics.Matrix3x2 +static Silk.NET.Maths.Matrix3X2.Identity.get -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator !=(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> bool +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 left, T right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Matrix3X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X2.operator *(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix3X2.operator *(T left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator +(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator -(Silk.NET.Maths.Matrix3X2 value) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X2.operator ==(Silk.NET.Maths.Matrix3X2 left, Silk.NET.Maths.Matrix3X2 right) -> bool +static Silk.NET.Maths.Matrix3X3.Add(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateRotationX(T radians) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateRotationY(T radians) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateRotationZ(T radians) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateScale(Silk.NET.Maths.Vector3D scales) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateScale(T scale) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateScale(T xScale, T yScale, T zScale) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Lerp(Silk.NET.Maths.Matrix3X3 value1, Silk.NET.Maths.Matrix3X3 value2, T amount) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 left, T right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix3X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix3X3.Multiply(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.Multiply(T left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Negate(Silk.NET.Maths.Matrix3X3 value) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Subtract(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Transform(Silk.NET.Maths.Matrix3X3 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Transpose(Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateChecked(Silk.NET.Maths.Matrix3X3 other) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateSaturating(Silk.NET.Maths.Matrix3X3 other) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.CreateTruncating(Silk.NET.Maths.Matrix3X3 other) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator checked Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.explicit operator Silk.NET.Maths.Matrix3X3(Silk.NET.Maths.Matrix3X3 from) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.Identity.get -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator !=(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> bool +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 left, T right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Matrix3X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.operator *(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X3.operator *(T left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator +(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator -(Silk.NET.Maths.Matrix3X3 value) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X3.operator ==(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X3 right) -> bool +static Silk.NET.Maths.Matrix3X4.Add(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Lerp(Silk.NET.Maths.Matrix3X4 value1, Silk.NET.Maths.Matrix3X4 value2, T amount) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 left, T right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix3X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix3X4.Multiply(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix3X4.Multiply(T left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Negate(Silk.NET.Maths.Matrix3X4 value) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Subtract(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.CreateChecked(Silk.NET.Maths.Matrix3X4 other) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.CreateSaturating(Silk.NET.Maths.Matrix3X4 other) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.CreateTruncating(Silk.NET.Maths.Matrix3X4 other) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator checked Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.explicit operator Silk.NET.Maths.Matrix3X4(Silk.NET.Maths.Matrix3X4 from) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.Identity.get -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator !=(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> bool +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix2X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 left, T right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Matrix3X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix3X4.operator *(Silk.NET.Maths.Vector3D rowVector, Silk.NET.Maths.Matrix3X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix3X4.operator *(T left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator +(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator -(Silk.NET.Maths.Matrix3X4 value) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix3X4.operator ==(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix3X4 right) -> bool +static Silk.NET.Maths.Matrix4X2.Add(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Lerp(Silk.NET.Maths.Matrix4X2 value1, Silk.NET.Maths.Matrix4X2 value2, T amount) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix2X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 left, T right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Multiply(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix4X2.Multiply(T left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Negate(Silk.NET.Maths.Matrix4X2 value) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Subtract(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.CreateChecked(Silk.NET.Maths.Matrix4X2 other) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.CreateSaturating(Silk.NET.Maths.Matrix4X2 other) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.CreateTruncating(Silk.NET.Maths.Matrix4X2 other) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator checked Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.explicit operator Silk.NET.Maths.Matrix4X2(Silk.NET.Maths.Matrix4X2 from) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.Identity.get -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator !=(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> bool +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix2X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 left, T right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Matrix4X2 matrix, Silk.NET.Maths.Vector2D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X2.operator *(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X2 matrix) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Matrix4X2.operator *(T left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator +(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator -(Silk.NET.Maths.Matrix4X2 value) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X2.operator ==(Silk.NET.Maths.Matrix4X2 left, Silk.NET.Maths.Matrix4X2 right) -> bool +static Silk.NET.Maths.Matrix4X3.Add(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Lerp(Silk.NET.Maths.Matrix4X3 value1, Silk.NET.Maths.Matrix4X3 value2, T amount) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix3X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 left, T right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Multiply(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix4X3.Multiply(T left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Negate(Silk.NET.Maths.Matrix4X3 value) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Subtract(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.CreateChecked(Silk.NET.Maths.Matrix4X3 other) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.CreateSaturating(Silk.NET.Maths.Matrix4X3 other) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.CreateTruncating(Silk.NET.Maths.Matrix4X3 other) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator checked Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.explicit operator Silk.NET.Maths.Matrix4X3(Silk.NET.Maths.Matrix4X3 from) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.Identity.get -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator !=(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> bool +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix2X3 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix3X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 left, T right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Matrix4X3 matrix, Silk.NET.Maths.Vector3D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X3.operator *(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X3 matrix) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Matrix4X3.operator *(T left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator +(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator -(Silk.NET.Maths.Matrix4X3 value) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X3.operator ==(Silk.NET.Maths.Matrix4X3 left, Silk.NET.Maths.Matrix4X3 right) -> bool +static Silk.NET.Maths.Matrix4X4.Add(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraUpVector, Silk.NET.Maths.Vector3D cameraForwardVector) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateConstrainedBillboard(Silk.NET.Maths.Vector3D objectPosition, Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D rotateAxis, Silk.NET.Maths.Vector3D cameraForwardVector, Silk.NET.Maths.Vector3D objectForwardVector) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateFromQuaternion(Silk.NET.Maths.Quaternion quaternion) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateLookAt(Silk.NET.Maths.Vector3D cameraPosition, Silk.NET.Maths.Vector3D cameraTarget, Silk.NET.Maths.Vector3D cameraUpVector) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateOrthographic(T width, T height, T zNearPlane, T zFarPlane) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateOrthographicOffCenter(T left, T right, T bottom, T top, T zNearPlane, T zFarPlane) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreatePerspective(T width, T height, T nearPlaneDistance, T farPlaneDistance) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreatePerspectiveFieldOfView(T fieldOfView, T aspectRatio, T nearPlaneDistance, T farPlaneDistance) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreatePerspectiveOffCenter(T left, T right, T bottom, T top, T nearPlaneDistance, T farPlaneDistance) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateReflection(Silk.NET.Maths.Plane value) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateRotationX(T radians) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateRotationX(T radians, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateRotationY(T radians) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateRotationY(T radians, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateRotationZ(T radians) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateRotationZ(T radians, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateScale(Silk.NET.Maths.Vector3D scales) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateScale(Silk.NET.Maths.Vector3D scales, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateScale(T scale) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateScale(T scale, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateScale(T xScale, T yScale, T zScale) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateScale(T xScale, T yScale, T zScale, Silk.NET.Maths.Vector3D centerPoint) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateShadow(Silk.NET.Maths.Vector3D lightDirection, Silk.NET.Maths.Plane plane) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateTranslation(Silk.NET.Maths.Vector3D position) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateTranslation(T xPosition, T yPosition, T zPosition) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateWorld(Silk.NET.Maths.Vector3D position, Silk.NET.Maths.Vector3D forward, Silk.NET.Maths.Vector3D up) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Invert(Silk.NET.Maths.Matrix4X4 matrix, out Silk.NET.Maths.Matrix4X4 result) -> bool +static Silk.NET.Maths.Matrix4X4.Lerp(Silk.NET.Maths.Matrix4X4 value1, Silk.NET.Maths.Matrix4X4 value2, T amount) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 left, T right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix4X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix4X4.Multiply(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.Multiply(T left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Negate(Silk.NET.Maths.Matrix4X4 value) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Subtract(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Transform(Silk.NET.Maths.Matrix4X4 value, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.Transpose(Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateChecked(Silk.NET.Maths.Matrix4X4 other) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateSaturating(Silk.NET.Maths.Matrix4X4 other) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.CreateTruncating(Silk.NET.Maths.Matrix4X4 other) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(System.Numerics.Matrix4x4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator checked System.Numerics.Matrix4x4(Silk.NET.Maths.Matrix4X4 from) -> System.Numerics.Matrix4x4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(System.Numerics.Matrix4x4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator Silk.NET.Maths.Matrix4X4(Silk.NET.Maths.Matrix4X4 from) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.explicit operator System.Numerics.Matrix4x4(Silk.NET.Maths.Matrix4X4 from) -> System.Numerics.Matrix4x4 +static Silk.NET.Maths.Matrix4X4.Identity.get -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator !=(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> bool +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix2X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix2X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix3X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix3X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X2 right) -> Silk.NET.Maths.Matrix4X2 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X3 right) -> Silk.NET.Maths.Matrix4X3 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 left, T right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Matrix4X4 matrix, Silk.NET.Maths.Vector4D columnVector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.operator *(Silk.NET.Maths.Vector4D rowVector, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix4X4.operator *(T left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator +(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator -(Silk.NET.Maths.Matrix4X4 value) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.Matrix4X4.operator ==(Silk.NET.Maths.Matrix4X4 left, Silk.NET.Maths.Matrix4X4 right) -> bool +static Silk.NET.Maths.Matrix5X4.Add(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Lerp(Silk.NET.Maths.Matrix5X4 value1, Silk.NET.Maths.Matrix5X4 value2, T amount) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Matrix5X4 left, T right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Multiply(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix5X4.Multiply(T left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Negate(Silk.NET.Maths.Matrix5X4 value) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Subtract(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.CreateChecked(Silk.NET.Maths.Matrix5X4 other) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.CreateSaturating(Silk.NET.Maths.Matrix5X4 other) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.CreateTruncating(Silk.NET.Maths.Matrix5X4 other) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator checked Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.explicit operator Silk.NET.Maths.Matrix5X4(Silk.NET.Maths.Matrix5X4 from) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.Identity.get -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator !=(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> bool +static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix4X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Matrix5X4 left, T right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator *(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Matrix5X4 value2) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Matrix5X4.operator *(T left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator +(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator -(Silk.NET.Maths.Matrix5X4 value) -> Silk.NET.Maths.Matrix5X4 +static Silk.NET.Maths.Matrix5X4.operator ==(Silk.NET.Maths.Matrix5X4 left, Silk.NET.Maths.Matrix5X4 right) -> bool +static Silk.NET.Maths.Plane.CreateFromVertices(Silk.NET.Maths.Vector3D point1, Silk.NET.Maths.Vector3D point2, Silk.NET.Maths.Vector3D point3) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.Dot(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector4D value) -> T +static Silk.NET.Maths.Plane.DotCoordinate(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector3D value) -> T +static Silk.NET.Maths.Plane.DotNormal(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Vector3D value) -> T +static Silk.NET.Maths.Plane.Normalize(Silk.NET.Maths.Plane value) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.Transform(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.Transform(Silk.NET.Maths.Plane plane, Silk.NET.Maths.Quaternion rotation) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator Silk.NET.Maths.Plane(Silk.NET.Maths.Plane from) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.Plane.explicit operator System.Numerics.Plane(Silk.NET.Maths.Plane from) -> System.Numerics.Plane +static Silk.NET.Maths.Plane.operator !=(Silk.NET.Maths.Plane value1, Silk.NET.Maths.Plane value2) -> bool +static Silk.NET.Maths.Plane.operator ==(Silk.NET.Maths.Plane value1, Silk.NET.Maths.Plane value2) -> bool +static Silk.NET.Maths.Quaternion.Add(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Concatenate(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Conjugate(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.CreateFromAxisAngle(Silk.NET.Maths.Vector3D axis, T angle) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.CreateFromRotationMatrix(Silk.NET.Maths.Matrix3X3 matrix) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.CreateFromRotationMatrix(Silk.NET.Maths.Matrix4X4 matrix) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.CreateFromYawPitchRoll(T yaw, T pitch, T roll) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Divide(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Dot(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2) -> T +static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.explicit operator Silk.NET.Maths.Quaternion(Silk.NET.Maths.Quaternion from) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.explicit operator System.Numerics.Quaternion(Silk.NET.Maths.Quaternion from) -> System.Numerics.Quaternion +static Silk.NET.Maths.Quaternion.Identity.get -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Inverse(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Lerp(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2, T amount) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Multiply(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Multiply(Silk.NET.Maths.Quaternion value1, T value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Negate(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Normalize(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator !=(Silk.NET.Maths.Quaternion left, Silk.NET.Maths.Quaternion right) -> bool +static Silk.NET.Maths.Quaternion.operator *(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator *(Silk.NET.Maths.Quaternion value1, T value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator +(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator -(Silk.NET.Maths.Quaternion value) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator -(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator /(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.operator ==(Silk.NET.Maths.Quaternion left, Silk.NET.Maths.Quaternion right) -> bool +static Silk.NET.Maths.Quaternion.Slerp(Silk.NET.Maths.Quaternion quaternion1, Silk.NET.Maths.Quaternion quaternion2, T amount) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Quaternion.Subtract(Silk.NET.Maths.Quaternion value1, Silk.NET.Maths.Quaternion value2) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.Ray2D.operator !=(Silk.NET.Maths.Ray2D value1, Silk.NET.Maths.Ray2D value2) -> bool +static Silk.NET.Maths.Ray2D.operator ==(Silk.NET.Maths.Ray2D value1, Silk.NET.Maths.Ray2D value2) -> bool +static Silk.NET.Maths.Ray3D.operator !=(Silk.NET.Maths.Ray3D value1, Silk.NET.Maths.Ray3D value2) -> bool +static Silk.NET.Maths.Ray3D.operator ==(Silk.NET.Maths.Ray3D value1, Silk.NET.Maths.Ray3D value2) -> bool +static Silk.NET.Maths.Rectangle.FromLTRB(T left, T top, T right, T bottom) -> Silk.NET.Maths.Rectangle +static Silk.NET.Maths.Rectangle.GetDistanceToNearestEdge(this Silk.NET.Maths.Rectangle rectangle, Silk.NET.Maths.Vector2D point) -> T +static Silk.NET.Maths.Rectangle.operator !=(Silk.NET.Maths.Rectangle value1, Silk.NET.Maths.Rectangle value2) -> bool +static Silk.NET.Maths.Rectangle.operator ==(Silk.NET.Maths.Rectangle value1, Silk.NET.Maths.Rectangle value2) -> bool +static Silk.NET.Maths.Sphere.Contains(this Silk.NET.Maths.Sphere sphere, Silk.NET.Maths.Sphere other) -> bool +static Silk.NET.Maths.Sphere.Contains(this Silk.NET.Maths.Sphere sphere, Silk.NET.Maths.Vector3D point) -> bool +static Silk.NET.Maths.Sphere.GetInflated(this Silk.NET.Maths.Sphere sphere, Silk.NET.Maths.Vector3D point) -> Silk.NET.Maths.Sphere +static Silk.NET.Maths.Sphere.operator !=(Silk.NET.Maths.Sphere value1, Silk.NET.Maths.Sphere value2) -> bool +static Silk.NET.Maths.Sphere.operator ==(Silk.NET.Maths.Sphere value1, Silk.NET.Maths.Sphere value2) -> bool +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Matrix3x2 value) -> Silk.NET.Maths.Matrix3X2 +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Matrix4x4 value) -> Silk.NET.Maths.Matrix4X4 +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Plane value) -> Silk.NET.Maths.Plane +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2 value) -> System.Numerics.Matrix3x2 +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4 value) -> System.Numerics.Matrix4x4 +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane value) -> System.Numerics.Plane +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion value) -> System.Numerics.Quaternion +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D value) -> System.Numerics.Vector2 +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D value) -> System.Numerics.Vector3 +static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D value) -> System.Numerics.Vector4 +static Silk.NET.Maths.Vector2D.Abs(this Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Acos(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Acosh(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.AcosPi(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Asin(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Asinh(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.AsinPi(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atan2(this Silk.NET.Maths.Vector2D y, Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atan2Pi(this Silk.NET.Maths.Vector2D y, Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atan(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Atanh(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.AtanPi(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.BitDecrement(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.BitIncrement(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cbrt(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Ceiling(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Clamp(this Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Vector2D min, Silk.NET.Maths.Vector2D max) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Clamp(this Silk.NET.Maths.Vector2D value, TSelf min, TSelf max) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CopySign(this Silk.NET.Maths.Vector2D value, Silk.NET.Maths.Vector2D sign) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CopySign(this Silk.NET.Maths.Vector2D value, TSelf sign) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cos(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cosh(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CosPi(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Cross(this Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> T +static Silk.NET.Maths.Vector2D.Deconstruct(this Silk.NET.Maths.Vector2D vector, out T x, out T y) -> void +static Silk.NET.Maths.Vector2D.DegreesToRadians(this Silk.NET.Maths.Vector2D degrees) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Distance(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T +static Silk.NET.Maths.Vector2D.DistanceSquared(Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2) -> T +static Silk.NET.Maths.Vector2D.DivRem(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> (Silk.NET.Maths.Vector2D Quotient, Silk.NET.Maths.Vector2D Remainder) +static Silk.NET.Maths.Vector2D.Dot(this Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> T +static Silk.NET.Maths.Vector2D.Exp10(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp10M1(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp2(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp2M1(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Exp(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ExpM1(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Floor(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(this Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right, Silk.NET.Maths.Vector2D addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(this Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right, TSelf addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(this Silk.NET.Maths.Vector2D left, TSelf right, Silk.NET.Maths.Vector2D addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.FusedMultiplyAdd(this Silk.NET.Maths.Vector2D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Hypot(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Hypot(this Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Ieee754Remainder(this Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Ieee754Remainder(this Silk.NET.Maths.Vector2D left, TSelf right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ILogB(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Lerp(this Silk.NET.Maths.Vector2D value1, Silk.NET.Maths.Vector2D value2, TSelf amount) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.LerpClamped(Silk.NET.Maths.Vector2D a, Silk.NET.Maths.Vector2D b, Silk.NET.Maths.Vector2D amount) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.LerpClamped(Silk.NET.Maths.Vector2D a, Silk.NET.Maths.Vector2D b, T amount) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log10(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log10P1(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log2(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log2P1(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D newBase) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Log(this Silk.NET.Maths.Vector2D x, TSelf newBase) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.LogP1(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Max(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Max(this Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxMagnitude(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxMagnitudeNumber(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxNumber(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MaxNumber(this Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Min(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Min(this Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinMagnitude(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinMagnitudeNumber(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinNumber(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.MinNumber(this Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Multiply(Silk.NET.Maths.Vector2D left, T right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Multiply(T left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Normalize(this Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.PopCount(this Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Pow(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Pow(this Silk.NET.Maths.Vector2D x, TSelf y) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.RadiansToDegrees(this Silk.NET.Maths.Vector2D radians) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ReciprocalEstimate(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ReciprocalSqrtEstimate(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Reflect(Silk.NET.Maths.Vector2D vector, Silk.NET.Maths.Vector2D normal) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.RootN(this Silk.NET.Maths.Vector2D x, int n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.RootN(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(this Silk.NET.Maths.Vector2D x, int digits) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(this Silk.NET.Maths.Vector2D x, int digits, System.MidpointRounding mode) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Round(this Silk.NET.Maths.Vector2D x, System.MidpointRounding mode) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ScaleB(this Silk.NET.Maths.Vector2D x, int n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.ScaleB(this Silk.NET.Maths.Vector2D x, Silk.NET.Maths.Vector2D n) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Sign(this Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Sin(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.SinCos(this Silk.NET.Maths.Vector2D x) -> (Silk.NET.Maths.Vector2D Sin, Silk.NET.Maths.Vector2D Cos) +static Silk.NET.Maths.Vector2D.SinCosPi(this Silk.NET.Maths.Vector2D x) -> (Silk.NET.Maths.Vector2D SinPi, Silk.NET.Maths.Vector2D CosPi) +static Silk.NET.Maths.Vector2D.Sinh(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.SinPi(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Sqrt(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Tan(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Tanh(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.TanPi(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.TrailingZeroCount(this Silk.NET.Maths.Vector2D value) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Truncate(this Silk.NET.Maths.Vector2D x) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CreateChecked(Silk.NET.Maths.Vector2D source) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CreateSaturating(Silk.NET.Maths.Vector2D source) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.CreateTruncating(Silk.NET.Maths.Vector2D source) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(System.Numerics.Vector2 from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator checked System.Numerics.Vector2(Silk.NET.Maths.Vector2D from) -> System.Numerics.Vector2 +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(System.Numerics.Vector2 from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator Silk.NET.Maths.Vector2D(Silk.NET.Maths.Vector2D from) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.explicit operator System.Numerics.Vector2(Silk.NET.Maths.Vector2D from) -> System.Numerics.Vector2 +static Silk.NET.Maths.Vector2D.implicit operator (T X, T Y)(Silk.NET.Maths.Vector2D v) -> (T X, T Y) +static Silk.NET.Maths.Vector2D.implicit operator Silk.NET.Maths.Vector2D((T X, T Y) v) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.One.get -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator !=(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> bool +static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator *(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator *(T scalar, Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator +(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D vector) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator -(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator /(Silk.NET.Maths.Vector2D vector, T scalar) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.operator ==(Silk.NET.Maths.Vector2D left, Silk.NET.Maths.Vector2D right) -> bool +static Silk.NET.Maths.Vector2D.Parse(string! s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Parse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.TryParse(string? s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector2D result) -> bool +static Silk.NET.Maths.Vector2D.TryParse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider, out Silk.NET.Maths.Vector2D result) -> bool +static Silk.NET.Maths.Vector2D.TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector2D result) -> bool +static Silk.NET.Maths.Vector2D.UnitX.get -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.UnitY.get -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector2D.Zero.get -> Silk.NET.Maths.Vector2D +static Silk.NET.Maths.Vector3D.Abs(this Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Acos(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Acosh(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.AcosPi(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Asin(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Asinh(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.AsinPi(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atan2(this Silk.NET.Maths.Vector3D y, Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atan2Pi(this Silk.NET.Maths.Vector3D y, Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atan(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Atanh(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.AtanPi(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.BitDecrement(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.BitIncrement(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cbrt(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Ceiling(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Clamp(this Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Vector3D min, Silk.NET.Maths.Vector3D max) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Clamp(this Silk.NET.Maths.Vector3D value, TSelf min, TSelf max) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CopySign(this Silk.NET.Maths.Vector3D value, Silk.NET.Maths.Vector3D sign) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CopySign(this Silk.NET.Maths.Vector3D value, TSelf sign) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cos(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cosh(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CosPi(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Cross(this Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Deconstruct(this Silk.NET.Maths.Vector3D vector, out T x, out T y, out T z) -> void +static Silk.NET.Maths.Vector3D.DegreesToRadians(this Silk.NET.Maths.Vector3D degrees) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Distance(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> T +static Silk.NET.Maths.Vector3D.DistanceSquared(Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2) -> T +static Silk.NET.Maths.Vector3D.DivRem(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> (Silk.NET.Maths.Vector3D Quotient, Silk.NET.Maths.Vector3D Remainder) +static Silk.NET.Maths.Vector3D.Dot(this Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> T +static Silk.NET.Maths.Vector3D.Exp10(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp10M1(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp2(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp2M1(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Exp(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ExpM1(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Floor(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(this Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right, Silk.NET.Maths.Vector3D addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(this Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right, TSelf addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(this Silk.NET.Maths.Vector3D left, TSelf right, Silk.NET.Maths.Vector3D addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.FusedMultiplyAdd(this Silk.NET.Maths.Vector3D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Hypot(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Hypot(this Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Ieee754Remainder(this Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Ieee754Remainder(this Silk.NET.Maths.Vector3D left, TSelf right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ILogB(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Lerp(this Silk.NET.Maths.Vector3D value1, Silk.NET.Maths.Vector3D value2, TSelf amount) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.LerpClamped(Silk.NET.Maths.Vector3D a, Silk.NET.Maths.Vector3D b, Silk.NET.Maths.Vector3D amount) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.LerpClamped(Silk.NET.Maths.Vector3D a, Silk.NET.Maths.Vector3D b, T amount) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log10(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log10P1(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log2(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log2P1(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D newBase) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Log(this Silk.NET.Maths.Vector3D x, TSelf newBase) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.LogP1(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Max(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Max(this Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxMagnitude(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxMagnitudeNumber(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxNumber(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MaxNumber(this Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Min(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Min(this Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinMagnitude(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinMagnitudeNumber(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinNumber(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.MinNumber(this Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Multiply(Silk.NET.Maths.Vector3D left, T right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Multiply(T left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Normalize(this Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.PopCount(this Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Pow(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Pow(this Silk.NET.Maths.Vector3D x, TSelf y) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.RadiansToDegrees(this Silk.NET.Maths.Vector3D radians) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ReciprocalEstimate(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ReciprocalSqrtEstimate(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Reflect(Silk.NET.Maths.Vector3D vector, Silk.NET.Maths.Vector3D normal) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.RootN(this Silk.NET.Maths.Vector3D x, int n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.RootN(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(this Silk.NET.Maths.Vector3D x, int digits) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(this Silk.NET.Maths.Vector3D x, int digits, System.MidpointRounding mode) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Round(this Silk.NET.Maths.Vector3D x, System.MidpointRounding mode) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ScaleB(this Silk.NET.Maths.Vector3D x, int n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.ScaleB(this Silk.NET.Maths.Vector3D x, Silk.NET.Maths.Vector3D n) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Sign(this Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Sin(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.SinCos(this Silk.NET.Maths.Vector3D x) -> (Silk.NET.Maths.Vector3D Sin, Silk.NET.Maths.Vector3D Cos) +static Silk.NET.Maths.Vector3D.SinCosPi(this Silk.NET.Maths.Vector3D x) -> (Silk.NET.Maths.Vector3D SinPi, Silk.NET.Maths.Vector3D CosPi) +static Silk.NET.Maths.Vector3D.Sinh(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.SinPi(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Sqrt(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Tan(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Tanh(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.TanPi(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.TrailingZeroCount(this Silk.NET.Maths.Vector3D value) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Truncate(this Silk.NET.Maths.Vector3D x) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CreateChecked(Silk.NET.Maths.Vector3D source) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CreateSaturating(Silk.NET.Maths.Vector3D source) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.CreateTruncating(Silk.NET.Maths.Vector3D source) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(System.Numerics.Vector3 from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator checked System.Numerics.Vector3(Silk.NET.Maths.Vector3D from) -> System.Numerics.Vector3 +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(System.Numerics.Vector3 from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator Silk.NET.Maths.Vector3D(Silk.NET.Maths.Vector3D from) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.explicit operator System.Numerics.Vector3(Silk.NET.Maths.Vector3D from) -> System.Numerics.Vector3 +static Silk.NET.Maths.Vector3D.implicit operator (T X, T Y, T Z)(Silk.NET.Maths.Vector3D v) -> (T X, T Y, T Z) +static Silk.NET.Maths.Vector3D.implicit operator Silk.NET.Maths.Vector3D((T X, T Y, T Z) v) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.One.get -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator !=(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> bool +static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator *(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator *(T scalar, Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator +(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D vector) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator -(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator /(Silk.NET.Maths.Vector3D vector, T scalar) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.operator ==(Silk.NET.Maths.Vector3D left, Silk.NET.Maths.Vector3D right) -> bool +static Silk.NET.Maths.Vector3D.Parse(string! s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Parse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.TryParse(string? s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector3D result) -> bool +static Silk.NET.Maths.Vector3D.TryParse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider, out Silk.NET.Maths.Vector3D result) -> bool +static Silk.NET.Maths.Vector3D.TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector3D result) -> bool +static Silk.NET.Maths.Vector3D.UnitX.get -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.UnitY.get -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.UnitZ.get -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector3D.Zero.get -> Silk.NET.Maths.Vector3D +static Silk.NET.Maths.Vector4D.Abs(this Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Acos(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Acosh(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.AcosPi(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Asin(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Asinh(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.AsinPi(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atan2(this Silk.NET.Maths.Vector4D y, Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atan2Pi(this Silk.NET.Maths.Vector4D y, Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atan(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Atanh(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.AtanPi(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.BitDecrement(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.BitIncrement(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Cbrt(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Ceiling(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Clamp(this Silk.NET.Maths.Vector4D value, Silk.NET.Maths.Vector4D min, Silk.NET.Maths.Vector4D max) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Clamp(this Silk.NET.Maths.Vector4D value, TSelf min, TSelf max) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CopySign(this Silk.NET.Maths.Vector4D value, Silk.NET.Maths.Vector4D sign) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CopySign(this Silk.NET.Maths.Vector4D value, TSelf sign) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Cos(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Cosh(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CosPi(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Deconstruct(this Silk.NET.Maths.Vector4D vector, out T x, out T y, out T z, out T w) -> void +static Silk.NET.Maths.Vector4D.DegreesToRadians(this Silk.NET.Maths.Vector4D degrees) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Distance(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> T +static Silk.NET.Maths.Vector4D.DistanceSquared(Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2) -> T +static Silk.NET.Maths.Vector4D.DivRem(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> (Silk.NET.Maths.Vector4D Quotient, Silk.NET.Maths.Vector4D Remainder) +static Silk.NET.Maths.Vector4D.Dot(this Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> T +static Silk.NET.Maths.Vector4D.Exp10(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp10M1(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp2(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp2M1(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Exp(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ExpM1(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Floor(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(this Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right, Silk.NET.Maths.Vector4D addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(this Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right, TSelf addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(this Silk.NET.Maths.Vector4D left, TSelf right, Silk.NET.Maths.Vector4D addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.FusedMultiplyAdd(this Silk.NET.Maths.Vector4D left, TSelf right, TSelf addend) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Hypot(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Hypot(this Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Ieee754Remainder(this Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Ieee754Remainder(this Silk.NET.Maths.Vector4D left, TSelf right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ILogB(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Lerp(this Silk.NET.Maths.Vector4D value1, Silk.NET.Maths.Vector4D value2, TSelf amount) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.LerpClamped(Silk.NET.Maths.Vector4D a, Silk.NET.Maths.Vector4D b, Silk.NET.Maths.Vector4D amount) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.LerpClamped(Silk.NET.Maths.Vector4D a, Silk.NET.Maths.Vector4D b, T amount) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log10(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log10P1(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log2(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log2P1(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D newBase) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Log(this Silk.NET.Maths.Vector4D x, TSelf newBase) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.LogP1(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Max(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Max(this Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxMagnitude(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxMagnitudeNumber(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxNumber(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MaxNumber(this Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Min(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Min(this Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinMagnitude(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinMagnitudeNumber(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinNumber(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.MinNumber(this Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Multiply(Silk.NET.Maths.Vector4D left, T right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Multiply(T left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Normalize(this Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.PopCount(this Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Pow(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Pow(this Silk.NET.Maths.Vector4D x, TSelf y) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.RadiansToDegrees(this Silk.NET.Maths.Vector4D radians) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ReciprocalEstimate(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ReciprocalSqrtEstimate(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Reflect(Silk.NET.Maths.Vector4D vector, Silk.NET.Maths.Vector4D normal) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.RootN(this Silk.NET.Maths.Vector4D x, int n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.RootN(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(this Silk.NET.Maths.Vector4D x, int digits) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(this Silk.NET.Maths.Vector4D x, int digits, System.MidpointRounding mode) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Round(this Silk.NET.Maths.Vector4D x, System.MidpointRounding mode) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ScaleB(this Silk.NET.Maths.Vector4D x, int n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.ScaleB(this Silk.NET.Maths.Vector4D x, Silk.NET.Maths.Vector4D n) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Sign(this Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Sin(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.SinCos(this Silk.NET.Maths.Vector4D x) -> (Silk.NET.Maths.Vector4D Sin, Silk.NET.Maths.Vector4D Cos) +static Silk.NET.Maths.Vector4D.SinCosPi(this Silk.NET.Maths.Vector4D x) -> (Silk.NET.Maths.Vector4D SinPi, Silk.NET.Maths.Vector4D CosPi) +static Silk.NET.Maths.Vector4D.Sinh(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.SinPi(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Sqrt(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Tan(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Tanh(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.TanPi(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.TrailingZeroCount(this Silk.NET.Maths.Vector4D value) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Truncate(this Silk.NET.Maths.Vector4D x) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CreateChecked(Silk.NET.Maths.Vector4D source) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CreateSaturating(Silk.NET.Maths.Vector4D source) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.CreateTruncating(Silk.NET.Maths.Vector4D source) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(System.Numerics.Vector4 from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator checked System.Numerics.Vector4(Silk.NET.Maths.Vector4D from) -> System.Numerics.Vector4 +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(System.Numerics.Vector4 from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator Silk.NET.Maths.Vector4D(Silk.NET.Maths.Vector4D from) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.explicit operator System.Numerics.Vector4(Silk.NET.Maths.Vector4D from) -> System.Numerics.Vector4 +static Silk.NET.Maths.Vector4D.implicit operator (T X, T Y, T Z, T W)(Silk.NET.Maths.Vector4D v) -> (T X, T Y, T Z, T W) +static Silk.NET.Maths.Vector4D.implicit operator Silk.NET.Maths.Vector4D((T X, T Y, T Z, T W) v) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.One.get -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator !=(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> bool +static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator *(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator *(T scalar, Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator +(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D vector) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator -(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator /(Silk.NET.Maths.Vector4D vector, T scalar) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.operator ==(Silk.NET.Maths.Vector4D left, Silk.NET.Maths.Vector4D right) -> bool +static Silk.NET.Maths.Vector4D.Parse(string! s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Parse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Parse(System.ReadOnlySpan s, System.IFormatProvider? provider) -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.TryParse(string? s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector4D result) -> bool +static Silk.NET.Maths.Vector4D.TryParse(System.ReadOnlySpan utf8Text, System.IFormatProvider? provider, out Silk.NET.Maths.Vector4D result) -> bool +static Silk.NET.Maths.Vector4D.TryParse(System.ReadOnlySpan s, System.IFormatProvider? provider, out Silk.NET.Maths.Vector4D result) -> bool +static Silk.NET.Maths.Vector4D.UnitW.get -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.UnitX.get -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.UnitY.get -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.UnitZ.get -> Silk.NET.Maths.Vector4D +static Silk.NET.Maths.Vector4D.Zero.get -> Silk.NET.Maths.Vector4D diff --git a/sources/Maths/Maths/Quaternion.Old.cs b/sources/Maths/Maths/Quaternion.Old.cs new file mode 100644 index 0000000000..43f13d923e --- /dev/null +++ b/sources/Maths/Maths/Quaternion.Old.cs @@ -0,0 +1,638 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +using System; +using System.Globalization; +using System.Numerics; +using System.Runtime.CompilerServices; +using System.Runtime.Serialization; +using Silk.NET.Maths; + +namespace Silk.NET.Maths +{ + /// + /// Represents a vector that is used to encode three-dimensional physical rotations. + /// + /// The type used to store values. + [Serializable] + [DataContract] + public partial struct Quaternion + { + private const float SlerpEpsilon = 1e-6f; + + /// Constructs a Quaternion from the given vector and rotation parts. + /// The vector part of the Quaternion. + /// The rotation part of the Quaternion. + public Quaternion(Vector3D vectorPart, T scalarPart) + { + X = vectorPart.X; + Y = vectorPart.Y; + Z = vectorPart.Z; + W = scalarPart; + } + + /// Returns whether the Quaternion is the identity Quaternion. + [IgnoreDataMember] + public readonly bool IsIdentity => this == Identity; + + /// Adds two Quaternions element-by-element. + /// The first source Quaternion. + /// The second source Quaternion. + /// The result of adding the Quaternions. + public static Quaternion operator +(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + ans.X = value1.X + value2.X; + ans.Y = value1.Y + value2.Y; + ans.Z = value1.Z + value2.Z; + ans.W = value1.W + value2.W; + + return ans; + } + + /// Divides a Quaternion by another Quaternion. + /// The source Quaternion. + /// The divisor. + /// The result of the division. + public static Quaternion operator /(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + T q1x = value1.X; + T q1y = value1.Y; + T q1z = value1.Z; + T q1w = value1.W; + + //------------------------------------- + // Inverse part. + T ls = (value2.X * value2.X) + (value2.Y * value2.Y) + (value2.Z * value2.Z) + (value2.W * value2.W); + var invNorm = T.One / ls; + + var q2x = -(value2.X * invNorm); + var q2y = -(value2.Y * invNorm); + var q2z = -(value2.Z * invNorm); + var q2w = value2.W * invNorm; + + //------------------------------------- + // Multiply part. + + // cross(av, bv) + var cx = (q1y * q2z) - (q1z * q2y); + var cy = (q1z * q2x) - (q1x * q2z); + var cz = (q1x * q2y) - (q1y * q2x); + + var dot = (q1x * q2x) + (q1y * q2y) + (q1z * q2z); + + ans.X = (q1x * q2w) + (q2x * q1w) + cx; + ans.Y = (q1y * q2w) + (q2y * q1w) + cy; + ans.Z = (q1z * q2w) + (q2z * q1w) + cz; + ans.W = (q1w * q2w) - dot; + + return ans; + } + + /// Multiplies two Quaternions together. + /// The Quaternion on the left side of the multiplication. + /// The Quaternion on the right side of the multiplication. + /// The result of the multiplication. + public static Quaternion operator *(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + T q1x = value1.X; + T q1y = value1.Y; + T q1z = value1.Z; + T q1w = value1.W; + + T q2x = value2.X; + T q2y = value2.Y; + T q2z = value2.Z; + T q2w = value2.W; + + // cross(av, bv) + var cx = (q1y * q2z) - (q1z * q2y); + var cy = (q1z * q2x) - (q1x * q2z); + var cz = (q1x * q2y) - (q1y * q2x); + + var dot = (q1x * q2x) + (q1y * q2y) + (q1z * q2z); + + ans.X = (q1x * q2w) + (q2x * q1w) + cx; + ans.Y = (q1y * q2w) + (q2y * q1w) + cy; + ans.Z = (q1z * q2w) + (q2z * q1w) + cz; + ans.W = (q1w * q2w) - dot; + + return ans; + } + + /// Multiplies a Quaternion by a scalar value. + /// The source Quaternion. + /// The scalar value. + /// The result of the multiplication. + public static Quaternion operator *(Quaternion value1, T value2) + { + Quaternion ans; + + ans.X = value1.X * value2; + ans.Y = value1.Y * value2; + ans.Z = value1.Z * value2; + ans.W = value1.W * value2; + + return ans; + } + + /// Subtracts one Quaternion from another. + /// The first source Quaternion. + /// The second Quaternion, to be subtracted from the first. + /// The result of the subtraction. + public static Quaternion operator -(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + ans.X = value1.X - value2.X; + ans.Y = value1.Y - value2.Y; + ans.Z = value1.Z - value2.Z; + ans.W = value1.W - value2.W; + + return ans; + } + + /// Flips the sign of each component of the quaternion. + /// The source Quaternion. + /// The negated Quaternion. + public static Quaternion operator -(Quaternion value) + { + Quaternion ans; + + ans.X = -value.X; + ans.Y = -value.Y; + ans.Z = -value.Z; + ans.W = -value.W; + + return ans; + } + + /// Adds two Quaternions element-by-element. + /// The first source Quaternion. + /// The second source Quaternion. + /// The result of adding the Quaternions. + [MethodImpl((MethodImplOptions)768)] + public static Quaternion Add(Quaternion value1, Quaternion value2) + => value1 + value2; + + /// Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation. + /// The first Quaternion rotation in the series. + /// The second Quaternion rotation in the series. + /// A new Quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. + public static Quaternion Concatenate(Quaternion value1, Quaternion value2) + { + Quaternion ans; + + // Concatenate rotation is actually q2 * q1 instead of q1 * q2. + // So that's why value2 goes q1 and value1 goes q2. + T q1x = value2.X; + T q1y = value2.Y; + T q1z = value2.Z; + T q1w = value2.W; + + T q2x = value1.X; + T q2y = value1.Y; + T q2z = value1.Z; + T q2w = value1.W; + + // cross(av, bv) + var cx = (q1y * q2z) - (q1z * q2y); + var cy = (q1z * q2x) - (q1x * q2z); + var cz = (q1x * q2y) - (q1y * q2x); + + var dot = (q1x * q2x) + (q1y * q2y) + (q1z * q2z); + + ans.X = (q1x * q2w) + (q2x * q1w) + cx; + ans.Y = (q1y * q2w) + (q2y * q1w) + cy; + ans.Z = (q1z * q2w) + (q2z * q1w) + cz; + ans.W = (q1w * q2w) - dot; + + return ans; + } + + /// Creates the conjugate of a specified Quaternion. + /// The Quaternion of which to return the conjugate. + /// A new Quaternion that is the conjugate of the specified one. + public static Quaternion Conjugate(Quaternion value) + { + Quaternion ans; + + ans.X = -value.X; + ans.Y = -value.Y; + ans.Z = -value.Z; + ans.W = value.W; + + return ans; + } + + /// Creates a Quaternion from a normalized vector axis and an angle to rotate about the vector. + /// The unit vector to rotate around. + /// This vector must be normalized before calling this function or the resulting Quaternion will be incorrect. + /// The angle, in radians, to rotate around the vector. + /// The created Quaternion. + public static Quaternion CreateFromAxisAngle(Vector3D axis, T angle) + { + Quaternion ans; + + var halfAngle = angle / T.CreateTruncating(2); + var s = T.Sin(halfAngle); + var c = T.Cos(halfAngle); + + ans.X = axis.X * s; + ans.Y = axis.Y * s; + ans.Z = axis.Z * s; + ans.W = c; + + return ans; + } + + /// Creates a Quaternion from the given rotation matrix. + /// The rotation matrix. + /// The created Quaternion. + public static Quaternion CreateFromRotationMatrix(Matrix4X4 matrix) + { + var trace = matrix.M11 + matrix.M22 + matrix.M33; + + Quaternion q = default; + + if (trace > T.Zero) + { + var s = T.Sqrt(trace + T.One); + q.W = s / T.CreateTruncating(2); + s = T.One / (T.CreateTruncating(2) * s); + q.X = (matrix.M23 - matrix.M32) * s; + q.Y = (matrix.M31 - matrix.M13) * s; + q.Z = (matrix.M12 - matrix.M21) * s; + } + else + { + if ((matrix.M11 >= matrix.M22) && (matrix.M11 >= matrix.M33)) + { + var s = T.Sqrt(T.One + matrix.M11 - matrix.M22 - matrix.M33); + var invS = T.One / (T.CreateTruncating(2) * s); + q.X = s / T.CreateTruncating(2); + q.Y = (matrix.M12 + matrix.M21) * invS; + q.Z = (matrix.M13 + matrix.M31) * invS; + q.W = (matrix.M23 - matrix.M32) * invS; + } + else if (matrix.M22 > matrix.M33) + { + var s = T.Sqrt(T.One + matrix.M22 - matrix.M11 - matrix.M33); + var invS = T.One / (T.CreateTruncating(2) * s); + q.X = (matrix.M21 + matrix.M12) * invS; + q.Y = s / T.CreateTruncating(2); + q.Z = (matrix.M32 + matrix.M23) * invS; + q.W = (matrix.M31 - matrix.M13) * invS; + } + else + { + var s = T.Sqrt(T.One + matrix.M33 - matrix.M11 - matrix.M22); + var invS = T.One / (T.CreateTruncating(2) * s); + q.X = (matrix.M31 + matrix.M13) * invS; + q.Y = (matrix.M32 + matrix.M23) * invS; + q.Z = s / T.CreateTruncating(2); + q.W = (matrix.M12 - matrix.M21) * invS; + } + } + + return q; + } + + /// Creates a Quaternion from the given rotation matrix. + /// The rotation matrix. + /// The created Quaternion. + public static Quaternion CreateFromRotationMatrix(Matrix3X3 matrix) + { + var trace = matrix.M11 + matrix.M22 + matrix.M33; + + Quaternion q = default; + + if (trace > T.Zero) + { + var s = T.Sqrt(trace + T.One); + q.W = s / T.CreateTruncating(2); + s = T.One / (T.CreateTruncating(2) * s); + q.X = (matrix.M23 - matrix.M32) * s; + q.Y = (matrix.M31 - matrix.M13) * s; + q.Z = (matrix.M12 - matrix.M21) * s; + } + else + { + if ((matrix.M11 >= matrix.M22) && (matrix.M11 >= matrix.M33)) + { + var s = T.Sqrt(T.One + matrix.M11 - matrix.M22 - matrix.M33); + var invS = T.One / (T.CreateTruncating(2) * s); + q.X = s / T.CreateTruncating(2); + q.Y = (matrix.M12 + matrix.M21) * invS; + q.Z = (matrix.M13 + matrix.M31) * invS; + q.W = (matrix.M23 - matrix.M32) * invS; + } + else if (matrix.M22 > matrix.M33) + { + var s = T.Sqrt(T.One + matrix.M22 - matrix.M11 - matrix.M33); + var invS = T.One / (T.CreateTruncating(2) * s); + q.X = (matrix.M21 + matrix.M12) * invS; + q.Y = s / T.CreateTruncating(2); + q.Z = (matrix.M32 + matrix.M23) * invS; + q.W = (matrix.M31 - matrix.M13) * invS; + } + else + { + var s = T.Sqrt(T.One + matrix.M33 - matrix.M11 - matrix.M22); + var invS = T.One / (T.CreateTruncating(2) * s); + q.X = (matrix.M31 + matrix.M13) * invS; + q.Y = (matrix.M32 + matrix.M23) * invS; + q.Z = s / T.CreateTruncating(2); + q.W = (matrix.M12 - matrix.M21) * invS; + } + } + + return q; + } + + /// Creates a new Quaternion from the given yaw, pitch, and roll, in radians. + /// The yaw angle, in radians, around the Y-axis. + /// The pitch angle, in radians, around the X-axis. + /// The roll angle, in radians, around the Z-axis. + /// + public static Quaternion CreateFromYawPitchRoll(T yaw, T pitch, T roll) + { + // Roll first, about axis the object is facing, then + // pitch upward, then yaw to face into the new heading + T sr, cr, sp, cp, sy, cy; + + var halfRoll = roll / T.CreateTruncating(2); + sr = T.Sin(halfRoll); + cr = T.Cos(halfRoll); + + var halfPitch = pitch / T.CreateTruncating(2); + sp = T.Sin(halfPitch); + cp = T.Cos(halfPitch); + + var halfYaw = yaw / T.CreateTruncating(2); + sy = T.Sin(halfYaw); + cy = T.Cos(halfYaw); + + Quaternion result; + + result.X = (cy * sp * cr) + (sy * cp * sr); + result.Y = (sy * cp * cr) - (cy * sp * sr); + result.Z = (cy * cp * sr) - (sy * sp * cr); + result.W = (cy * cp * cr) + (sy * sp * sr); + + return result; + } + + /// Divides a Quaternion by another Quaternion. + /// The source Quaternion. + /// The divisor. + /// The result of the division. + [MethodImpl((MethodImplOptions)768)] + public static Quaternion Divide(Quaternion value1, Quaternion value2) + => value1 / value2; + + /// Calculates the dot product of two Quaternions. + /// The first source Quaternion. + /// The second source Quaternion. + /// The dot product of the Quaternions. + public static T Dot(Quaternion quaternion1, Quaternion quaternion2) + { + return (quaternion1.X * quaternion2.X) + + (quaternion1.Y * quaternion2.Y) + + (quaternion1.Z * quaternion2.Z) + + (quaternion1.W * quaternion2.W); + } + + /// Returns the inverse of a Quaternion. + /// The source Quaternion. + /// The inverted Quaternion. + public static Quaternion Inverse(Quaternion value) + { + // -1 ( a -v ) + // q = ( ------------- ------------- ) + // ( a^2 + |v|^2 , a^2 + |v|^2 ) + + Quaternion ans; + + T ls = (value.X * value.X) + (value.Y * value.Y) + (value.Z * value.Z) + (value.W * value.W); + var invNorm = T.One / ls; + + ans.X = -(value.X * invNorm); + ans.Y = -(value.Y * invNorm); + ans.Z = -(value.Z * invNorm); + ans.W = value.W * invNorm; + + return ans; + } + + /// Linearly interpolates between two quaternions. + /// The first source Quaternion. + /// The second source Quaternion. + /// The relative weight of the second source Quaternion in the interpolation. + /// The interpolated Quaternion. + public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, T amount) + { + var t = amount; + var t1 = T.One - t; + + Quaternion r = default; + + T dot = (quaternion1.X * quaternion2.X) + + (quaternion1.Y * quaternion2.Y) + + (quaternion1.Z * quaternion2.Z) + + (quaternion1.W * quaternion2.W); + + if (dot >= T.Zero) + { + r.X = (t1 * quaternion1.X) + (t * quaternion2.X); + r.Y = (t1 * quaternion1.Y) + (t * quaternion2.Y); + r.Z = (t1 * quaternion1.Z) + (t * quaternion2.Z); + r.W = (t1 * quaternion1.W) + (t * quaternion2.W); + } + else + { + r.X = (t1 * quaternion1.X) - (t * quaternion2.X); + r.Y = (t1 * quaternion1.Y) - (t * quaternion2.Y); + r.Z = (t1 * quaternion1.Z) - (t * quaternion2.Z); + r.W = (t1 * quaternion1.W) - (t * quaternion2.W); + } + + // Normalize it. + T ls = (r.X * r.X) + (r.Y * r.Y) + (r.Z * r.Z) + (r.W * r.W); + var invNorm = T.One / T.Sqrt(ls); + + r.X = r.X * invNorm; + r.Y = r.Y * invNorm; + r.Z = r.Z * invNorm; + r.W = r.W * invNorm; + + return r; + } + + /// Multiplies two Quaternions together. + /// The Quaternion on the left side of the multiplication. + /// The Quaternion on the right side of the multiplication. + /// The result of the multiplication. + [MethodImpl((MethodImplOptions)768)] + public static Quaternion Multiply(Quaternion value1, Quaternion value2) + => value1 * value2; + + /// Multiplies a Quaternion by a scalar value. + /// The source Quaternion. + /// The scalar value. + /// The result of the multiplication. + [MethodImpl((MethodImplOptions)768)] + public static Quaternion Multiply(Quaternion value1, T value2) + => value1 * value2; + + /// Flips the sign of each component of the quaternion. + /// The source Quaternion. + /// The negated Quaternion. + [MethodImpl((MethodImplOptions)768)] + public static Quaternion Negate(Quaternion value) + => -value; + + /// Divides each component of the Quaternion by the length of the Quaternion. + /// The source Quaternion. + /// The normalized Quaternion. + public static Quaternion Normalize(Quaternion value) + { + Quaternion ans; + + T ls = (value.X * value.X) + (value.Y * value.Y) + (value.Z * value.Z) + (value.W * value.W); + var invNorm = T.One / T.Sqrt(ls); + + ans.X = value.X * invNorm; + ans.Y = value.Y * invNorm; + ans.Z = value.Z * invNorm; + ans.W = value.W * invNorm; + + return ans; + } + + /// Interpolates between two quaternions, using spherical linear interpolation. + /// The first source Quaternion. + /// The second source Quaternion. + /// The relative weight of the second source Quaternion in the interpolation. + /// The interpolated Quaternion. + public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, T amount) + { + var t = amount; + + T cosOmega = (quaternion1.X * quaternion2.X) + (quaternion1.Y * quaternion2.Y) + (quaternion1.Z * quaternion2.Z) + (quaternion1.W * quaternion2.W); + + var flip = false; + + if (!(cosOmega >= T.Zero)) + { + flip = true; + cosOmega = -cosOmega; + } + + T s1, s2; + + if (cosOmega > T.One - T.CreateTruncating(SlerpEpsilon)) + { + // Too close, do straight linear interpolation. + s1 = T.One - t; + s2 = flip ? -t : t; + } + else + { + var omega = T.Acos(cosOmega); + var invSinOmega = T.One / T.Sin(omega); + + s1 = T.Sin((T.One - t) * omega) * invSinOmega; + s2 = flip + ? -T.Sin(t * omega) * invSinOmega + : T.Sin(t * omega) * invSinOmega; + } + + Quaternion ans; + + ans.X = (s1 * quaternion1.X) + (s2 * quaternion2.X); + ans.Y = (s1 * quaternion1.Y) + (s2 * quaternion2.Y); + ans.Z = (s1 * quaternion1.Z) + (s2 * quaternion2.Z); + ans.W = (s1 * quaternion1.W) + (s2 * quaternion2.W); + + return ans; + } + + /// Subtracts one Quaternion from another. + /// The first source Quaternion. + /// The second Quaternion, to be subtracted from the first. + /// The result of the subtraction. + [MethodImpl((MethodImplOptions)768)] + public static Quaternion Subtract(Quaternion value1, Quaternion value2) + => value1 - value2; + + /// Calculates the length of the Quaternion. + /// The computed length of the Quaternion. + public readonly T Length() + => T.Sqrt(LengthSquared()); + + /// Calculates the length squared of the Quaternion. This operation is cheaper than Length(). + /// The length squared of the Quaternion. + public readonly T LengthSquared() + => (X * X) + (Y * Y) + (Z * Z) + (W * W); + + /// Returns a String representing this Quaternion instance. + /// The string representation. + public override readonly string ToString() + { + return string.Format(CultureInfo.CurrentCulture, "{{X:{0} Y:{1} Z:{2} W:{3}}}", X, Y, Z, W); + } + + /// + /// Converts a into one with a of + /// + /// The source matrix + /// The matrix + public static explicit operator Quaternion(Quaternion from) + => new(Half.CreateTruncating(from.X), Half.CreateTruncating(from.Y), Half.CreateTruncating(from.Z), + Half.CreateTruncating(from.W)); + + /// + /// Converts a into one with a of + /// + /// The source matrix + /// The matrix + public static explicit operator Quaternion(Quaternion from) + => new(float.CreateTruncating(from.X), float.CreateTruncating(from.Y), float.CreateTruncating(from.Z), + float.CreateTruncating(from.W)); + + /// + /// Converts a into + /// + /// The source quaternion + /// The quaternion + public static explicit operator Quaternion(Quaternion from) + => new(float.CreateTruncating(from.X), float.CreateTruncating(from.Y), float.CreateTruncating(from.Z), + float.CreateTruncating(from.W)); + + /// + /// Converts a into one with a of + /// + /// The source matrix + /// The matrix + public static explicit operator Quaternion(Quaternion from) + => new(double.CreateTruncating(from.X), double.CreateTruncating(from.Y), double.CreateTruncating(from.Z), + double.CreateTruncating(from.W)); + + /// + /// Returns this quaternion casted to + /// + /// The type to cast to + /// The casted quaternion + public Quaternion As() + where TOther : INumber, IRootFunctions, ITrigonometricFunctions + { + return new(TOther.CreateTruncating(X), TOther.CreateTruncating(Y), TOther.CreateTruncating(Z), TOther.CreateTruncating(W)); + } + } +} diff --git a/sources/Maths/Maths/Quaternion.cs b/sources/Maths/Maths/Quaternion.cs index 67f99086a2..35e13124b8 100644 --- a/sources/Maths/Maths/Quaternion.cs +++ b/sources/Maths/Maths/Quaternion.cs @@ -2,23 +2,22 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; -using System.Globalization; -using System.Runtime.CompilerServices; +using System.Collections.Generic; +using System.Linq; +using System.Numerics; using System.Runtime.Serialization; +using System.Text; +using System.Threading.Tasks; namespace Silk.NET.Maths { /// - /// Represents a vector that is used to encode three-dimensional physical rotations. + /// Represents a four-dimensional vector used to encode 3D rotations. /// - /// The type used to store values. - [Serializable] - [DataContract] - public struct Quaternion - : IEquatable> where T : unmanaged, IFormattable, IEquatable, IComparable + public partial struct Quaternion : + IEquatable> + where T : INumber, IRootFunctions, ITrigonometricFunctions { - private const float SlerpEpsilon = 1e-6f; - /// Specifies the X-value of the vector component of the Quaternion. [DataMember] public T X; @@ -31,15 +30,15 @@ public struct Quaternion [DataMember] public T Z; - /// Specifies the rotation component of the Quaternion. + /// Specifies the rotation (W) component of the Quaternion. [DataMember] public T W; /// Constructs a Quaternion from the given components. - /// The X component of the Quaternion. - /// The Y component of the Quaternion. - /// The Z component of the Quaternion. - /// The W component of the Quaternion. + /// The X-component of the Quaternion. + /// The Y-component of the Quaternion. + /// The Z-component of the Quaternion. + /// The rotation (W) component of the Quaternion. public Quaternion(T x, T y, T z, T w) { X = x; @@ -48,746 +47,49 @@ public Quaternion(T x, T y, T z, T w) W = w; } - /// Constructs a Quaternion from the given vector and rotation parts. - /// The vector part of the Quaternion. - /// The rotation part of the Quaternion. - public Quaternion(Vector3D vectorPart, T scalarPart) - { - X = vectorPart.X; - Y = vectorPart.Y; - Z = vectorPart.Z; - W = scalarPart; - } - - /// Returns a Quaternion representing no rotation. - public static Quaternion Identity => new(Scalar.Zero, Scalar.Zero, Scalar.Zero, Scalar.One); - - /// Returns whether the Quaternion is the identity Quaternion. - [IgnoreDataMember] - public readonly bool IsIdentity => this == Identity; - - /// Adds two Quaternions element-by-element. - /// The first source Quaternion. - /// The second source Quaternion. - /// The result of adding the Quaternions. - public static Quaternion operator +(Quaternion value1, Quaternion value2) - { - Quaternion ans; - - ans.X = Scalar.Add(value1.X, value2.X); - ans.Y = Scalar.Add(value1.Y, value2.Y); - ans.Z = Scalar.Add(value1.Z, value2.Z); - ans.W = Scalar.Add(value1.W, value2.W); - - return ans; - } - - /// Divides a Quaternion by another Quaternion. - /// The source Quaternion. - /// The divisor. - /// The result of the division. - public static Quaternion operator /(Quaternion value1, Quaternion value2) - { - Quaternion ans; - - T q1x = value1.X; - T q1y = value1.Y; - T q1z = value1.Z; - T q1w = value1.W; - - //------------------------------------- - // Inverse part. - T ls = Scalar.Add( - Scalar.Add( - Scalar.Add(Scalar.Multiply(value2.X, value2.X), Scalar.Multiply(value2.Y, value2.Y)), - Scalar.Multiply(value2.Z, value2.Z)), Scalar.Multiply(value2.W, value2.W)); - T invNorm = Scalar.Reciprocal(ls); - - T q2x = Scalar.Negate(Scalar.Multiply(value2.X, invNorm)); - T q2y = Scalar.Negate(Scalar.Multiply(value2.Y, invNorm)); - T q2z = Scalar.Negate(Scalar.Multiply(value2.Z, invNorm)); - T q2w = Scalar.Multiply(value2.W, invNorm); - - //------------------------------------- - // Multiply part. - - // cross(av, bv) - T cx = Scalar.Subtract(Scalar.Multiply(q1y, q2z), Scalar.Multiply(q1z, q2y)); - T cy = Scalar.Subtract(Scalar.Multiply(q1z, q2x), Scalar.Multiply(q1x, q2z)); - T cz = Scalar.Subtract(Scalar.Multiply(q1x, q2y), Scalar.Multiply(q1y, q2x)); - - T dot = Scalar.Add(Scalar.Add(Scalar.Multiply(q1x, q2x), Scalar.Multiply(q1y, q2y)), - Scalar.Multiply(q1z, q2z)); - - ans.X = Scalar.Add(Scalar.Add(Scalar.Multiply(q1x, q2w), Scalar.Multiply(q2x, q1w)), cx); - ans.Y = Scalar.Add(Scalar.Add(Scalar.Multiply(q1y, q2w), Scalar.Multiply(q2y, q1w)), cy); - ans.Z = Scalar.Add(Scalar.Add(Scalar.Multiply(q1z, q2w), Scalar.Multiply(q2z, q1w)), cz); - ans.W = Scalar.Subtract(Scalar.Multiply(q1w, q2w), dot); - - return ans; - } - - /// Returns a boolean indicating whether the two given Quaternions are equal. - /// The first Quaternion to compare. - /// The second Quaternion to compare. - /// True if the Quaternions are equal; False otherwise. - public static bool operator ==(Quaternion value1, Quaternion value2) - => Scalar.Equal(value1.X, value2.X) - && Scalar.Equal(value1.Y, value2.Y) - && Scalar.Equal(value1.Z, value2.Z) - && Scalar.Equal(value1.W, value2.W); - - /// Returns a boolean indicating whether the two given Quaternions are not equal. - /// The first Quaternion to compare. - /// The second Quaternion to compare. - /// True if the Quaternions are not equal; False if they are equal. - public static bool operator !=(Quaternion value1, Quaternion value2) - => !(value1 == value2); - - /// Multiplies two Quaternions together. - /// The Quaternion on the left side of the multiplication. - /// The Quaternion on the right side of the multiplication. - /// The result of the multiplication. - public static Quaternion operator *(Quaternion value1, Quaternion value2) - { - Quaternion ans; - - T q1x = value1.X; - T q1y = value1.Y; - T q1z = value1.Z; - T q1w = value1.W; - - T q2x = value2.X; - T q2y = value2.Y; - T q2z = value2.Z; - T q2w = value2.W; - - // cross(av, bv) - T cx = Scalar.Subtract(Scalar.Multiply(q1y, q2z), Scalar.Multiply(q1z, q2y)); - T cy = Scalar.Subtract(Scalar.Multiply(q1z, q2x), Scalar.Multiply(q1x, q2z)); - T cz = Scalar.Subtract(Scalar.Multiply(q1x, q2y), Scalar.Multiply(q1y, q2x)); - - T dot = Scalar.Add(Scalar.Add(Scalar.Multiply(q1x, q2x), Scalar.Multiply(q1y, q2y)), - Scalar.Multiply(q1z, q2z)); - - ans.X = Scalar.Add(Scalar.Add(Scalar.Multiply(q1x, q2w), Scalar.Multiply(q2x, q1w)), cx); - ans.Y = Scalar.Add(Scalar.Add(Scalar.Multiply(q1y, q2w), Scalar.Multiply(q2y, q1w)), cy); - ans.Z = Scalar.Add(Scalar.Add(Scalar.Multiply(q1z, q2w), Scalar.Multiply(q2z, q1w)), cz); - ans.W = Scalar.Subtract(Scalar.Multiply(q1w, q2w), dot); - - return ans; - } - - /// Multiplies a Quaternion by a scalar value. - /// The source Quaternion. - /// The scalar value. - /// The result of the multiplication. - public static Quaternion operator *(Quaternion value1, T value2) - { - Quaternion ans; - - ans.X = Scalar.Multiply(value1.X, value2); - ans.Y = Scalar.Multiply(value1.Y, value2); - ans.Z = Scalar.Multiply(value1.Z, value2); - ans.W = Scalar.Multiply(value1.W, value2); - - return ans; - } - - /// Subtracts one Quaternion from another. - /// The first source Quaternion. - /// The second Quaternion, to be subtracted from the first. - /// The result of the subtraction. - public static Quaternion operator -(Quaternion value1, Quaternion value2) - { - Quaternion ans; - - ans.X = Scalar.Subtract(value1.X, value2.X); - ans.Y = Scalar.Subtract(value1.Y, value2.Y); - ans.Z = Scalar.Subtract(value1.Z, value2.Z); - ans.W = Scalar.Subtract(value1.W, value2.W); - - return ans; - } - - /// Flips the sign of each component of the quaternion. - /// The source Quaternion. - /// The negated Quaternion. - public static Quaternion operator -(Quaternion value) - { - Quaternion ans; - - ans.X = Scalar.Negate(value.X); - ans.Y = Scalar.Negate(value.Y); - ans.Z = Scalar.Negate(value.Z); - ans.W = Scalar.Negate(value.W); - - return ans; - } - - /// Adds two Quaternions element-by-element. - /// The first source Quaternion. - /// The second source Quaternion. - /// The result of adding the Quaternions. - [MethodImpl((MethodImplOptions) 768)] - public static Quaternion Add(Quaternion value1, Quaternion value2) - => value1 + value2; - - /// Concatenates two Quaternions; the result represents the value1 rotation followed by the value2 rotation. - /// The first Quaternion rotation in the series. - /// The second Quaternion rotation in the series. - /// A new Quaternion representing the concatenation of the value1 rotation followed by the value2 rotation. - public static Quaternion Concatenate(Quaternion value1, Quaternion value2) - { - Quaternion ans; - - // Concatenate rotation is actually q2 * q1 instead of q1 * q2. - // So that's why value2 goes q1 and value1 goes q2. - T q1x = value2.X; - T q1y = value2.Y; - T q1z = value2.Z; - T q1w = value2.W; - - T q2x = value1.X; - T q2y = value1.Y; - T q2z = value1.Z; - T q2w = value1.W; + /// Gets the rotation angle represented by the . + public T Angle => T.CreateChecked(2) * T.Acos(W); - // cross(av, bv) - T cx = Scalar.Subtract(Scalar.Multiply(q1y, q2z), Scalar.Multiply(q1z, q2y)); - T cy = Scalar.Subtract(Scalar.Multiply(q1z, q2x), Scalar.Multiply(q1x, q2z)); - T cz = Scalar.Subtract(Scalar.Multiply(q1x, q2y), Scalar.Multiply(q1y, q2x)); + ///Gets the component at the specified index: 0 = X, 1 = Y, 2 = Z, 3 = W. + // TODO: Make this a ref + public T this[int index] => index switch { + 0 => X, + 1 => Y, + 2 => Z, + 3 => W, + _ => throw new IndexOutOfRangeException(nameof(index)) + }; - T dot = Scalar.Add(Scalar.Add(Scalar.Multiply(q1x, q2x), Scalar.Multiply(q1y, q2y)), - Scalar.Multiply(q1z, q2z)); + // TODO: Vector4F/Vector3F constructors - ans.X = Scalar.Add(Scalar.Add(Scalar.Multiply(q1x, q2w), Scalar.Multiply(q2x, q1w)), cx); - ans.Y = Scalar.Add(Scalar.Add(Scalar.Multiply(q1y, q2w), Scalar.Multiply(q2y, q1w)), cy); - ans.Z = Scalar.Add(Scalar.Add(Scalar.Multiply(q1z, q2w), Scalar.Multiply(q2z, q1w)), cz); - ans.W = Scalar.Subtract(Scalar.Multiply(q1w, q2w), dot); + /// Returns a representing no rotation. + public static Quaternion Identity { get; } = new Quaternion(T.Zero, T.Zero, T.Zero, T.One); - return ans; - } - - /// Creates the conjugate of a specified Quaternion. - /// The Quaternion of which to return the conjugate. - /// A new Quaternion that is the conjugate of the specified one. - public static Quaternion Conjugate(Quaternion value) - { - Quaternion ans; + /// Returns a boolean indicating whether the given Object is equal to this instance. + public override bool Equals(object? obj) => + obj is Quaternion other && Equals(other); - ans.X = Scalar.Negate(value.X); - ans.Y = Scalar.Negate(value.Y); - ans.Z = Scalar.Negate(value.Z); - ans.W = value.W; - - return ans; - } - - /// Creates a Quaternion from a normalized vector axis and an angle to rotate about the vector. - /// The unit vector to rotate around. - /// This vector must be normalized before calling this function or the resulting Quaternion will be incorrect. - /// The angle, in radians, to rotate around the vector. - /// The created Quaternion. - public static Quaternion CreateFromAxisAngle(Vector3D axis, T angle) - { - Quaternion ans; - - T halfAngle = Scalar.Divide(angle, Scalar.Two); - T s = Scalar.Sin(halfAngle); - T c = Scalar.Cos(halfAngle); - - ans.X = Scalar.Multiply(axis.X, s); - ans.Y = Scalar.Multiply(axis.Y, s); - ans.Z = Scalar.Multiply(axis.Z, s); - ans.W = c; - - return ans; - } - - /// Creates a Quaternion from the given rotation matrix. - /// The rotation matrix. - /// The created Quaternion. - public static Quaternion CreateFromRotationMatrix(Matrix4X4 matrix) - { - T trace = Scalar.Add(Scalar.Add(matrix.M11, matrix.M22), matrix.M33); - - Quaternion q = default; - - if (Scalar.GreaterThan(trace, Scalar.Zero)) - { - T s = Scalar.Sqrt(Scalar.Add(trace, Scalar.One)); - q.W = Scalar.Divide(s, Scalar.Two); - s = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Multiply(Scalar.Subtract(matrix.M23, matrix.M32), s); - q.Y = Scalar.Multiply(Scalar.Subtract(matrix.M31, matrix.M13), s); - q.Z = Scalar.Multiply(Scalar.Subtract(matrix.M12, matrix.M21), s); - } - else - { - if (Scalar.GreaterThanOrEqual(matrix.M11, matrix.M22) && Scalar.GreaterThanOrEqual(matrix.M11, matrix.M33)) - { - T s = Scalar.Sqrt(Scalar.Subtract(Scalar.Subtract(Scalar.Add(Scalar.One, matrix.M11), matrix.M22), matrix.M33)); - T invS = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Divide(s, Scalar.Two); - q.Y = Scalar.Multiply(Scalar.Add(matrix.M12, matrix.M21), invS); - q.Z = Scalar.Multiply(Scalar.Add(matrix.M13, matrix.M31), invS); - q.W = Scalar.Multiply(Scalar.Subtract(matrix.M23, matrix.M32), invS); - } - else if (Scalar.GreaterThan(matrix.M22, matrix.M33)) - { - T s = Scalar.Sqrt(Scalar.Subtract(Scalar.Subtract(Scalar.Add(Scalar.One, matrix.M22), matrix.M11), matrix.M33)); - T invS = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Multiply(Scalar.Add(matrix.M21, matrix.M12), invS); - q.Y = Scalar.Divide(s, Scalar.Two); - q.Z = Scalar.Multiply(Scalar.Add(matrix.M32, matrix.M23), invS); - q.W = Scalar.Multiply(Scalar.Subtract(matrix.M31, matrix.M13), invS); - } - else - { - T s = Scalar.Sqrt(Scalar.Subtract(Scalar.Subtract(Scalar.Add(Scalar.One, matrix.M33), matrix.M11), matrix.M22)); - T invS = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Multiply(Scalar.Add(matrix.M31, matrix.M13), invS); - q.Y = Scalar.Multiply(Scalar.Add(matrix.M32, matrix.M23), invS); - q.Z = Scalar.Divide(s, Scalar.Two); - q.W = Scalar.Multiply(Scalar.Subtract(matrix.M12, matrix.M21), invS); - } - } - - return q; - } - - /// Creates a Quaternion from the given rotation matrix. - /// The rotation matrix. - /// The created Quaternion. - public static Quaternion CreateFromRotationMatrix(Matrix3X3 matrix) - { - T trace = Scalar.Add(Scalar.Add(matrix.M11, matrix.M22), matrix.M33); - - Quaternion q = default; - - if (Scalar.GreaterThan(trace, Scalar.Zero)) - { - T s = Scalar.Sqrt(Scalar.Add(trace, Scalar.One)); - q.W = Scalar.Divide(s, Scalar.Two); - s = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Multiply(Scalar.Subtract(matrix.M23, matrix.M32), s); - q.Y = Scalar.Multiply(Scalar.Subtract(matrix.M31, matrix.M13), s); - q.Z = Scalar.Multiply(Scalar.Subtract(matrix.M12, matrix.M21), s); - } - else - { - if (Scalar.GreaterThanOrEqual(matrix.M11, matrix.M22) && Scalar.GreaterThanOrEqual(matrix.M11, matrix.M33)) - { - T s = Scalar.Sqrt(Scalar.Subtract(Scalar.Subtract(Scalar.Add(Scalar.One, matrix.M11), matrix.M22), matrix.M33)); - T invS = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Divide(s, Scalar.Two); - q.Y = Scalar.Multiply(Scalar.Add(matrix.M12, matrix.M21), invS); - q.Z = Scalar.Multiply(Scalar.Add(matrix.M13, matrix.M31), invS); - q.W = Scalar.Multiply(Scalar.Subtract(matrix.M23, matrix.M32), invS); - } - else if (Scalar.GreaterThan(matrix.M22, matrix.M33)) - { - T s = Scalar.Sqrt(Scalar.Subtract(Scalar.Subtract(Scalar.Add(Scalar.One, matrix.M22), matrix.M11), matrix.M33)); - T invS = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Multiply(Scalar.Add(matrix.M21, matrix.M12), invS); - q.Y = Scalar.Divide(s, Scalar.Two); - q.Z = Scalar.Multiply(Scalar.Add(matrix.M32, matrix.M23), invS); - q.W = Scalar.Multiply(Scalar.Subtract(matrix.M31, matrix.M13), invS); - } - else - { - T s = Scalar.Sqrt(Scalar.Subtract(Scalar.Subtract(Scalar.Add(Scalar.One, matrix.M33), matrix.M11), matrix.M22)); - T invS = Scalar.Reciprocal(Scalar.Multiply(Scalar.Two, s)); - q.X = Scalar.Multiply(Scalar.Add(matrix.M31, matrix.M13), invS); - q.Y = Scalar.Multiply(Scalar.Add(matrix.M32, matrix.M23), invS); - q.Z = Scalar.Divide(s, Scalar.Two); - q.W = Scalar.Multiply(Scalar.Subtract(matrix.M12, matrix.M21), invS); - } - } - - return q; - } - - /// Creates a new Quaternion from the given yaw, pitch, and roll, in radians. - /// The yaw angle, in radians, around the Y-axis. - /// The pitch angle, in radians, around the X-axis. - /// The roll angle, in radians, around the Z-axis. - /// - public static Quaternion CreateFromYawPitchRoll(T yaw, T pitch, T roll) - { - // Roll first, about axis the object is facing, then - // pitch upward, then yaw to face into the new heading - T sr, cr, sp, cp, sy, cy; - - T halfRoll = Scalar.Divide(roll, Scalar.Two); - sr = Scalar.Sin(halfRoll); - cr = Scalar.Cos(halfRoll); - - T halfPitch = Scalar.Divide(pitch, Scalar.Two); - sp = Scalar.Sin(halfPitch); - cp = Scalar.Cos(halfPitch); - - T halfYaw = Scalar.Divide(yaw, Scalar.Two); - sy = Scalar.Sin(halfYaw); - cy = Scalar.Cos(halfYaw); - - Quaternion result; - - result.X = Scalar.Add(Scalar.Multiply(Scalar.Multiply(cy, sp), cr), Scalar.Multiply(Scalar.Multiply(sy, cp), sr)); - result.Y = Scalar.Subtract(Scalar.Multiply(Scalar.Multiply(sy, cp), cr), Scalar.Multiply(Scalar.Multiply(cy, sp), sr)); - result.Z = Scalar.Subtract(Scalar.Multiply(Scalar.Multiply(cy, cp), sr), Scalar.Multiply(Scalar.Multiply(sy, sp), cr)); - result.W = Scalar.Add(Scalar.Multiply(Scalar.Multiply(cy, cp), cr), Scalar.Multiply(Scalar.Multiply(sy, sp), sr)); - - return result; - } - - /// Divides a Quaternion by another Quaternion. - /// The source Quaternion. - /// The divisor. - /// The result of the division. - [MethodImpl((MethodImplOptions) 768)] - public static Quaternion Divide(Quaternion value1, Quaternion value2) - => value1 / value2; - - /// Calculates the dot product of two Quaternions. - /// The first source Quaternion. - /// The second source Quaternion. - /// The dot product of the Quaternions. - public static T Dot(Quaternion quaternion1, Quaternion quaternion2) - { - return Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(quaternion1.X, quaternion2.X), - Scalar.Multiply(quaternion1.Y, quaternion2.Y)), - Scalar.Multiply(quaternion1.Z, quaternion2.Z)), - Scalar.Multiply(quaternion1.W, quaternion2.W)); - } - - /// Returns the inverse of a Quaternion. - /// The source Quaternion. - /// The inverted Quaternion. - public static Quaternion Inverse(Quaternion value) - { - // -1 ( a -v ) - // q = ( ------------- ------------- ) - // ( a^2 + |v|^2 , a^2 + |v|^2 ) - - Quaternion ans; - - T ls = Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, value.X), Scalar.Multiply(value.Y, value.Y)), Scalar.Multiply(value.Z, value.Z)), Scalar.Multiply(value.W, value.W)); - T invNorm = Scalar.Reciprocal(ls); - - ans.X = Scalar.Negate(Scalar.Multiply(value.X, invNorm)); - ans.Y = Scalar.Negate(Scalar.Multiply(value.Y, invNorm)); - ans.Z = Scalar.Negate(Scalar.Multiply(value.Z, invNorm)); - ans.W = Scalar.Multiply(value.W, invNorm); - - return ans; - } - - /// Linearly interpolates between two quaternions. - /// The first source Quaternion. - /// The second source Quaternion. - /// The relative weight of the second source Quaternion in the interpolation. - /// The interpolated Quaternion. - public static Quaternion Lerp(Quaternion quaternion1, Quaternion quaternion2, T amount) - { - T t = amount; - T t1 = Scalar.Subtract(Scalar.One, t); - - Quaternion r = default; - - T dot = Scalar.Add( - Scalar.Add( - Scalar.Add(Scalar.Multiply(quaternion1.X, quaternion2.X), - Scalar.Multiply(quaternion1.Y, quaternion2.Y)), - Scalar.Multiply(quaternion1.Z, quaternion2.Z)), - Scalar.Multiply(quaternion1.W, quaternion2.W)); - - if (Scalar.GreaterThanOrEqual(dot, Scalar.Zero)) - { - r.X = Scalar.Add(Scalar.Multiply(t1, quaternion1.X), Scalar.Multiply(t, quaternion2.X)); - r.Y = Scalar.Add(Scalar.Multiply(t1, quaternion1.Y), Scalar.Multiply(t, quaternion2.Y)); - r.Z = Scalar.Add(Scalar.Multiply(t1, quaternion1.Z), Scalar.Multiply(t, quaternion2.Z)); - r.W = Scalar.Add(Scalar.Multiply(t1, quaternion1.W), Scalar.Multiply(t, quaternion2.W)); - } - else - { - r.X = Scalar.Subtract(Scalar.Multiply(t1, quaternion1.X), Scalar.Multiply(t, quaternion2.X)); - r.Y = Scalar.Subtract(Scalar.Multiply(t1, quaternion1.Y), Scalar.Multiply(t, quaternion2.Y)); - r.Z = Scalar.Subtract(Scalar.Multiply(t1, quaternion1.Z), Scalar.Multiply(t, quaternion2.Z)); - r.W = Scalar.Subtract(Scalar.Multiply(t1, quaternion1.W), Scalar.Multiply(t, quaternion2.W)); - } - - // Normalize it. - T ls = Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(r.X, r.X), Scalar.Multiply(r.Y, r.Y)), Scalar.Multiply(r.Z, r.Z)), Scalar.Multiply(r.W, r.W)); - T invNorm = Scalar.Reciprocal(Scalar.Sqrt(ls)); - - r.X = Scalar.Multiply(r.X, invNorm); - r.Y = Scalar.Multiply(r.Y, invNorm); - r.Z = Scalar.Multiply(r.Z, invNorm); - r.W = Scalar.Multiply(r.W, invNorm); - - return r; - } - - /// Multiplies two Quaternions together. - /// The Quaternion on the left side of the multiplication. - /// The Quaternion on the right side of the multiplication. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Quaternion Multiply(Quaternion value1, Quaternion value2) - => value1 * value2; - - /// Multiplies a Quaternion by a scalar value. - /// The source Quaternion. - /// The scalar value. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Quaternion Multiply(Quaternion value1, T value2) - => value1 * value2; - - /// Flips the sign of each component of the quaternion. - /// The source Quaternion. - /// The negated Quaternion. - [MethodImpl((MethodImplOptions) 768)] - public static Quaternion Negate(Quaternion value) - => -value; - - /// Divides each component of the Quaternion by the length of the Quaternion. - /// The source Quaternion. - /// The normalized Quaternion. - public static Quaternion Normalize(Quaternion value) - { - Quaternion ans; - - T ls = Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, value.X), Scalar.Multiply(value.Y, value.Y)), Scalar.Multiply(value.Z, value.Z)), Scalar.Multiply(value.W, value.W)); - T invNorm = Scalar.Reciprocal(Scalar.Sqrt(ls)); - - ans.X = Scalar.Multiply(value.X, invNorm); - ans.Y = Scalar.Multiply(value.Y, invNorm); - ans.Z = Scalar.Multiply(value.Z, invNorm); - ans.W = Scalar.Multiply(value.W, invNorm); - - return ans; - } - - /// Interpolates between two quaternions, using spherical linear interpolation. - /// The first source Quaternion. - /// The second source Quaternion. - /// The relative weight of the second source Quaternion in the interpolation. - /// The interpolated Quaternion. - public static Quaternion Slerp(Quaternion quaternion1, Quaternion quaternion2, T amount) - { - T t = amount; - - T cosOmega = Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(quaternion1.X, quaternion2.X), Scalar.Multiply(quaternion1.Y, quaternion2.Y)), Scalar.Multiply(quaternion1.Z, quaternion2.Z)), Scalar.Multiply(quaternion1.W, quaternion2.W)); - - bool flip = false; - - if (!Scalar.GreaterThanOrEqual(cosOmega, Scalar.Zero)) - { - flip = true; - cosOmega = Scalar.Negate(cosOmega); - } - - T s1, s2; - - if (Scalar.GreaterThan(cosOmega, Scalar.Subtract(Scalar.One, Scalar.As(SlerpEpsilon)))) - { - // Too close, do straight linear interpolation. - s1 = Scalar.Subtract(Scalar.One, t); - s2 = flip ? Scalar.Negate(t) : t; - } - else - { - T omega = Scalar.Acos(cosOmega); - T invSinOmega = Scalar.Reciprocal(Scalar.Sin(omega)); - - s1 = Scalar.Multiply(Scalar.Sin(Scalar.Multiply(Scalar.Subtract(Scalar.One, t), omega)), invSinOmega); - s2 = (flip) - ? Scalar.Negate(Scalar.Multiply(Scalar.Sin(Scalar.Multiply(t, omega)), invSinOmega)) - : Scalar.Multiply(Scalar.Sin(Scalar.Multiply(t, omega)), invSinOmega); - } - - Quaternion ans; - - ans.X = Scalar.Add(Scalar.Multiply(s1, quaternion1.X), Scalar.Multiply(s2, quaternion2.X)); - ans.Y = Scalar.Add(Scalar.Multiply(s1, quaternion1.Y), Scalar.Multiply(s2, quaternion2.Y)); - ans.Z = Scalar.Add(Scalar.Multiply(s1, quaternion1.Z), Scalar.Multiply(s2, quaternion2.Z)); - ans.W = Scalar.Add(Scalar.Multiply(s1, quaternion1.W), Scalar.Multiply(s2, quaternion2.W)); - - return ans; - } - - /// Subtracts one Quaternion from another. - /// The first source Quaternion. - /// The second Quaternion, to be subtracted from the first. - /// The result of the subtraction. - [MethodImpl((MethodImplOptions) 768)] - public static Quaternion Subtract(Quaternion value1, Quaternion value2) - => value1 - value2; - - /// Returns a boolean indicating whether the given Object is equal to this Quaternion instance. - /// The Object to compare against. - /// True if the Object is equal to this Quaternion; False otherwise. - public override readonly bool Equals(object? obj) - => (obj is Quaternion other) && Equals(other); - - /// Returns a boolean indicating whether the given Quaternion is equal to this Quaternion instance. - /// The Quaternion to compare this instance to. - /// True if the other Quaternion is equal to this instance; False otherwise. - public readonly bool Equals(Quaternion other) - => this == other; + /// Returns a boolean indicating whether the given is equal to this instance. + public bool Equals(Quaternion other) => + this == other; /// Returns the hash code for this instance. /// The hash code. - public override readonly int GetHashCode() - { - return unchecked(X.GetHashCode() + Y.GetHashCode() + Z.GetHashCode() + W.GetHashCode()); - } - - /// Calculates the length of the Quaternion. - /// The computed length of the Quaternion. - public readonly T Length() - => Scalar.Sqrt(LengthSquared()); - - /// Calculates the length squared of the Quaternion. This operation is cheaper than Length(). - /// The length squared of the Quaternion. - public readonly T LengthSquared() - => Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(X, X), Scalar.Multiply(Y, Y)), Scalar.Multiply(Z, Z)), Scalar.Multiply(W, W)); + public override int GetHashCode() => + HashCode.Combine(X, Y, Z, W); - /// Returns a String representing this Quaternion instance. - /// The string representation. - public override readonly string ToString() - { - return string.Format(CultureInfo.CurrentCulture, "{{X:{0} Y:{1} Z:{2} W:{3}}}", X, Y, Z, W); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into - /// - /// The source quaternion - /// The quaternion - public static explicit operator System.Numerics.Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); + /// Returns a boolean indicating whether the two given Quaternions are not equal. + /// The first Quaternion to compare. + /// The second Quaternion to compare. + /// True if the Quaternions are not equal; False if they are equal. + public static bool operator !=(Quaternion left, Quaternion right) => + !(left == right); - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Quaternion(Quaternion from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Returns this quaternion casted to - /// - /// The type to cast to - /// The casted quaternion - public Quaternion As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Scalar.As(X), Scalar.As(Y), Scalar.As(Z), Scalar.As(W)); - } + /// Returns a boolean indicating whether the two given Quaternions are equal. + /// The first Quaternion to compare. + /// The second Quaternion to compare. + /// True if the Quaternions are equal; False otherwise. + public static bool operator ==(Quaternion left, Quaternion right) => + left.X == right.X && left.Y == right.Y && left.Z == right.Z && left.W == right.W; } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Ray2D.cs b/sources/Maths/Maths/Ray2D.cs index 91b181f2fd..00b09dbcfe 100644 --- a/sources/Maths/Maths/Ray2D.cs +++ b/sources/Maths/Maths/Ray2D.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.Serialization; namespace Silk.NET.Maths @@ -14,7 +15,7 @@ namespace Silk.NET.Maths [DataContract] public struct Ray2D : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { /// /// The origin of this Ray. @@ -123,15 +124,17 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this ray casted to /// /// The type to cast to /// The casted ray - public Ray2D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Ray2D As() + where TOther : INumberBase { return new(Origin.As(), Direction.As()); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Ray3D.cs b/sources/Maths/Maths/Ray3D.cs index 14797d6756..44f14aab0f 100644 --- a/sources/Maths/Maths/Ray3D.cs +++ b/sources/Maths/Maths/Ray3D.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.Serialization; namespace Silk.NET.Maths @@ -14,7 +15,7 @@ namespace Silk.NET.Maths [DataContract] public struct Ray3D : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumberBase { /// /// The origin of this Ray. @@ -127,15 +128,16 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this ray casted to /// /// The type to cast to /// The casted ray - public Ray3D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Ray3D As() where TOther : INumberBase { return new(Origin.As(), Direction.As()); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Rectangle.Ops.cs b/sources/Maths/Maths/Rectangle.Ops.cs index 4913e6523c..29bdb3b64e 100644 --- a/sources/Maths/Maths/Rectangle.Ops.cs +++ b/sources/Maths/Maths/Rectangle.Ops.cs @@ -1,7 +1,8 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; namespace Silk.NET.Maths { @@ -20,10 +21,25 @@ public static class Rectangle /// The type. /// The constructed rectangle. public static Rectangle FromLTRB(T left, T top, T right, T bottom) - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { Vector2D o = new(left, top); return new Rectangle(o, new Vector2D(right, bottom) - o); } + + /// + /// Calculates the distance to the nearest edge from the point. + /// + /// The rectangle. + /// The point. + /// The distance. + public static T GetDistanceToNearestEdge(this Rectangle rectangle, Vector2D point) + where T : INumber, IRootFunctions + { + var max = rectangle.Max; + var dx = T.Max(T.Max(rectangle.Origin.X - point.X, T.Zero), point.X - max.X); + var dy = T.Max(T.Max(rectangle.Origin.Y - point.Y, T.Zero), point.Y - max.Y); + return T.Sqrt((dx * dx) + (dy * dy)); + } } } diff --git a/sources/Maths/Maths/Rectangle.cs b/sources/Maths/Maths/Rectangle.cs index 344d8f02a9..2912e8a625 100644 --- a/sources/Maths/Maths/Rectangle.cs +++ b/sources/Maths/Maths/Rectangle.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.Serialization; namespace Silk.NET.Maths @@ -13,13 +14,14 @@ namespace Silk.NET.Maths [DataContract] public struct Rectangle : IEquatable> - where T : unmanaged, IFormattable, IEquatable, IComparable + where T : INumber { /// /// The origin. /// [DataMember] public Vector2D Origin; + /// /// The size. /// @@ -87,7 +89,7 @@ public Rectangle(T originX, T originY, T sizeX, T sizeY) /// Half the size of this rectangle. /// [IgnoreDataMember] - public Vector2D HalfSize => Size / Scalar.Two; + public Vector2D HalfSize => Size / T.CreateTruncating(2); /// /// Calculates whether this rectangle contains a point. @@ -98,8 +100,8 @@ public Rectangle(T originX, T originY, T sizeX, T sizeY) public bool Contains(Vector2D point) { var max = Max; - return Scalar.GreaterThanOrEqual(point.X, Origin.X) && Scalar.GreaterThanOrEqual - (point.Y, Origin.Y) && Scalar.LessThanOrEqual(point.X, max.X) && Scalar.LessThanOrEqual(point.Y, max.Y); + return (point.X >= Origin.X) && (point.Y >= Origin.Y) + && (point.X <= max.X) && (point.Y <= max.Y); } /// @@ -112,22 +114,8 @@ public bool Contains(Rectangle other) { var tMax = this.Max; var oMax = other.Max; - return Scalar.GreaterThanOrEqual(other.Origin.X, this.Origin.X) && Scalar.GreaterThanOrEqual - (other.Origin.Y, this.Origin.Y) && Scalar.LessThanOrEqual(oMax.X, tMax.X) && Scalar.LessThanOrEqual - (oMax.Y, tMax.Y); - } - - /// - /// Calculates the distance to the nearest edge from the point. - /// - /// The point. - /// The distance. - public T GetDistanceToNearestEdge(Vector2D point) - { - var max = Max; - var dx = Scalar.Max(Scalar.Max(Scalar.Subtract(Origin.X, point.X), Scalar.Zero), Scalar.Subtract(point.X, max.X)); - var dy = Scalar.Max(Scalar.Max(Scalar.Subtract(Origin.Y, point.Y), Scalar.Zero), Scalar.Subtract(point.Y, max.Y)); - return Scalar.Sqrt(Scalar.Add(Scalar.Multiply(dx, dx), Scalar.Multiply(dy, dy))); + return (other.Origin.X >= this.Origin.X) && (other.Origin.Y >= this.Origin.Y) + && (oMax.X <= tMax.X) && (oMax.Y <= tMax.Y); } /// @@ -152,7 +140,7 @@ public Rectangle GetScaled(Vector2D scale, Vector2D anchor) var max = (scale * (Max - anchor)) + anchor; return new(min, max - min); } - + /// /// Calculates a new rectangle scaled by the given scale around the given anchor. /// @@ -161,12 +149,12 @@ public Rectangle GetScaled(Vector2D scale, Vector2D anchor) /// The anchor. /// The calculated rectangle. public Rectangle GetScaled(Vector2D scale, Vector2D anchor) - where TScale : unmanaged, IFormattable, IEquatable, IComparable + where TScale : INumberBase { - var convertedAnchor = anchor.As(); - var min = (scale * (Origin.As() - convertedAnchor)) + convertedAnchor; - var max = (scale * (Max.As() - convertedAnchor)) + convertedAnchor; - return new(min.As(), (max - min).As()); + var convertedAnchor = anchor.AsTruncating(); + var min = (scale * (Origin.AsTruncating() - convertedAnchor)) + convertedAnchor; + var max = (scale * (Max.AsTruncating() - convertedAnchor)) + convertedAnchor; + return new(min.AsTruncating(), (max - min).AsTruncating()); } /// @@ -221,15 +209,17 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this rectangle casted to /// /// The type to cast to /// The casted rectangle - public Rectangle As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Rectangle As() + where TOther : INumber { return new(Origin.As(), Size.As()); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Scalar.As.cs b/sources/Maths/Maths/Scalar.As.cs deleted file mode 100644 index 077f4a2239..0000000000 --- a/sources/Maths/Maths/Scalar.As.cs +++ /dev/null @@ -1,3184 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/* - -This file is automatically generated by T4 template - -*/ - - -using System; -using System.Runtime.CompilerServices; -using System.Numerics; - -// casting into non-nullable, unboxing from nullable -#pragma warning disable 8600 -#pragma warning disable 8605 - - -namespace Silk.NET.Maths -{ - /// - /// A collection of operations for working with scalar numeric values. - /// Includes methods like the ones found in and more. - /// Supports , , , , , , , , , , , , , - /// - /// - public partial class Scalar - { - /// - /// Convert from to - /// - /// The value to convert - /// The type converted from - /// The type converted into - /// - /// While in most cases the types can be just explicitly casted, - /// sometimes there is an intermediate cast to float or double. - /// - /// - /// In case of we only consider the real part. - /// - /// The converted value - [MethodImpl(MaxOpt)] - public static TTo As(TFrom val) where TFrom : notnull where TTo : notnull - { - // We rejigged this code a bit to be a bit more strategic about its specialization branch as to not - // exceed RyuJIT's inlining/codegen budgets. In doing this, Mono apparently started producing invalid - // arm assembly, so we now maintain two paths: one for Mono, and one for CoreCLR. The CoreCLR one should - // really be preferred. -#if ANDROID || IOS - - return FromHalfToHalf(val); - - - [MethodImpl(MaxOpt)] - static TTo FromHalfToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (Half) (object) val; - } - - return FromHalfToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (Half) (object) val; - } - - return FromHalfToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (Half) (object) val; - } - - return FromHalfToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (float) (Half) (object) val; - } - - return FromHalfToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (Half) (object) val; - } - - return FromHalfToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToByte(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (Half) (object) val; - } - - return FromHalfToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToShort(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (Half) (object) val; - } - - return FromHalfToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (Half) (object) val; - } - - return FromHalfToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToInt(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (Half) (object) val; - } - - return FromHalfToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (Half) (object) val; - } - - return FromHalfToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToLong(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (Half) (object) val; - } - - return FromHalfToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToULong(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (Half) (object) val; - } - - return FromHalfToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (float) (Half) (object) val; - } - - return FromHalfToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalfToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(Half) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (float) (Half) (object) val; - } - - return FromFloatToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (float) (object) val; - } - - return FromFloatToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (float) (object) val; - } - - return FromFloatToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (float) (object) val; - } - - return FromFloatToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (float) (object) val; - } - - return FromFloatToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (float) (object) val; - } - - return FromFloatToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToByte(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (float) (object) val; - } - - return FromFloatToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToShort(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (float) (object) val; - } - - return FromFloatToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (float) (object) val; - } - - return FromFloatToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToInt(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (float) (object) val; - } - - return FromFloatToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (float) (object) val; - } - - return FromFloatToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToLong(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (float) (object) val; - } - - return FromFloatToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToULong(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (float) (object) val; - } - - return FromFloatToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (float) (object) val; - } - - return FromFloatToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloatToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(float) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (float) (object) val; - } - - return FromDoubleToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) (object) val; - } - - return FromDoubleToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (double) (object) val; - } - - return FromDoubleToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (double) (object) val; - } - - return FromDoubleToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (double) (object) val; - } - - return FromDoubleToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (double) (object) val; - } - - return FromDoubleToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToByte(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (double) (object) val; - } - - return FromDoubleToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToShort(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (double) (object) val; - } - - return FromDoubleToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (double) (object) val; - } - - return FromDoubleToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToInt(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (double) (object) val; - } - - return FromDoubleToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (double) (object) val; - } - - return FromDoubleToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToLong(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (double) (object) val; - } - - return FromDoubleToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToULong(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (double) (object) val; - } - - return FromDoubleToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (double) (object) val; - } - - return FromDoubleToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDoubleToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(double) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (double) (object) val; - } - - return FromDecimalToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) (decimal) (object) val; - } - - return FromDecimalToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (decimal) (object) val; - } - - return FromDecimalToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (decimal) (object) val; - } - - return FromDecimalToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (decimal) (object) val; - } - - return FromDecimalToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (decimal) (object) val; - } - - return FromDecimalToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToByte(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (decimal) (object) val; - } - - return FromDecimalToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToShort(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (decimal) (object) val; - } - - return FromDecimalToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (decimal) (object) val; - } - - return FromDecimalToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToInt(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (decimal) (object) val; - } - - return FromDecimalToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (decimal) (object) val; - } - - return FromDecimalToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToLong(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (decimal) (object) val; - } - - return FromDecimalToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToULong(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (decimal) (object) val; - } - - return FromDecimalToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (decimal) (object) val; - } - - return FromDecimalToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimalToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(decimal) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (decimal) (object) val; - } - - return FromSByteToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (sbyte) (object) val; - } - - return FromSByteToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (sbyte) (object) val; - } - - return FromSByteToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (sbyte) (object) val; - } - - return FromSByteToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (sbyte) (object) val; - } - - return FromSByteToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (sbyte) (object) val; - } - - return FromSByteToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToByte(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (sbyte) (object) val; - } - - return FromSByteToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToShort(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (sbyte) (object) val; - } - - return FromSByteToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (sbyte) (object) val; - } - - return FromSByteToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToInt(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (sbyte) (object) val; - } - - return FromSByteToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (sbyte) (object) val; - } - - return FromSByteToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToLong(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (sbyte) (object) val; - } - - return FromSByteToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToULong(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (sbyte) (object) val; - } - - return FromSByteToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (sbyte) (object) val; - } - - return FromSByteToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByteToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(sbyte) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (sbyte) (object) val; - } - - return FromByteToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (byte) (object) val; - } - - return FromByteToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (byte) (object) val; - } - - return FromByteToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (byte) (object) val; - } - - return FromByteToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (byte) (object) val; - } - - return FromByteToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (byte) (object) val; - } - - return FromByteToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToByte(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (byte) (object) val; - } - - return FromByteToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToShort(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (byte) (object) val; - } - - return FromByteToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (byte) (object) val; - } - - return FromByteToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToInt(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (byte) (object) val; - } - - return FromByteToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (byte) (object) val; - } - - return FromByteToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToLong(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (byte) (object) val; - } - - return FromByteToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToULong(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (byte) (object) val; - } - - return FromByteToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (byte) (object) val; - } - - return FromByteToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByteToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(byte) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (byte) (object) val; - } - - return FromShortToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (short) (object) val; - } - - return FromShortToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (short) (object) val; - } - - return FromShortToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (short) (object) val; - } - - return FromShortToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (short) (object) val; - } - - return FromShortToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (short) (object) val; - } - - return FromShortToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToByte(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (short) (object) val; - } - - return FromShortToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToShort(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (short) (object) val; - } - - return FromShortToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (short) (object) val; - } - - return FromShortToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToInt(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (short) (object) val; - } - - return FromShortToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (short) (object) val; - } - - return FromShortToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToLong(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (short) (object) val; - } - - return FromShortToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToULong(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (short) (object) val; - } - - return FromShortToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (short) (object) val; - } - - return FromShortToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShortToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(short) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (short) (object) val; - } - - return FromUShortToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (ushort) (object) val; - } - - return FromUShortToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (ushort) (object) val; - } - - return FromUShortToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (ushort) (object) val; - } - - return FromUShortToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (ushort) (object) val; - } - - return FromUShortToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (ushort) (object) val; - } - - return FromUShortToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToByte(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (ushort) (object) val; - } - - return FromUShortToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToShort(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (ushort) (object) val; - } - - return FromUShortToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (ushort) (object) val; - } - - return FromUShortToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToInt(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (ushort) (object) val; - } - - return FromUShortToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (ushort) (object) val; - } - - return FromUShortToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToLong(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (ushort) (object) val; - } - - return FromUShortToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToULong(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (ushort) (object) val; - } - - return FromUShortToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (ushort) (object) val; - } - - return FromUShortToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShortToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(ushort) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (ushort) (object) val; - } - - return FromIntToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (int) (object) val; - } - - return FromIntToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (int) (object) val; - } - - return FromIntToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (int) (object) val; - } - - return FromIntToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (int) (object) val; - } - - return FromIntToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (int) (object) val; - } - - return FromIntToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToByte(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (int) (object) val; - } - - return FromIntToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToShort(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (int) (object) val; - } - - return FromIntToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (int) (object) val; - } - - return FromIntToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToInt(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (int) (object) val; - } - - return FromIntToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (int) (object) val; - } - - return FromIntToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToLong(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (int) (object) val; - } - - return FromIntToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToULong(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (int) (object) val; - } - - return FromIntToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (int) (object) val; - } - - return FromIntToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromIntToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(int) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (int) (object) val; - } - - return FromUIntToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (uint) (object) val; - } - - return FromUIntToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (uint) (object) val; - } - - return FromUIntToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (uint) (object) val; - } - - return FromUIntToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (uint) (object) val; - } - - return FromUIntToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (uint) (object) val; - } - - return FromUIntToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToByte(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (uint) (object) val; - } - - return FromUIntToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToShort(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (uint) (object) val; - } - - return FromUIntToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (uint) (object) val; - } - - return FromUIntToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToInt(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (uint) (object) val; - } - - return FromUIntToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (uint) (object) val; - } - - return FromUIntToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToLong(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (uint) (object) val; - } - - return FromUIntToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToULong(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (uint) (object) val; - } - - return FromUIntToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (uint) (object) val; - } - - return FromUIntToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUIntToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(uint) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (uint) (object) val; - } - - return FromLongToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (long) (object) val; - } - - return FromLongToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (long) (object) val; - } - - return FromLongToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (long) (object) val; - } - - return FromLongToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (long) (object) val; - } - - return FromLongToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (long) (object) val; - } - - return FromLongToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToByte(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (long) (object) val; - } - - return FromLongToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToShort(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (long) (object) val; - } - - return FromLongToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (long) (object) val; - } - - return FromLongToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToInt(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (long) (object) val; - } - - return FromLongToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (long) (object) val; - } - - return FromLongToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToLong(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (long) (object) val; - } - - return FromLongToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToULong(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (long) (object) val; - } - - return FromLongToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (long) (object) val; - } - - return FromLongToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLongToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(long) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (long) (object) val; - } - - return FromULongToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (ulong) (object) val; - } - - return FromULongToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (ulong) (object) val; - } - - return FromULongToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (ulong) (object) val; - } - - return FromULongToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (ulong) (object) val; - } - - return FromULongToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (ulong) (object) val; - } - - return FromULongToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToByte(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (ulong) (object) val; - } - - return FromULongToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToShort(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (ulong) (object) val; - } - - return FromULongToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (ulong) (object) val; - } - - return FromULongToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToInt(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (ulong) (object) val; - } - - return FromULongToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (ulong) (object) val; - } - - return FromULongToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToLong(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (ulong) (object) val; - } - - return FromULongToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToULong(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (ulong) (object) val; - } - - return FromULongToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (ulong) (object) val; - } - - return FromULongToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULongToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(ulong) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (ulong) (object) val; - } - - return FromComplexToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) ((Complex) (object) val).Real; - } - - return FromComplexToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) ((Complex) (object) val).Real; - } - - return FromComplexToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) ((Complex) (object) val).Real; - } - - return FromComplexToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) ((Complex) (object) val).Real; - } - - return FromComplexToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) ((Complex) (object) val).Real; - } - - return FromComplexToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToByte(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) ((Complex) (object) val).Real; - } - - return FromComplexToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToShort(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) ((Complex) (object) val).Real; - } - - return FromComplexToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) ((Complex) (object) val).Real; - } - - return FromComplexToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToInt(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) ((Complex) (object) val).Real; - } - - return FromComplexToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) ((Complex) (object) val).Real; - } - - return FromComplexToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToLong(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) ((Complex) (object) val).Real; - } - - return FromComplexToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToULong(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) ((Complex) (object) val).Real; - } - - return FromComplexToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) ((Complex) (object) val).Real; - } - - return FromComplexToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplexToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(Complex) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) ((Complex) (object) val).Real; - } - - return FromBigIntegerToHalf(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToHalf(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) (BigInteger) (object) val; - } - - return FromBigIntegerToFloat(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToFloat(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) (BigInteger) (object) val; - } - - return FromBigIntegerToDouble(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToDouble(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) (BigInteger) (object) val; - } - - return FromBigIntegerToDecimal(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToDecimal(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (BigInteger) (object) val; - } - - return FromBigIntegerToSByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToSByte(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) (BigInteger) (object) val; - } - - return FromBigIntegerToByte(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToByte(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) (BigInteger) (object) val; - } - - return FromBigIntegerToShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToShort(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) (BigInteger) (object) val; - } - - return FromBigIntegerToUShort(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToUShort(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) (BigInteger) (object) val; - } - - return FromBigIntegerToInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToInt(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) (BigInteger) (object) val; - } - - return FromBigIntegerToUInt(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToUInt(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) (BigInteger) (object) val; - } - - return FromBigIntegerToLong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToLong(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) (BigInteger) (object) val; - } - - return FromBigIntegerToULong(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToULong(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) (BigInteger) (object) val; - } - - return FromBigIntegerToComplex(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToComplex(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (BigInteger) (object) val; - } - - return FromBigIntegerToBigInteger(val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigIntegerToBigInteger(TFrom val) - { - if (typeof(TFrom) == typeof(BigInteger) && typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (BigInteger) (object) val; - } - - ThrowUnsupportedType(); - return default!; - } -#else - if (typeof(TFrom) == typeof(Half)) - { - return FromHalf((Half) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromHalf(Half val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) (float) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) (float) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) (float) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(float)) - { - return FromFloat((float) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromFloat(float val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(double)) - { - return FromDouble((double) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDouble(double val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(decimal)) - { - return FromDecimal((decimal) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromDecimal(decimal val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(sbyte)) - { - return FromSByte((sbyte) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromSByte(sbyte val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(byte)) - { - return FromByte((byte) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromByte(byte val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(short)) - { - return FromShort((short) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromShort(short val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(ushort)) - { - return FromUShort((ushort) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUShort(ushort val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(int)) - { - return FromInt((int) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromInt(int val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(uint)) - { - return FromUInt((uint) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromUInt(uint val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(long)) - { - return FromLong((long) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromLong(long val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(ulong)) - { - return FromULong((ulong) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromULong(ulong val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(Complex)) - { - return FromComplex((Complex) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromComplex(Complex val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) val.Real; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val.Real; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val.Real; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val.Real; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val.Real; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val.Real; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val.Real; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val.Real; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val.Real; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val.Real; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val.Real; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val.Real; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val.Real; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val.Real; - } - - ThrowUnsupportedType(); - return default!; - } - - if (typeof(TFrom) == typeof(BigInteger)) - { - return FromBigInteger((BigInteger) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo FromBigInteger(BigInteger val) - { - if (typeof(TTo) == typeof(Half)) - { - return (TTo) (object) (Half) (double) val; - } - if (typeof(TTo) == typeof(float)) - { - return (TTo) (object) (float) val; - } - if (typeof(TTo) == typeof(double)) - { - return (TTo) (object) (double) val; - } - if (typeof(TTo) == typeof(decimal)) - { - return (TTo) (object) (decimal) val; - } - if (typeof(TTo) == typeof(sbyte)) - { - return (TTo) (object) (sbyte) val; - } - if (typeof(TTo) == typeof(byte)) - { - return (TTo) (object) (byte) val; - } - if (typeof(TTo) == typeof(short)) - { - return (TTo) (object) (short) val; - } - if (typeof(TTo) == typeof(ushort)) - { - return (TTo) (object) (ushort) val; - } - if (typeof(TTo) == typeof(int)) - { - return (TTo) (object) (int) val; - } - if (typeof(TTo) == typeof(uint)) - { - return (TTo) (object) (uint) val; - } - if (typeof(TTo) == typeof(long)) - { - return (TTo) (object) (long) val; - } - if (typeof(TTo) == typeof(ulong)) - { - return (TTo) (object) (ulong) val; - } - if (typeof(TTo) == typeof(Complex)) - { - return (TTo) (object) (Complex) val; - } - if (typeof(TTo) == typeof(BigInteger)) - { - return (TTo) (object) (BigInteger) val; - } - - ThrowUnsupportedType(); - return default!; - } - - ThrowUnsupportedType(); - return default!; -#endif - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.As.tt b/sources/Maths/Maths/Scalar.As.tt deleted file mode 100644 index 68022f463f..0000000000 --- a/sources/Maths/Maths/Scalar.As.tt +++ /dev/null @@ -1,178 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -/* - -This file is automatically generated by T4 template - -*/ - -<#@ assembly name="System.Core" #> -<#@ import namespace="System.Linq" #> - -using System; -using System.Runtime.CompilerServices; -using System.Numerics; - -// casting into non-nullable, unboxing from nullable -#pragma warning disable 8600 -#pragma warning disable 8605 - -<# - // T4 is old enough to not have value tuple - - var typesFullNames = new [] { - "Half", - "Float", - "Double", - "Decimal", - "SByte", - "Byte", - "Short", - "UShort", - "Int", - "UInt", - "Long", - "ULong", - "Complex", - "BigInteger" - }; - - var types = new [] { - "Half", - "float", - "double", - "decimal", - "sbyte", - "byte", - "short", - "ushort", - "int", - "uint", - "long", - "ulong", - "Complex", - "BigInteger" - }; - - var intermediateCasts = new System.Collections.Generic.Dictionary(); - // for some reason rider also complains about inline initialization - intermediateCasts["decimal_Half"] = "double"; - intermediateCasts["Half_decimal"] = "float"; - intermediateCasts["Half_Complex"] = "float"; - intermediateCasts["Complex_Half"] = "double"; - intermediateCasts["Half_BigInteger"] = "float"; - intermediateCasts["BigInteger_Half"] = "double"; - - var len = types.Length; -#> - -namespace Silk.NET.Maths -{ - /// - /// A collection of operations for working with scalar numeric values. - /// Includes methods like the ones found in and more. - /// Supports <#= string.Join(", ", types.Select(type => $"")) #> - /// - /// - public partial class Scalar - { - /// - /// Convert from to - /// - /// The value to convert - /// The type converted from - /// The type converted into - /// - /// While in most cases the types can be just explicitly casted, - /// sometimes there is an intermediate cast to float or double. - /// - /// - /// In case of we only consider the real part. - /// - /// The converted value - [MethodImpl(MaxOpt)] - public static TTo As(TFrom val) where TFrom : notnull where TTo : notnull - { - // We rejigged this code a bit to be a bit more strategic about its specialization branch as to not - // exceed RyuJIT's inlining/codegen budgets. In doing this, Mono apparently started producing invalid - // arm assembly, so we now maintain two paths: one for Mono, and one for CoreCLR. The CoreCLR one should - // really be preferred. -#if ANDROID || IOS - - return FromHalfToHalf(val); - -<# for (var i = 0; i < len; i++) { #> -<# for (var j = 0; j < len; j++) { -#> - - [MethodImpl(MaxOpt)] - static TTo From<#= typesFullNames[i] #>To<#= typesFullNames[j] #>(TFrom val) - { - if (typeof(TFrom) == typeof(<#= types[i] #>) && typeof(TTo) == typeof(<#= types[j] #>)) - { -<# -var intermediateType = ""; -if (intermediateCasts.TryGetValue($"{types[i]}_{types[j]}", out var res)) - intermediateType = $" ({res})"; - -#> -<# if (types[i] == "Complex") { #> - return (TTo) (object) (<#= types[j] #>)<#= intermediateType #> ((<#= types[i] #>) (object) val).Real; -<# } else { #> - return (TTo) (object) (<#= types[j] #>)<#= intermediateType #> (<#= types[i] #>) (object) val; -<# } #> - } - -<# - var jNext = (j + 1) % len; - var iNext = i + (jNext == 0 ? 1 : 0); - if (iNext == len) { - #> - ThrowUnsupportedType(); - return default!; -<# } else { #> - return From<#= typesFullNames[iNext] #>To<#= typesFullNames[jNext] #>(val); -<# } #> - } -<# } #> -<# } #> -#else -<# for (var i = 0; i < len; i++) { #> - if (typeof(TFrom) == typeof(<#= types[i] #>)) - { - return From<#= typesFullNames[i] #>((<#= types[i] #>) (object) val); - } - - [MethodImpl(MaxOpt)] - static TTo From<#= typesFullNames[i] #>(<#= types[i] #> val) - { -<# for (var j = 0; j < len; j++) { -#> - if (typeof(TTo) == typeof(<#= types[j] #>)) - { -<# -var intermediateType = ""; -if (intermediateCasts.TryGetValue($"{types[i]}_{types[j]}", out var res)) - intermediateType = $" ({res})"; - -#> -<# if (types[i] == "Complex") { #> - return (TTo) (object) (<#= types[j] #>)<#= intermediateType #> val.Real; -<# } else { #> - return (TTo) (object) (<#= types[j] #>)<#= intermediateType #> val; -<# } #> - } -<# } #> - - ThrowUnsupportedType(); - return default!; - } - -<# } #> - ThrowUnsupportedType(); - return default!; -#endif - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.BaseOps.cs b/sources/Maths/Maths/Scalar.BaseOps.cs deleted file mode 100644 index e9266dc3c8..0000000000 --- a/sources/Maths/Maths/Scalar.BaseOps.cs +++ /dev/null @@ -1,2266 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -#if AdvSIMD -using System.Runtime.Intrinsics.Arm; -#endif -#if SSE -using System.Runtime.Intrinsics.X86; -#endif -// ReSharper disable CompareOfFloatsByEqualityOperator - -// casting into non-nullable, unboxing from nullable -#pragma warning disable 8600 -#pragma warning disable 8605 - -namespace Silk.NET.Maths -{ - public static partial class Scalar - { - internal const MethodImplOptions MaxOpt = MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512; - - internal static void ThrowUnsupportedType() - => throw new NotSupportedException("The given type is unsupported for generic maths."); - - internal static void ThrowOpUnsupportedType() - => throw new NotSupportedException("This operation is not applicable for the given type."); - - internal static void ThrowOpUnsupportedPrecision() - => throw new NotImplementedException - ( - "This operation is not applicable for the given type due to a high-enough precision algorithm not " + - "being available." - ); - - private static void ThrowIndexOutOfRange() => throw new IndexOutOfRangeException(); - - /// - /// Indicates whether members are hardware accelerated. Not all members support hardware acceleration. - /// - public static bool IsHardwareAccelerated => false -#if SSE - || Sse.IsSupported -#endif -#if AdvSIMD - || AdvSimd.IsSupported -#endif - ; - - /// - /// Determines whether the specified value is finite (zero, subnormal, or normal). - /// - /// A number. - /// The type of the specified number. - /// true if the value is finite (zero, subnormal or normal); false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsFinite(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsFinite((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return CoreIsFinite((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - // double.IsFinite doesn't exist on netstandard2.0 - long bits = BitConverter.DoubleToInt64Bits((double) (object) f); - return (bits & 0x7FFFFFFFFFFFFFFF) < 0x7FF0000000000000; - } - - return Complex(f); - } - - [MethodImpl(MaxOpt)] - static bool Complex(T f) - { - if (typeof(T) == typeof(Complex)) - { -#if NETCOREAPP3_0_OR_GREATER - return System.Numerics.Complex.IsFinite((Complex)(object)f); -#else -// https://source.dot.net/#System.Runtime.Numerics/System/Numerics/Complex.cs,6b0a0cd37123d4d3 - return IsFinite(((Complex)(object)f).Real) && IsFinite(((Complex)(object)f).Imaginary); -#endif - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(decimal) - || typeof(T) == typeof(BigInteger) - ) - return true; - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Returns a value indicating whether the specified number evaluates to negative or positive infinity. - /// - /// A number - /// The type of the specified number. - /// true if evaluates to or ; false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsInfinity(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsInfinity((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return float.IsInfinity((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return double.IsInfinity((double) (object) f); - } - - return Complex(f); - } - - [MethodImpl(MaxOpt)] - static bool Complex(T f) - { - if (typeof(T) == typeof(Complex)) - { -#if NETCOREAPP3_0_OR_GREATER - return System.Numerics.Complex.IsInfinity((Complex)(object)f); -#else -// https://source.dot.net/#System.Runtime.Numerics/System/Numerics/Complex.cs,fbf803cb00899f67,references - return double.IsInfinity(((Complex)(object)f).Real) || double.IsInfinity(((Complex)(object)f).Imaginary); -#endif - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(decimal) - || typeof(T) == typeof(BigInteger) - ) - return false; - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Returns a value that indicates whether the specified value is not a number (). - /// - /// A number - /// The type of the specified number. - /// true if evaluates to ; false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsNaN(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsNaN((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return float.IsNaN((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return double.IsNaN((double) (object) f); - } - - return Complex(f); - } - - [MethodImpl(MaxOpt)] - static bool Complex(T f) - { - if (typeof(T) == typeof(Complex)) - { -#if NETCOREAPP3_0_OR_GREATER - return System.Numerics.Complex.IsNaN((Complex)(object)f); -#else - return !IsInfinity((Complex)(object)f) && !IsFinite((Complex)(object)f); -#endif - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(decimal) - || typeof(T) == typeof(BigInteger) - ) - return false; - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Determines whether the specified value is negative. - /// - /// A number - /// The type of the specified number. - /// true if the value is negative; false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsNegative(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsNegative((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return CoreIsNegative((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return CoreIsNegative((double) (object) f); - } - - return Short(f); - } - - [MethodImpl(MaxOpt)] - static bool Short(T f) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) f < 0; - } - - return Int(f); - } - - [MethodImpl(MaxOpt)] - static bool Int(T f) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) f < 0; - } - - return Long(f); - } - - [MethodImpl(MaxOpt)] - static bool Long(T f) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) f < 0; - } - - return Decimal(f); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T f) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) f < 0; - } - - return SByte(f); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T f) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) f < 0; - } - - return BigInteger(f); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T f) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) f < 0; - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(ulong) - - ) - return false; - - /* Complex is unsupported for negativity */ - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Returns a value indicating whether the specified number evaluates to negative infinity. - /// - /// A number - /// The type of the specified number. - /// true if evaluates to ; false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsNegativeInfinity(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsNegativeInfinity((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return float.IsNegativeInfinity((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return double.IsNegativeInfinity((double) (object) f); - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(decimal) - || typeof(T) == typeof(BigInteger) - ) - return false; - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Determines whether the specified value is normal. - /// - /// A number - /// The type of the specified number. - /// true if the value is normal; false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsNormal(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsNormal((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return IsNormal((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return IsNormal((double) (object) f); - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(decimal) - || typeof(T) == typeof(BigInteger) - ) - return true; - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Returns a value indicating whether the specified number evaluates to positive infinity. - /// - /// A number - /// The type of the specified number. - /// true if evaluates to ; false otherwise. - [MethodImpl(MaxOpt)] - public static bool IsPositiveInfinity(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsPositiveInfinity((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return float.IsPositiveInfinity((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return double.IsPositiveInfinity((double) (object) f); - } - - return Other(f); - } - - [MethodImpl(MaxOpt)] - static bool Other(T f) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(decimal) - || typeof(T) == typeof(BigInteger) - ) - return false; - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Determines whether the specified value is subnormal. - /// - /// A number - /// The type of the specified number. - /// true if the value is subnormal; false otherwise. - /// This function will throw for types other then , , , because subnormality cannot be determined for other types. - [MethodImpl(MaxOpt)] - public static bool IsSubnormal(T f) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return Half.IsSubnormal((Half) (object) f); - } - - return Float(f); - - [MethodImpl(MaxOpt)] - static bool Float(T f) - { - if (typeof(T) == typeof(float)) - { - return CoreIsSubnormal((float) (object) f); - } - - return Double(f); - } - - [MethodImpl(MaxOpt)] - static bool Double(T f) - { - if (typeof(T) == typeof(double)) - { - return CoreIsSubnormal((double) (object) f); - } - - ThrowOpUnsupportedType(); - return false; - } - } - - /// - /// Returns a value that indicates whether two specified values are equal. - /// - /// The first value to compare. - /// The second value to compare. - /// The type of both values. - /// true if and are equal; otherwise, false. - [MethodImpl(MaxOpt)] - public static bool Equal(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (Half) (object) left == (Half) (object) right; - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static bool Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (float) (object) left == (float) (object) right; - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (double) (object) left == (double) (object) right; - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (decimal) (object) left == (decimal) (object) right; - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (sbyte) (object) left == (sbyte) (object) right; - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (byte) (object) left == (byte) (object) right; - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) left == (int) (object) right; - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (uint) (object) left == (uint) (object) right; - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) left == (long) (object) right; - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static bool ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (ulong) (object) left == (ulong) (object) right; - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) left == (short) (object) right; - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (ushort) (object) left == (ushort) (object) right; - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) left == (BigInteger) (object) right; - } - - return Complex(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Complex(T left, T right) - { - if (typeof(T) == typeof(Complex)) - { - return (Complex) (object) left == (Complex) (object) right; - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Other(T _, T __) - { - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns a value that indicates whether two specified values are not equal. - /// - /// The first value to compare. - /// The second value to compare. - /// The type of both values. - /// true if and are not equal; otherwise, false. - [MethodImpl(MaxOpt)] - public static bool NotEqual(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (Half) (object) left != (Half) (object) right; - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static bool Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (float) (object) left != (float) (object) right; - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (double) (object) left != (double) (object) right; - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (decimal) (object) left != (decimal) (object) right; - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (sbyte) (object) left != (sbyte) (object) right; - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (byte) (object) left != (byte) (object) right; - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) left != (int) (object) right; - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (uint) (object) left != (uint) (object) right; - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) left != (long) (object) right; - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static bool ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (ulong) (object) left != (ulong) (object) right; - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) left != (short) (object) right; - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (ushort) (object) left != (ushort) (object) right; - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) left != (BigInteger) (object) right; - } - - return Complex(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Complex(T left, T right) - { - if (typeof(T) == typeof(Complex)) - { - return (Complex) (object) left != (Complex) (object) right; - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Other(T _, T __) - { - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns a value that indicates whether a specified value is greater than another specified value. - /// - /// The first value to compare. - /// The second value to compare. - /// The type of both values. - /// true if is greater than ; otherwise, false. - [MethodImpl(MaxOpt)] - public static bool GreaterThan(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (Half) (object) left > (Half) (object) right; - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static bool Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (float) (object) left > (float) (object) right; - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (double) (object) left > (double) (object) right; - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (decimal) (object) left > (decimal) (object) right; - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (sbyte) (object) left > (sbyte) (object) right; - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (byte) (object) left > (byte) (object) right; - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) left > (int) (object) right; - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (uint) (object) left > (uint) (object) right; - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) left > (long) (object) right; - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static bool ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (ulong) (object) left > (ulong) (object) right; - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) left > (short) (object) right; - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (ushort) (object) left > (ushort) (object) right; - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) left > (BigInteger) (object) right; - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Other(T _, T __) - { - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns a value that indicates whether a specified value is greater than or equal to another specified value. - /// - /// The first value to compare. - /// The second value to compare. - /// The type of both values. - /// true if is greater than or equal to ; otherwise, false. - [MethodImpl(MaxOpt)] - public static bool GreaterThanOrEqual(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (Half) (object) left >= (Half) (object) right; - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static bool Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (float) (object) left >= (float) (object) right; - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (double) (object) left >= (double) (object) right; - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (decimal) (object) left >= (decimal) (object) right; - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (sbyte) (object) left >= (sbyte) (object) right; - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (byte) (object) left >= (byte) (object) right; - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) left >= (int) (object) right; - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (uint) (object) left >= (uint) (object) right; - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) left >= (long) (object) right; - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static bool ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (ulong) (object) left >= (ulong) (object) right; - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) left >= (short) (object) right; - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (ushort) (object) left >= (ushort) (object) right; - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) left >= (BigInteger) (object) right; - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Other(T _, T __) - { - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns a value that indicates whether a specified value is less than another specified value. - /// - /// The first value to compare. - /// The second value to compare. - /// The type of both values. - /// true if is less than ; otherwise, false. - [MethodImpl(MaxOpt)] - public static bool LessThan(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (Half) (object) left < (Half) (object) right; - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static bool Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (float) (object) left < (float) (object) right; - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (double) (object) left < (double) (object) right; - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (decimal) (object) left < (decimal) (object) right; - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (sbyte) (object) left < (sbyte) (object) right; - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (byte) (object) left < (byte) (object) right; - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) left < (int) (object) right; - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (uint) (object) left < (uint) (object) right; - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) left < (long) (object) right; - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static bool ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (ulong) (object) left < (ulong) (object) right; - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) left < (short) (object) right; - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (ushort) (object) left < (ushort) (object) right; - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) left < (BigInteger) (object) right; - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Other(T _, T __) - { - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns a value that indicates whether a specified value is less than or equal to another specified value. - /// - /// The first value to compare. - /// The second value to compare. - /// The type of both values. - /// true if is less than or equal to ; otherwise, false. - [MethodImpl(MaxOpt)] - public static bool LessThanOrEqual(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (Half) (object) left <= (Half) (object) right; - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static bool Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (float) (object) left <= (float) (object) right; - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (double) (object) left <= (double) (object) right; - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (decimal) (object) left <= (decimal) (object) right; - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (sbyte) (object) left <= (sbyte) (object) right; - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (byte) (object) left <= (byte) (object) right; - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (int) (object) left <= (int) (object) right; - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (uint) (object) left <= (uint) (object) right; - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (long) (object) left <= (long) (object) right; - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static bool ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (ulong) (object) left <= (ulong) (object) right; - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (short) (object) left <= (short) (object) right; - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static bool UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (ushort) (object) left <= (ushort) (object) right; - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static bool BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (BigInteger) (object) left <= (BigInteger) (object) right; - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static bool Other(T _, T __) - { - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Adds two specified values. - /// - /// The first value to add. - /// The second value to add. - /// The type of both values. - /// The result of adding and . - [MethodImpl(MaxOpt)] - public static T Add(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) ((float) (Half) (object) left + (float) (Half) (object) right); - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static T Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) ((float) (object) left + (float) (object) right); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) ((double) (object) left + (double) (object) right); - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) ((decimal) (object) left + (decimal) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left + (sbyte) (object) right); - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left + (byte) (object) right); - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static T Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left + (short) (object) right); - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static T UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left + (ushort) (object) right); - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) ((int) (object) left + (int) (object) right); - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) ((uint) (object) left + (uint) (object) right); - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static T Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) ((long) (object) left + (long) (object) right); - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static T ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) ((ulong) (object) left + (ulong) (object) right); - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static T BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (T)(object)((BigInteger) (object) left + (BigInteger) (object) right); - } - - return Complex(left, right); - } - - [MethodImpl(MaxOpt)] - static T Complex(T left, T right) - { - if (typeof(T) == typeof(Complex)) - { - return (T)(object)((Complex) (object) left + (Complex) (object) right); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T _, T __) - { - ThrowUnsupportedType(); - return default!; - } - } - - /// - /// Subtracts two specified values. - /// - /// The minuend. - /// The subtrahend. - /// The type of both values. - /// The result of subtracting from . - [MethodImpl(MaxOpt)] - public static T Subtract(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) ((float) (Half) (object) left - (float) (Half) (object) right); - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static T Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) ((float) (object) left - (float) (object) right); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) ((double) (object) left - (double) (object) right); - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) ((decimal) (object) left - (decimal) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left - (sbyte) (object) right); - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left - (byte) (object) right); - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static T Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left - (short) (object) right); - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static T UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left - (ushort) (object) right); - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) ((int) (object) left - (int) (object) right); - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) ((uint) (object) left - (uint) (object) right); - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static T Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) ((long) (object) left - (long) (object) right); - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static T ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) ((ulong) (object) left - (ulong) (object) right); - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static T BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (T)(object)((BigInteger) (object) left - (BigInteger) (object) right); - } - - return Complex(left, right); - } - - [MethodImpl(MaxOpt)] - static T Complex(T left, T right) - { - if (typeof(T) == typeof(Complex)) - { - return (T)(object)((Complex) (object) left - (Complex) (object) right); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T _, T __) - { - ThrowUnsupportedType(); - return default!; - } - } - - /// - /// Multiplies two specified values. - /// - /// The first value to multiply. - /// The second value to multiply. - /// The type of both values. - /// The result of multiplying and . - [MethodImpl(MaxOpt)] - public static T Multiply(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) ((float) (Half) (object) left * (float) (Half) (object) right); - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static T Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) ((float) (object) left * (float) (object) right); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) ((double) (object) left * (double) (object) right); - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) ((decimal) (object) left * (decimal) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left * (sbyte) (object) right); - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left * (byte) (object) right); - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static T Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left * (short) (object) right); - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static T UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left * (ushort) (object) right); - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) ((int) (object) left * (int) (object) right); - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) ((uint) (object) left * (uint) (object) right); - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static T Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) ((long) (object) left * (long) (object) right); - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static T ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) ((ulong) (object) left * (ulong) (object) right); - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static T BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (T)(object)((BigInteger) (object) left * (BigInteger) (object) right); - } - - return Complex(left, right); - } - - [MethodImpl(MaxOpt)] - static T Complex(T left, T right) - { - if (typeof(T) == typeof(Complex)) - { - return (T)(object)((Complex) (object) left * (Complex) (object) right); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T _, T __) - { - ThrowUnsupportedType(); - return default!; - } - } - - /// - /// Divides two specified values. - /// - /// The dividend. - /// The divisor. - /// The type of both values. - /// The result of dividing by . - [MethodImpl(MaxOpt)] - public static T Divide(T left, T right) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) ((float) (Half) (object) left / (float) (Half) (object) right); - } - - return Float(left, right); - - [MethodImpl(MaxOpt)] - static T Float(T left, T right) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) ((float) (object) left / (float) (object) right); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) ((double) (object) left / (double) (object) right); - } - - return Decimal(left, right); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T left, T right) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) ((decimal) (object) left / (decimal) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left / (sbyte) (object) right); - } - - return Byte(left, right); - } - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left / (byte) (object) right); - } - - return Short(left, right); - } - - [MethodImpl(MaxOpt)] - static T Short(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left / (short) (object) right); - } - - return UShort(left, right); - } - - [MethodImpl(MaxOpt)] - static T UShort(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left / (ushort) (object) right); - } - - return Int(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) ((int) (object) left / (int) (object) right); - } - - return UInt(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) ((uint) (object) left / (uint) (object) right); - } - - return Long(left, right); - } - - [MethodImpl(MaxOpt)] - static T Long(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) ((long) (object) left / (long) (object) right); - } - - return ULong(left, right); - } - - [MethodImpl(MaxOpt)] - static T ULong(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) ((ulong) (object) left / (ulong) (object) right); - } - - return BigInteger(left, right); - } - - [MethodImpl(MaxOpt)] - static T BigInteger(T left, T right) - { - if (typeof(T) == typeof(BigInteger)) - { - return (T)(object)((BigInteger) (object) left / (BigInteger) (object) right); - } - - return Complex(left, right); - } - - [MethodImpl(MaxOpt)] - static T Complex(T left, T right) - { - if (typeof(T) == typeof(Complex)) - { - return (T)(object)((Complex) (object) left / (Complex) (object) right); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T _, T __) - { - ThrowUnsupportedType(); - return default!; - } - } - - /// - /// Returns the result of multiplying the specified value by negative one. - /// - /// The value to negate - /// The type of the value - /// - /// A number with the value of , but the opposite sign. - /// -or- - /// Zero, if is zero. - /// - [MethodImpl(MaxOpt)] - public static T Negate(T x) where T : notnull => Multiply(x, Scalar.MinusOne); - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.And.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.And.cs deleted file mode 100644 index 5e2250aad4..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.And.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Performs And on supported types - /// - public static T And(T left, T right) where T : unmanaged - { - return Byte(left, right); - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left & (byte) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left & (sbyte) (object) right); - } - - return UInt16(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt16(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left & (ushort) (object) right); - } - - return Int16(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int16(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left & (short) (object) right); - } - - return UInt32(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt32(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) ((uint) (object) left & (uint) (object) right); - } - - return Int32(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int32(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) ((int) (object) left & (int) (object) right); - } - - return UInt64(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt64(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) ((ulong) (object) left & (ulong) (object) right); - } - - return Int64(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int64(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) ((long) (object) left & (long) (object) right); - } - - return Single(left, right); - } - - [MethodImpl(MaxOpt)] - static T Single(T left, T right) - { - if (typeof(T) == typeof(float)) - { - var res = Unsafe.As(ref left) & Unsafe.As(ref right); - return Unsafe.As(ref res); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - var res = Unsafe.As(ref left) & Unsafe.As(ref right); - return Unsafe.As(ref res); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T left, T right) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.Not.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.Not.cs deleted file mode 100644 index 4db3748511..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.Not.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Performs Not on supported types - /// - public static T Not(T value) where T : unmanaged - { - return Byte(value); - - [MethodImpl(MaxOpt)] - static T Byte(T value) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) (~ (byte) (object) value); - } - - return SByte(value); - } - - [MethodImpl(MaxOpt)] - static T SByte(T value) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) (~ (sbyte) (object) value); - } - - return UInt16(value); - } - - [MethodImpl(MaxOpt)] - static T UInt16(T value) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) (~ (ushort) (object) value); - } - - return Int16(value); - } - - [MethodImpl(MaxOpt)] - static T Int16(T value) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) (~ (short) (object) value); - } - - return UInt32(value); - } - - [MethodImpl(MaxOpt)] - static T UInt32(T value) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) (~ (uint) (object) value); - } - - return Int32(value); - } - - [MethodImpl(MaxOpt)] - static T Int32(T value) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) (~ (int) (object) value); - } - - return UInt64(value); - } - - [MethodImpl(MaxOpt)] - static T UInt64(T value) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) (~ (ulong) (object) value); - } - - return Int64(value); - } - - [MethodImpl(MaxOpt)] - static T Int64(T value) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) (~ (long) (object) value); - } - - return Single(value); - } - - [MethodImpl(MaxOpt)] - static T Single(T value) - { - if (typeof(T) == typeof(float)) - { - var res = ~ Unsafe.As(ref value); - return Unsafe.As(ref res); - } - - return Double(value); - } - - [MethodImpl(MaxOpt)] - static T Double(T value) - { - if (typeof(T) == typeof(double)) - { - var res = ~ Unsafe.As(ref value); - return Unsafe.As(ref res); - } - - return Other(value); - } - - [MethodImpl(MaxOpt)] - static T Other(T value) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.Or.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.Or.cs deleted file mode 100644 index 1f893116c0..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.Or.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Performs Or on supported types - /// - public static T Or(T left, T right) where T : unmanaged - { - return Byte(left, right); - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left | (byte) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left | (sbyte) (object) right); - } - - return UInt16(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt16(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left | (ushort) (object) right); - } - - return Int16(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int16(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left | (short) (object) right); - } - - return UInt32(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt32(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) ((uint) (object) left | (uint) (object) right); - } - - return Int32(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int32(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) ((int) (object) left | (int) (object) right); - } - - return UInt64(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt64(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) ((ulong) (object) left | (ulong) (object) right); - } - - return Int64(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int64(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) ((long) (object) left | (long) (object) right); - } - - return Single(left, right); - } - - [MethodImpl(MaxOpt)] - static T Single(T left, T right) - { - if (typeof(T) == typeof(float)) - { - var res = Unsafe.As(ref left) | Unsafe.As(ref right); - return Unsafe.As(ref res); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - var res = Unsafe.As(ref left) | Unsafe.As(ref right); - return Unsafe.As(ref res); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T left, T right) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.RotateLeft.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.RotateLeft.cs deleted file mode 100644 index 979340447b..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.RotateLeft.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Rotates a given value bitwise. - /// Shifting float and double obeys unsigned integers' behaviour. - /// - public static T RotateLeft(T value, int offset) where T : unmanaged - { - return Byte(value, offset); - - [MethodImpl(MaxOpt)] - static T Byte(T value, int offset) - { - if (typeof(T) == typeof(byte)) - { - var v = (byte) (object) value; - return (T) (object) (byte) ((v << offset) | (v >> (8 - offset))); - } - - return SByte(value, offset); - } - - [MethodImpl(MaxOpt)] - static T SByte(T value, int offset) - { - if (typeof(T) == typeof(sbyte)) - { - var v = (sbyte) (object) value; - return (T) (object) (sbyte) ((v << offset) | (v >> (8 - offset))); - } - - return UShort(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UShort(T value, int offset) - { - if (typeof(T) == typeof(ushort)) - { - var v = (ushort) (object) value; - return (T) (object) (ushort) ((v << offset) | (v >> (16 - offset))); - } - - return Short(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Short(T value, int offset) - { - if (typeof(T) == typeof(short)) - { - var v = (short) (object) value; - return (T) (object) (short) ((v << offset) | (v >> (16 - offset))); - } - - return UInt(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt(T value, int offset) - { - if (typeof(T) == typeof(uint)) - { - var v = (uint) (object) value; - return (T) (object) (uint) ((v << offset) | (v >> (32 - offset))); - } - - return Int(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int(T value, int offset) - { - if (typeof(T) == typeof(int)) - { - var v = (int) (object) value; - return (T) (object) (int) ((v << offset) | (v >> (32 - offset))); - } - - return ULong(value, offset); - } - - [MethodImpl(MaxOpt)] - static T ULong(T value, int offset) - { - if (typeof(T) == typeof(ulong)) - { - var v = (ulong) (object) value; - return (T) (object) (ulong) ((v << offset) | (v >> (64 - offset))); - } - - return Long(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Long(T value, int offset) - { - if (typeof(T) == typeof(long)) - { - var v = (long) (object) value; - return (T) (object) (long) ((v << offset) | (v >> (64 - offset))); - } - - return Float(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Float(T value, int offset) - { - if (typeof(T) == typeof(float)) - { - var v = Unsafe.As(ref value); - var res = (v << offset) | (v >> (32 - offset)); - return Unsafe.As(ref res); - } - - return Double(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Double(T value, int offset) - { - if (typeof(T) == typeof(double)) - { - var v = Unsafe.As(ref value); - var res = (v << offset) | (v >> (64 - offset)); - return Unsafe.As(ref res); - } - - return Other(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Other(T _, int __) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.RotateRight.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.RotateRight.cs deleted file mode 100644 index 3324597f08..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.RotateRight.cs +++ /dev/null @@ -1,148 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Rotates a given value bitwise. - /// Shifting float and double obeys unsigned integers' behaviour. - /// - public static T RotateRight(T value, int offset) where T : unmanaged - { - return Byte(value, offset); - - [MethodImpl(MaxOpt)] - static T Byte(T value, int offset) - { - if (typeof(T) == typeof(byte)) - { - var v = (byte) (object) value; - return (T) (object) (byte) ((v >> offset) | (v << (8 - offset))); - } - - return SByte(value, offset); - } - - [MethodImpl(MaxOpt)] - static T SByte(T value, int offset) - { - if (typeof(T) == typeof(sbyte)) - { - var v = (sbyte) (object) value; - return (T) (object) (sbyte) ((v >> offset) | (v << (8 - offset))); - } - - return UShort(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UShort(T value, int offset) - { - if (typeof(T) == typeof(ushort)) - { - var v = (ushort) (object) value; - return (T) (object) (ushort) ((v >> offset) | (v << (16 - offset))); - } - - return Short(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Short(T value, int offset) - { - if (typeof(T) == typeof(short)) - { - var v = (short) (object) value; - return (T) (object) (short) ((v >> offset) | (v << (16 - offset))); - } - - return UInt(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt(T value, int offset) - { - if (typeof(T) == typeof(uint)) - { - var v = (uint) (object) value; - return (T) (object) (uint) ((v >> offset) | (v << (32 - offset))); - } - - return Int(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int(T value, int offset) - { - if (typeof(T) == typeof(int)) - { - var v = (int) (object) value; - return (T) (object) (int) ((v >> offset) | (v << (32 - offset))); - } - - return ULong(value, offset); - } - - [MethodImpl(MaxOpt)] - static T ULong(T value, int offset) - { - if (typeof(T) == typeof(ulong)) - { - var v = (ulong) (object) value; - return (T) (object) (ulong) ((v >> offset) | (v << (64 - offset))); - } - - return Long(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Long(T value, int offset) - { - if (typeof(T) == typeof(long)) - { - var v = (long) (object) value; - return (T) (object) (long) ((v >> offset) | (v << (64 - offset))); - } - - return Float(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Float(T value, int offset) - { - if (typeof(T) == typeof(float)) - { - var v = Unsafe.As(ref value); - var res = (v >> offset) | (v << (32 - offset)); - return Unsafe.As(ref res); - } - - return Double(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Double(T value, int offset) - { - if (typeof(T) == typeof(double)) - { - var v = Unsafe.As(ref value); - var res = (v >> offset) | (v << (64 - offset)); - return Unsafe.As(ref res); - } - - return Other(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Other(T _, int __) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.ShiftLeft.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.ShiftLeft.cs deleted file mode 100644 index 52f2b07f21..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.ShiftLeft.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Performs ShiftLeft on supported types - /// - public static T ShiftLeft(T value, int offset) where T : unmanaged - { - return Byte(value, offset); - - [MethodImpl(MaxOpt)] - static T Byte(T value, int offset) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) value << offset); - } - - return SByte(value, offset); - } - - [MethodImpl(MaxOpt)] - static T SByte(T value, int offset) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) value << offset); - } - - return UInt16(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt16(T value, int offset) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) value << offset); - } - - return Int16(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int16(T value, int offset) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) value << offset); - } - - return UInt32(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt32(T value, int offset) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) ((uint) (object) value << offset); - } - - return Int32(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int32(T value, int offset) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) ((int) (object) value << offset); - } - - return UInt64(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt64(T value, int offset) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) ((ulong) (object) value << offset); - } - - return Int64(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int64(T value, int offset) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) ((long) (object) value << offset); - } - - return Single(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Single(T value, int offset) - { - if (typeof(T) == typeof(float)) - { - var res = Unsafe.As(ref value) << offset; - return Unsafe.As(ref res); - } - - return Double(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Double(T value, int offset) - { - if (typeof(T) == typeof(double)) - { - var res = Unsafe.As(ref value) << offset; - return Unsafe.As(ref res); - } - - return Other(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Other(T value, int offset) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.ShiftRight.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.ShiftRight.cs deleted file mode 100644 index 29f844c792..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.ShiftRight.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Performs ShiftRight on supported types - /// - public static T ShiftRight(T value, int offset) where T : unmanaged - { - return Byte(value, offset); - - [MethodImpl(MaxOpt)] - static T Byte(T value, int offset) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) value >> offset); - } - - return SByte(value, offset); - } - - [MethodImpl(MaxOpt)] - static T SByte(T value, int offset) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) value >> offset); - } - - return UInt16(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt16(T value, int offset) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) value >> offset); - } - - return Int16(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int16(T value, int offset) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) value >> offset); - } - - return UInt32(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt32(T value, int offset) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) ((uint) (object) value >> offset); - } - - return Int32(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int32(T value, int offset) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) ((int) (object) value >> offset); - } - - return UInt64(value, offset); - } - - [MethodImpl(MaxOpt)] - static T UInt64(T value, int offset) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) ((ulong) (object) value >> offset); - } - - return Int64(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Int64(T value, int offset) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) ((long) (object) value >> offset); - } - - return Single(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Single(T value, int offset) - { - if (typeof(T) == typeof(float)) - { - var res = Unsafe.As(ref value) >> offset; - return Unsafe.As(ref res); - } - - return Double(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Double(T value, int offset) - { - if (typeof(T) == typeof(double)) - { - var res = Unsafe.As(ref value) >> offset; - return Unsafe.As(ref res); - } - - return Other(value, offset); - } - - [MethodImpl(MaxOpt)] - static T Other(T value, int offset) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Bitwise/Scalar.Xor.cs b/sources/Maths/Maths/Scalar.Bitwise/Scalar.Xor.cs deleted file mode 100644 index 797e946281..0000000000 --- a/sources/Maths/Maths/Scalar.Bitwise/Scalar.Xor.cs +++ /dev/null @@ -1,137 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - /// - /// Performs Xor on supported types - /// - public static T Xor(T left, T right) where T : unmanaged - { - return Byte(left, right); - - [MethodImpl(MaxOpt)] - static T Byte(T left, T right) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) ((byte) (object) left ^ (byte) (object) right); - } - - return SByte(left, right); - } - - [MethodImpl(MaxOpt)] - static T SByte(T left, T right) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) ((sbyte) (object) left ^ (sbyte) (object) right); - } - - return UInt16(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt16(T left, T right) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) ((ushort) (object) left ^ (ushort) (object) right); - } - - return Int16(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int16(T left, T right) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) ((short) (object) left ^ (short) (object) right); - } - - return UInt32(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt32(T left, T right) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) ((uint) (object) left ^ (uint) (object) right); - } - - return Int32(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int32(T left, T right) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) ((int) (object) left ^ (int) (object) right); - } - - return UInt64(left, right); - } - - [MethodImpl(MaxOpt)] - static T UInt64(T left, T right) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) ((ulong) (object) left ^ (ulong) (object) right); - } - - return Int64(left, right); - } - - [MethodImpl(MaxOpt)] - static T Int64(T left, T right) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) ((long) (object) left ^ (long) (object) right); - } - - return Single(left, right); - } - - [MethodImpl(MaxOpt)] - static T Single(T left, T right) - { - if (typeof(T) == typeof(float)) - { - var res = Unsafe.As(ref left) ^ Unsafe.As(ref right); - return Unsafe.As(ref res); - } - - return Double(left, right); - } - - [MethodImpl(MaxOpt)] - static T Double(T left, T right) - { - if (typeof(T) == typeof(double)) - { - var res = Unsafe.As(ref left) ^ Unsafe.As(ref right); - return Unsafe.As(ref res); - } - - return Other(left, right); - } - - [MethodImpl(MaxOpt)] - static T Other(T left, T right) - { - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Constants.cs b/sources/Maths/Maths/Scalar.Constants.cs deleted file mode 100644 index fb15167d98..0000000000 --- a/sources/Maths/Maths/Scalar.Constants.cs +++ /dev/null @@ -1,387 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; - -// casting into non-nullable, unboxing from nullable -#pragma warning disable 8600 -#pragma warning disable 8605 - - -namespace Silk.NET.Maths -{ - /// - /// To be added. - /// - /// To be added. - public static partial class Scalar where T : notnull - { - /// - /// Represents the smallest positive value that is greater than zero. Zero for non-floating point numbers. - /// - public static readonly T Epsilon; - - /// - /// Represents the largest possible value. - /// - public static readonly T MaxValue; - - /// - /// Represents the smallest possible value. - /// - public static readonly T MinValue; - - /// - /// Represents not a number (NaN). Zero for non-floating point numbers. - /// - public static readonly T NaN; - - /// - /// Represents negative infinity. Zero for non-floating point numbers. - /// - public static readonly T NegativeInfinity; - - /// - /// Represents positive infinity. Zero for non-floating point numbers. - /// - public static readonly T PositiveInfinity; - - /// - /// Represents zero. - /// - public static readonly T Zero = default!; - - /// - /// Represents one. - /// - public static readonly T One; - - /// - /// Represents two. - /// - public static readonly T Two; - - /// - /// Represents negative one. - /// - public static readonly T MinusOne; - - /// - /// Represents negative two. - /// - public static readonly T MinusTwo; - - /// - /// Represents the natural logarithmic base, specified by the constant, e. - /// - public static readonly T E; - - /// - /// Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. - /// - public static readonly T Pi; - - /// - /// Represents Pi divided by two. - /// - public static readonly T PiOver2; - - /// - /// Represents the number of radians in one turn, specified by the constant, τ. - /// - public static readonly T Tau; - - /// - /// Represents the number of degrees in a single radian. - /// - /// - /// This is equivalent to 180 / MathF.Pi - /// - public static readonly T DegreesPerRadian; - - /// - /// Represents the number of radians in a single degree. - /// - /// - /// This is equivalent to MathF.Pi / 180. - /// - public static readonly T RadiansPerDegree; - - internal static readonly bool IntrinsicsApplicable = typeof(T) == typeof(byte) - || typeof(T) == typeof(sbyte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - || typeof(T) == typeof(float) - || typeof(T) == typeof(double); - - private const float FloatE = 2.71828175f; - private const float FloatPi = 3.14159274f; - private const float FloatTau = 6.283185307f; - - [MethodImpl(Scalar.MaxOpt)] -#pragma warning disable 8618 // unitialized fields - static Scalar() -#pragma warning restore 8618 - { - // This won't inline as nicely on platforms that aren't .NET 5, however there's no other way to yield the - // constant folding benefits that come with the fields being static readonly. - // - // We have used local functions elsewhere to get around this elsewhere, however there's no sane way we can - // do that with local functions. - // - // This will inline fine on .NET 5, though. See also: https://github.com/dotnet/runtime/issues/38106 - if (typeof(T) == typeof(Half)) - { - Epsilon = (T) (object) Half.Epsilon; - MaxValue = (T) (object) Half.MaxValue; - MinValue = (T) (object) Half.MinValue; - NaN = (T) (object) Half.NaN; - NegativeInfinity = (T) (object) Half.NegativeInfinity; - PositiveInfinity = (T) (object) Half.PositiveInfinity; - One = (T) (object) (Half) 1; - Two = (T) (object) (Half) 2; - MinusOne = (T) (object) (Half) (-1f); - MinusTwo = (T) (object) (Half) (-2f); - E = (T) (object) (Half) FloatE; - Pi = (T) (object) (Half) FloatPi; - Tau = (T) (object) (Half) FloatTau; - } - else if (typeof(T) == typeof(float)) - { - Epsilon = (T) (object) float.Epsilon; - MaxValue = (T) (object) float.MaxValue; - MinValue = (T) (object) float.MinValue; - NaN = (T) (object) float.NaN; - NegativeInfinity = (T) (object) float.NegativeInfinity; - PositiveInfinity = (T) (object) float.PositiveInfinity; - One = (T) (object) 1f; - Two = (T) (object) 2f; - MinusOne = (T) (object) -1f; - MinusTwo = (T) (object) -2f; - E = (T) (object) FloatE; - Pi = (T) (object) FloatPi; - Tau = (T) (object) FloatTau; - } - else if (typeof(T) == typeof(double)) - { - Epsilon = (T) (object) double.Epsilon; - MaxValue = (T) (object) double.MaxValue; - MinValue = (T) (object) double.MinValue; - NaN = (T) (object) double.NaN; - NegativeInfinity = (T) (object) double.NegativeInfinity; - PositiveInfinity = (T) (object) double.PositiveInfinity; - One = (T) (object) 1d; - Two = (T) (object) 2d; - MinusOne = (T) (object) -1d; - MinusTwo = (T) (object) -2d; - E = (T) (object) Math.E; - Pi = (T) (object) Math.PI; -#if !NET5_0 - Tau = Scalar.Multiply(Pi, Two); -#else - Tau = (T) (object) Math.Tau; -#endif - } - else if (typeof(T) == typeof(decimal)) - { - Epsilon = default!; - MaxValue = (T) (object) decimal.MaxValue; - MinValue = (T) (object) decimal.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) (decimal) 1; - Two = (T) (object) (decimal) 2; - MinusOne = (T) (object) (decimal) -1; - MinusTwo = (T) (object) (decimal) -2; - E = (T) (object) (decimal) Math.E; - Pi = (T) (object) (decimal) Math.PI; - Tau = Scalar.Multiply(Pi, Two); - } - else if (typeof(T) == typeof(short)) - { - Epsilon = default!; - MaxValue = (T) (object) short.MaxValue; - MinValue = (T) (object) short.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) (short) 1; - Two = (T) (object) (short) 2; - MinusOne = (T) (object) (short) -1; - MinusTwo = (T) (object) (short) -2; - E = (T) (object) (short) FloatE; - Pi = (T) (object) (short) FloatPi; - Tau = (T) (object) (short) FloatTau; - } - else if (typeof(T) == typeof(ushort)) - { - Epsilon = default!; - MaxValue = (T) (object) ushort.MaxValue; - MinValue = (T) (object) ushort.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) (ushort) 1; - Two = (T) (object) (ushort) 2; - MinusOne = default!; - MinusTwo = default!; - E = (T) (object) (ushort) FloatE; - Pi = (T) (object) (ushort) FloatPi; - Tau = (T) (object) (ushort) FloatTau; - } - else if (typeof(T) == typeof(sbyte)) - { - Epsilon = default!; - MaxValue = (T) (object) sbyte.MaxValue; - MinValue = (T) (object) sbyte.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) (sbyte) 1; - Two = (T) (object) (sbyte) 2; - MinusOne = (T) (object) (sbyte) -1; - MinusTwo = (T) (object) (sbyte) -2; - E = (T) (object) (sbyte) FloatE; - Pi = (T) (object) (sbyte) FloatPi; - Tau = (T) (object) (sbyte) FloatTau; - } - else if (typeof(T) == typeof(byte)) - { - Epsilon = default!; - MaxValue = (T) (object) byte.MaxValue; - MinValue = (T) (object) byte.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) (byte) 1; - Two = (T) (object) (byte) 2; - MinusOne = default!; - MinusTwo = default!; - E = (T) (object) (byte) FloatE; - Pi = (T) (object) (byte) FloatPi; - Tau = (T) (object) (byte) FloatTau; - } - else if (typeof(T) == typeof(int)) - { - Epsilon = default!; - MaxValue = (T) (object) int.MaxValue; - MinValue = (T) (object) int.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) 1; - Two = (T) (object) 2; - MinusOne = (T) (object) -1; - MinusTwo = (T) (object) -2; - E = (T) (object) (int) FloatE; - Pi = (T) (object) (int) FloatPi; - Tau = (T) (object) (int) FloatTau; - } - else if (typeof(T) == typeof(uint)) - { - Epsilon = default!; - MaxValue = (T) (object) uint.MaxValue; - MinValue = (T) (object) uint.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) 1u; - Two = (T) (object) 2u; - MinusOne = default!; - MinusTwo = default!; - E = (T) (object) (uint) FloatE; - Pi = (T) (object) (uint) FloatPi; - Tau = (T) (object) (uint) FloatTau; - } - else if (typeof(T) == typeof(long)) - { - Epsilon = default!; - MaxValue = (T) (object) long.MaxValue; - MinValue = (T) (object) long.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) 1L; - Two = (T) (object) 2L; - MinusOne = (T) (object) -1L; - MinusTwo = (T) (object) -2L; - E = (T) (object) (long) FloatE; - Pi = (T) (object) (long) FloatPi; - Tau = (T) (object) (long) FloatTau; - } - else if (typeof(T) == typeof(ulong)) - { - Epsilon = default!; - MaxValue = (T) (object) ulong.MaxValue; - MinValue = (T) (object) ulong.MinValue; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) 1ul; - Two = (T) (object) 2ul; - MinusOne = default!; - MinusTwo = default!; - E = (T) (object) (ulong) FloatE; - Pi = (T) (object) (ulong) FloatPi; - Tau = (T) (object) (ulong) FloatTau; - } - else if (typeof(T) == typeof(BigInteger)) - { - Epsilon = default!; - MaxValue = default!; - MinValue = default!; - NaN = default!; - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) BigInteger.One; - Two = (T) (object) (BigInteger) 2; - MinusOne = default!; - MinusTwo = default!; - E = (T) (object) (BigInteger) FloatE; - Pi = (T) (object) (BigInteger) FloatPi; - Tau = (T) (object) (BigInteger) FloatTau; - } - else if (typeof(T) == typeof(Complex)) - { - Epsilon = (T) (object) (Complex)double.Epsilon; - MaxValue = default!; - MinValue = default!; -#if NETCOREAPP3_0_OR_GREATER - NaN = (T) (object) Complex.NaN; -#else -// https://source.dot.net/#System.Runtime.Numerics/System/Numerics/Complex.cs,d2c68d149ad2b6de - NaN = (T) (object) new Complex(double.NaN, double.NaN); -#endif - NegativeInfinity = default!; - PositiveInfinity = default!; - One = (T) (object) (Complex) 1; - Two = (T) (object) (Complex) 2; - MinusOne = (T) (object) (Complex) (-1d); - MinusTwo = (T) (object) (Complex) (-2d); - E = (T) (object) (Complex) Math.E; - Pi = (T) (object) (Complex) Math.PI; -#if !NET5_0 - Tau = Scalar.Multiply(Pi, Two); -#else - Tau = (T) (object) (Complex) Math.Tau; -#endif - } - else - { - // if it's none of these cases, don't do the general cases. - return; - } - - PiOver2 = Scalar.Divide(Pi, Two); - DegreesPerRadian = Scalar.Divide(Scalar.As(180), Pi); - RadiansPerDegree = Scalar.Divide(Pi, Scalar.As(180)); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Conversions.cs b/sources/Maths/Maths/Scalar.Conversions.cs deleted file mode 100644 index 19e83e4f72..0000000000 --- a/sources/Maths/Maths/Scalar.Conversions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// casting into non-nullable, unboxing from nullable -#pragma warning disable 8600 -#pragma warning disable 8605 - -namespace Silk.NET.Maths -{ - public partial class Scalar - { - /// - /// Convert degrees to radians. - /// - /// An angle in degrees. - /// The angle expressed in radians. - public static T DegreesToRadians(T degrees) where T : notnull => Multiply(degrees, Scalar.RadiansPerDegree); - - /// - /// Convert radians to degrees. - /// - /// An angle in radians. - /// The angle expressed in degrees. - public static T RadiansToDegrees(T radians) where T : notnull => Multiply(radians, Scalar.DegreesPerRadian); - } -} diff --git a/sources/Maths/Maths/Scalar.Exp.cs b/sources/Maths/Maths/Scalar.Exp.cs deleted file mode 100644 index 3588353b27..0000000000 --- a/sources/Maths/Maths/Scalar.Exp.cs +++ /dev/null @@ -1,244 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// ported / adopted from https://github.com/amd/aocl-libm-ose/tree/master/src/optmized - -/* - * Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -using System; -using System.Runtime.CompilerServices; -#if SSE -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; -#endif - -namespace Silk.NET.Maths -{ - public static partial class Scalar - { - private static ulong[] InitExp() - { -#if POH - var two_to_jby64 = GC.AllocateUninitializedArray(64, true); -#else - var two_to_jby64 = new ulong[64]; -#endif - int i = 0; - two_to_jby64[i++] = 0x3ff0000000000000; - two_to_jby64[i++] = 0x3fefec9a3e778061; - two_to_jby64[i++] = 0x3fefd9b0d3158574; - two_to_jby64[i++] = 0x3fefc74518759bc8; - two_to_jby64[i++] = 0x3fefb5586cf9890f; - two_to_jby64[i++] = 0x3fefa3ec32d3d1a2; - two_to_jby64[i++] = 0x3fef9301d0125b51; - two_to_jby64[i++] = 0x3fef829aaea92de0; - two_to_jby64[i++] = 0x3fef72b83c7d517b; - two_to_jby64[i++] = 0x3fef635beb6fcb75; - two_to_jby64[i++] = 0x3fef54873168b9aa; - two_to_jby64[i++] = 0x3fef463b88628cd6; - two_to_jby64[i++] = 0x3fef387a6e756238; - two_to_jby64[i++] = 0x3fef2b4565e27cdd; - two_to_jby64[i++] = 0x3fef1e9df51fdee1; - two_to_jby64[i++] = 0x3fef1285a6e4030b; - two_to_jby64[i++] = 0x3fef06fe0a31b715; - two_to_jby64[i++] = 0x3feefc08b26416ff; - two_to_jby64[i++] = 0x3feef1a7373aa9cb; - two_to_jby64[i++] = 0x3feee7db34e59ff7; - two_to_jby64[i++] = 0x3feedea64c123422; - two_to_jby64[i++] = 0x3feed60a21f72e2a; - two_to_jby64[i++] = 0x3feece086061892d; - two_to_jby64[i++] = 0x3feec6a2b5c13cd0; - two_to_jby64[i++] = 0x3feebfdad5362a27; - two_to_jby64[i++] = 0x3feeb9b2769d2ca7; - two_to_jby64[i++] = 0x3feeb42b569d4f82; - two_to_jby64[i++] = 0x3feeaf4736b527da; - two_to_jby64[i++] = 0x3feeab07dd485429; - two_to_jby64[i++] = 0x3feea76f15ad2148; - two_to_jby64[i++] = 0x3feea47eb03a5585; - two_to_jby64[i++] = 0x3feea23882552225; - two_to_jby64[i++] = 0x3feea09e667f3bcd; - two_to_jby64[i++] = 0x3fee9fb23c651a2f; - two_to_jby64[i++] = 0x3fee9f75e8ec5f74; - two_to_jby64[i++] = 0x3fee9feb564267c9; - two_to_jby64[i++] = 0x3feea11473eb0187; - two_to_jby64[i++] = 0x3feea2f336cf4e62; - two_to_jby64[i++] = 0x3feea589994cce13; - two_to_jby64[i++] = 0x3feea8d99b4492ed; - two_to_jby64[i++] = 0x3feeace5422aa0db; - two_to_jby64[i++] = 0x3feeb1ae99157736; - two_to_jby64[i++] = 0x3feeb737b0cdc5e5; - two_to_jby64[i++] = 0x3feebd829fde4e50; - two_to_jby64[i++] = 0x3feec49182a3f090; - two_to_jby64[i++] = 0x3feecc667b5de565; - two_to_jby64[i++] = 0x3feed503b23e255d; - two_to_jby64[i++] = 0x3feede6b5579fdbf; - two_to_jby64[i++] = 0x3feee89f995ad3ad; - two_to_jby64[i++] = 0x3feef3a2b84f15fb; - two_to_jby64[i++] = 0x3feeff76f2fb5e47; - two_to_jby64[i++] = 0x3fef0c1e904bc1d2; - two_to_jby64[i++] = 0x3fef199bdd85529c; - two_to_jby64[i++] = 0x3fef27f12e57d14b; - two_to_jby64[i++] = 0x3fef3720dcef9069; - two_to_jby64[i++] = 0x3fef472d4a07897c; - two_to_jby64[i++] = 0x3fef5818dcfba487; - two_to_jby64[i++] = 0x3fef69e603db3285; - two_to_jby64[i++] = 0x3fef7c97337b9b5f; - two_to_jby64[i++] = 0x3fef902ee78b3ff6; - two_to_jby64[i++] = 0x3fefa4afa2a490da; - two_to_jby64[i++] = 0x3fefba1bee615a27; - two_to_jby64[i++] = 0x3fefd0765b6e4540; - two_to_jby64[i++] = 0x3fefe7c1819e90d8; - - return two_to_jby64; - } - - private static ulong[] __two_to_jby64 = InitExp(); - - [MethodImpl(MaxOpt)] - private static float CoreFastExp(float x) - { - [MethodImpl(MaxOpt)] - static unsafe uint top12f(float x) => asuint32(x) >> 20; - - [MethodImpl(MaxOpt)] - static unsafe uint asuint32(float x) - { -#if SSE - if (Sse.IsSupported) - return Vector128.CreateScalarUnsafe(x).AsUInt32().ToScalar(); // ToScalar "relies" on Sse (the fallback is garbage) - else -#endif - return *(uint*) &x; // this produces bad codegen on < net5 - } - - [MethodImpl(MaxOpt)] - static unsafe float asfloat(uint x) - { -#if SSE - if (Sse.IsSupported) - return Vector128.CreateScalarUnsafe(x).AsSingle().ToScalar(); // ToScalar "relies" on Sse (the fallback is garbage) - else -#endif - return *(float*) &x; // this produces bad codegen on < net5 - } - - [MethodImpl(MaxOpt)] - static unsafe ulong asuint64(double x) - { -#if SSE - if (Sse.IsSupported) - return Vector128.CreateScalarUnsafe(x).AsUInt64().ToScalar(); // ToScalar "relies" on Sse (the fallback is garbage) - else -#endif - return *(ulong*) &x; // this produces bad codegen on < net5 - } - - [MethodImpl(MaxOpt)] - static unsafe double asdouble(ulong x) - { -#if SSE - if (Sse.IsSupported) - return Vector128.CreateScalarUnsafe(x).AsDouble().ToScalar(); // ToScalar "relies" on Sse (the fallback is garbage) - else -#endif - return *(double*) &x; // this produces bad codegen on < net5 - } - - double q, dn, r, z; - ulong n, j; - - uint top = top12f(x); - - if ((top <= top12f(88.0f))) // inverted for likeliness - { - goto ENDCHECK; - } - else - { - if (float.IsNaN(x)) - return x; - - if (float.IsNegativeInfinity(x)) - return 0.0f; - - const float EXPF_FARG_MAX = 3.5990256e+33f; - // const int EXP_Y_INF = 3; - // const int EXP_Y_ZERO = 2; - const float EXPF_FARG_MIN = -103.972076416f; - const uint PINFBITPATT_SP32 = 0x7f800000; - - if (x > EXPF_FARG_MAX) - { - if (asuint32(x) == PINFBITPATT_SP32) - return asfloat(PINFBITPATT_SP32); - - return float.PositiveInfinity; - } - - if (x < EXPF_FARG_MIN) - { - return 1f; - } - } - - ENDCHECK: - const float EXPF_TBLSZ_BY_LN2 = 92.3324826169f; - const float EXPF_HUGE = 6.7553994e+15f; - const float EXPF_LN2_BY_TBLSZ = 0.01083042469f; - const int EXPF_N = 6; - const int EXPF_TABLE_SIZE = (1 << EXPF_N); - z = x * EXPF_TBLSZ_BY_LN2; - - /* - * n = (int) scale(x) - * dn = (double) n - */ - dn = z + EXPF_HUGE; - - n = asuint64(dn); - - dn -= EXPF_HUGE; - - r = x - dn * EXPF_LN2_BY_TBLSZ; - - j = n % EXPF_TABLE_SIZE; - - double qtmp = 0.5f + (0.26567055393f * r); - - double r2 = r * r; - - double tbl = asdouble(__two_to_jby64[j] + (n << (52 - EXPF_N))); - - q = r + (r2 * qtmp); - - double result = tbl + tbl * q; - - return (float) (result); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Inverse.cs b/sources/Maths/Maths/Scalar.Inverse.cs deleted file mode 100644 index f92d5f5c22..0000000000 --- a/sources/Maths/Maths/Scalar.Inverse.cs +++ /dev/null @@ -1,185 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; - -// casting into non-nullable, unboxing from nullable -#pragma warning disable 8600 -#pragma warning disable 8605 - -namespace Silk.NET.Maths -{ - public static partial class Scalar - { - /// - /// Calculates the reciprocal of a number. - /// - /// The number. - /// The type of . - /// The reciprocal of the given number. - [MethodImpl(MaxOpt)] - public static T Reciprocal(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) (1f / (float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) (1f / (float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (1d / (double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) (decimal.One / (decimal) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) (((sbyte) 1) / (sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) (((byte) 1) / (byte) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) (((ushort) 1) / (ushort) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) (((short) 1) / (short) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (((uint) 1) / (uint) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (((int) 1) / (int) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - - return (T) (object) (((ulong) 1) / (ulong) (object) x); - - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (((long) 1) / (long) (object) x); - } - - return BigInteger(x); - } - - [MethodImpl(MaxOpt)] - static T BigInteger(T x) - { - if (typeof(T) == typeof(BigInteger)) - { - return (T)(object)(1 / (BigInteger)(object)x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T)(object)(1 / (Complex)(object)x); - } - - return Other(x); - } - - [MethodImpl(MaxOpt)] - static T Other(T _) - { - ThrowUnsupportedType(); - return default!; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Log.cs b/sources/Maths/Maths/Scalar.Log.cs deleted file mode 100644 index a286fda059..0000000000 --- a/sources/Maths/Maths/Scalar.Log.cs +++ /dev/null @@ -1,307 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -// ported / adopted from https://github.com/amd/aocl-libm-ose/tree/master/src/optmized - -/* - * Copyright (C) 2008-2020 Advanced Micro Devices, Inc. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without modification, - * are permitted provided that the following conditions are met: - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of the copyright holder nor the names of its contributors - * may be used to endorse or promote products derived from this software without - * specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, - * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, - * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - */ - -using System; -using System.Runtime.CompilerServices; -#if SSE -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; -#endif - -namespace Silk.NET.Maths -{ - public static partial class Scalar - { - private static uint[] InitLog() - { -#if POH - var logTblLookup = GC.AllocateUninitializedArray(771, true); -#else - var logTblLookup = new uint[771]; -#endif - int i = 0; - logTblLookup[i++] = 0x40000000; logTblLookup[i++] = 0x0; logTblLookup[i++] = 0x0; logTblLookup[i++] = 0x3fff00ff; logTblLookup[i++] = 0x3b7f8000; logTblLookup[i++] = 0x32aa2b11; logTblLookup[i++] = 0x3ffe03f8; logTblLookup[i++] = 0x3bff0000; logTblLookup[i++] = 0x3429ac42; logTblLookup[i++] = - 0x3ffd08e5; logTblLookup[i++] = 0x3c3ee000; logTblLookup[i++] = 0x350ebf02; logTblLookup[i++] = 0x3ffc0fc1; logTblLookup[i++] = 0x3c7e0000; logTblLookup[i++] = 0x35a8b0fc; logTblLookup[i++] = 0x3ffb1885; logTblLookup[i++] = 0x3c9e7000; logTblLookup[i++] = -0x36244347; logTblLookup[i++] = 0x3ffa232d; logTblLookup[i++] = 0x3cbdc000; logTblLookup[i++] = 0x368d83eb; logTblLookup[i++] = 0x3ff92fb2; logTblLookup[i++] = 0x3cdcf000; logTblLookup[i++] = 0x36e013d8; logTblLookup[i++] = 0x3ff83e10; logTblLookup[i++] = -0x3cfc1000; logTblLookup[i++] = 0x361b0e78; logTblLookup[i++] = 0x3ff74e40; logTblLookup[i++] = 0x3d0d8000; logTblLookup[i++] = 0x36d98924; logTblLookup[i++] = 0x3ff6603e; logTblLookup[i++] = 0x3d1cf000; logTblLookup[i++] = 0x3687b9ff; logTblLookup[i++] = -0x3ff57404; logTblLookup[i++] = 0x3d2c5000; logTblLookup[i++] = 0x36375f92; logTblLookup[i++] = 0x3ff4898d; logTblLookup[i++] = 0x3d3ba000; logTblLookup[i++] = 0x3631ec66; logTblLookup[i++] = 0x3ff3a0d5; logTblLookup[i++] = 0x3d4ae000; logTblLookup[i++] = -0x36830ec9; logTblLookup[i++] = 0x3ff2b9d6; logTblLookup[i++] = 0x3d5a1000; logTblLookup[i++] = 0x36dd7119; logTblLookup[i++] = 0x3ff1d48c; logTblLookup[i++] = 0x3d693000; logTblLookup[i++] = 0x3735c56e; logTblLookup[i++] = 0x3ff0f0f1; logTblLookup[i++] = -0x3d785000; logTblLookup[i++] = 0x35c30046; logTblLookup[i++] = 0x3ff00f01; logTblLookup[i++] = 0x3d83a000; logTblLookup[i++] = 0x37cc1acc; logTblLookup[i++] = 0x3fef2eb7; logTblLookup[i++] = 0x3d8b2000; logTblLookup[i++] = 0x379b7752; logTblLookup[i++] = -0x3fee500f; logTblLookup[i++] = 0x3d929000; logTblLookup[i++] = 0x37fb1785; logTblLookup[i++] = 0x3fed7304; logTblLookup[i++] = 0x3d9a0000; logTblLookup[i++] = 0x37ebcb0e; logTblLookup[i++] = 0x3fec9791; logTblLookup[i++] = 0x3da17000; logTblLookup[i++] = -0x375cbea6; logTblLookup[i++] = 0x3febbdb3; logTblLookup[i++] = 0x3da8d000; logTblLookup[i++] = 0x37839f83; logTblLookup[i++] = 0x3feae564; logTblLookup[i++] = 0x3db03000; logTblLookup[i++] = 0x36b1526f; logTblLookup[i++] = 0x3fea0ea1; logTblLookup[i++] = -0x3db78000; logTblLookup[i++] = 0x37528ae5; logTblLookup[i++] = 0x3fe93965; logTblLookup[i++] = 0x3dbed000; logTblLookup[i++] = 0x36ecdaf6; logTblLookup[i++] = 0x3fe865ac; logTblLookup[i++] = 0x3dc61000; logTblLookup[i++] = 0x37a2eb19; logTblLookup[i++] = -0x3fe79373; logTblLookup[i++] = 0x3dcd5000; logTblLookup[i++] = 0x37a12310; logTblLookup[i++] = 0x3fe6c2b4; logTblLookup[i++] = 0x3dd49000; logTblLookup[i++] = 0x36da7496; logTblLookup[i++] = 0x3fe5f36d; logTblLookup[i++] = 0x3ddbc000; logTblLookup[i++] = -0x37482bb1; logTblLookup[i++] = 0x3fe52598; logTblLookup[i++] = 0x3de2f000; logTblLookup[i++] = 0x36a91eb8; logTblLookup[i++] = 0x3fe45933; logTblLookup[i++] = 0x3dea1000; logTblLookup[i++] = 0x3789eb36; logTblLookup[i++] = 0x3fe38e39; logTblLookup[i++] = -0x3df13000; logTblLookup[i++] = 0x3783b715; logTblLookup[i++] = 0x3fe2c4a7; logTblLookup[i++] = 0x3df85000; logTblLookup[i++] = 0x36430046; logTblLookup[i++] = 0x3fe1fc78; logTblLookup[i++] = 0x3dff6000; logTblLookup[i++] = 0x371131dc; logTblLookup[i++] = -0x3fe135aa; logTblLookup[i++] = 0x3e033000; logTblLookup[i++] = 0x380a8965; logTblLookup[i++] = 0x3fe07038; logTblLookup[i++] = 0x3e06b000; logTblLookup[i++] = 0x383f3e68; logTblLookup[i++] = 0x3fdfac1f; logTblLookup[i++] = 0x3e0a3000; logTblLookup[i++] = -0x3842c234; logTblLookup[i++] = 0x3fdee95c; logTblLookup[i++] = 0x3e0db000; logTblLookup[i++] = 0x38156a98; logTblLookup[i++] = 0x3fde27eb; logTblLookup[i++] = 0x3e113000; logTblLookup[i++] = 0x375e3215; logTblLookup[i++] = 0x3fdd67c9; logTblLookup[i++] = -0x3e14a000; logTblLookup[i++] = 0x38297c10; logTblLookup[i++] = 0x3fdca8f1; logTblLookup[i++] = 0x3e181000; logTblLookup[i++] = 0x386b8c72; logTblLookup[i++] = 0x3fdbeb62; logTblLookup[i++] = 0x3e1b8000; logTblLookup[i++] = 0x387e100f; logTblLookup[i++] = -0x3fdb2f17; logTblLookup[i++] = 0x3e1ef000; logTblLookup[i++] = 0x38615876; logTblLookup[i++] = 0x3fda740e; logTblLookup[i++] = 0x3e226000; logTblLookup[i++] = 0x3815b666; logTblLookup[i++] = 0x3fd9ba42; logTblLookup[i++] = 0x3e25d000; logTblLookup[i++] = -0x36dbce69; logTblLookup[i++] = 0x3fd901b2; logTblLookup[i++] = 0x3e293000; logTblLookup[i++] = 0x37e5e3a2; logTblLookup[i++] = 0x3fd84a5a; logTblLookup[i++] = 0x3e2c9000; logTblLookup[i++] = 0x381c6ccc; logTblLookup[i++] = 0x3fd79436; logTblLookup[i++] = -0x3e2ff000; logTblLookup[i++] = 0x38183854; logTblLookup[i++] = 0x3fd6df44; logTblLookup[i++] = 0x3e335000; logTblLookup[i++] = 0x37cd4273; logTblLookup[i++] = 0x3fd62b81; logTblLookup[i++] = 0x3e36b000; logTblLookup[i++] = 0x35fe719d; logTblLookup[i++] = -0x3fd578e9; logTblLookup[i++] = 0x3e3a0000; logTblLookup[i++] = 0x37f8f540; logTblLookup[i++] = 0x3fd4c77b; logTblLookup[i++] = 0x3e3d5000; logTblLookup[i++] = 0x38448108; logTblLookup[i++] = 0x3fd41733; logTblLookup[i++] = 0x3e40a000; logTblLookup[i++] = -0x386050a2; logTblLookup[i++] = 0x3fd3680d; logTblLookup[i++] = 0x3e43f000; logTblLookup[i++] = 0x38503290; logTblLookup[i++] = 0x3fd2ba08; logTblLookup[i++] = 0x3e474000; logTblLookup[i++] = 0x38146f44; logTblLookup[i++] = 0x3fd20d21; logTblLookup[i++] = -0x3e4a9000; logTblLookup[i++] = 0x373539e9; logTblLookup[i++] = 0x3fd16154; logTblLookup[i++] = 0x3e4dd000; logTblLookup[i++] = 0x381b173f; logTblLookup[i++] = 0x3fd0b6a0; logTblLookup[i++] = 0x3e511000; logTblLookup[i++] = 0x385e0ff1; logTblLookup[i++] = -0x3fd00d01; logTblLookup[i++] = 0x3e545000; logTblLookup[i++] = 0x38767e44; logTblLookup[i++] = 0x3fcf6475; logTblLookup[i++] = 0x3e579000; logTblLookup[i++] = 0x3864a740; logTblLookup[i++] = 0x3fcebcf9; logTblLookup[i++] = 0x3e5ad000; logTblLookup[i++] = -0x3828cf48; logTblLookup[i++] = 0x3fce168a; logTblLookup[i++] = 0x3e5e1000; logTblLookup[i++] = 0x3786742e; logTblLookup[i++] = 0x3fcd7127; logTblLookup[i++] = 0x3e614000; logTblLookup[i++] = 0x38342ac6; logTblLookup[i++] = 0x3fcccccd; logTblLookup[i++] = -0x3e647000; logTblLookup[i++] = 0x387be3cd; logTblLookup[i++] = 0x3fcc2978; logTblLookup[i++] = 0x3e67b000; logTblLookup[i++] = 0x36d53827; logTblLookup[i++] = 0x3fcb8728; logTblLookup[i++] = 0x3e6ae000; logTblLookup[i++] = 0x3685ad3f; logTblLookup[i++] = -0x3fcae5d8; logTblLookup[i++] = 0x3e6e0000; logTblLookup[i++] = 0x385e5056; logTblLookup[i++] = 0x3fca4588; logTblLookup[i++] = 0x3e713000; logTblLookup[i++] = 0x3803b715; logTblLookup[i++] = 0x3fc9a634; logTblLookup[i++] = 0x3e746000; logTblLookup[i++] = -0x3494aa97; logTblLookup[i++] = 0x3fc907da; logTblLookup[i++] = 0x3e778000; logTblLookup[i++] = 0x37adcbdc; logTblLookup[i++] = 0x3fc86a79; logTblLookup[i++] = 0x3e7aa000; logTblLookup[i++] = 0x38052b26; logTblLookup[i++] = 0x3fc7ce0c; logTblLookup[i++] = -0x3e7dc000; logTblLookup[i++] = 0x380c36af; logTblLookup[i++] = 0x3fc73294; logTblLookup[i++] = 0x3e807000; logTblLookup[i++] = 0x37d88b5b; logTblLookup[i++] = 0x3fc6980c; logTblLookup[i++] = 0x3e820000; logTblLookup[i++] = 0x371652d3; logTblLookup[i++] = -0x3fc5fe74; logTblLookup[i++] = 0x3e838000; logTblLookup[i++] = 0x38dc2fe7; logTblLookup[i++] = 0x3fc565c8; logTblLookup[i++] = 0x3e851000; logTblLookup[i++] = 0x3892713a; logTblLookup[i++] = 0x3fc4ce08; logTblLookup[i++] = 0x3e86a000; logTblLookup[i++] = -0x37d6af35; logTblLookup[i++] = 0x3fc43730; logTblLookup[i++] = 0x3e882000; logTblLookup[i++] = 0x38c5fcd7; logTblLookup[i++] = 0x3fc3a13e; logTblLookup[i++] = 0x3e89b000; logTblLookup[i++] = 0x38070294; logTblLookup[i++] = 0x3fc30c31; logTblLookup[i++] = -0x3e8b3000; logTblLookup[i++] = 0x38ae55d6; logTblLookup[i++] = 0x3fc27806; logTblLookup[i++] = 0x3e8cc000; logTblLookup[i++] = 0x3652dd42; logTblLookup[i++] = 0x3fc1e4bc; logTblLookup[i++] = 0x3e8e4000; logTblLookup[i++] = 0x3818c16a; logTblLookup[i++] = -0x3fc15250; logTblLookup[i++] = 0x3e8fc000; logTblLookup[i++] = 0x387f9e49; logTblLookup[i++] = 0x3fc0c0c1; logTblLookup[i++] = 0x3e914000; logTblLookup[i++] = 0x38a0fde8; logTblLookup[i++] = 0x3fc0300c; logTblLookup[i++] = 0x3e92c000; logTblLookup[i++] = -0x38b00870; logTblLookup[i++] = 0x3fbfa030; logTblLookup[i++] = 0x3e944000; logTblLookup[i++] = 0x38ad09ef; logTblLookup[i++] = 0x3fbf112b; logTblLookup[i++] = 0x3e95c000; logTblLookup[i++] = 0x38981d5c; logTblLookup[i++] = 0x3fbe82fa; logTblLookup[i++] = -0x3e974000; logTblLookup[i++] = 0x3862bae1; logTblLookup[i++] = 0x3fbdf59d; logTblLookup[i++] = 0x3e98c000; logTblLookup[i++] = 0x37e392a9; logTblLookup[i++] = 0x3fbd6910; logTblLookup[i++] = 0x3e9a3000; logTblLookup[i++] = 0x38eecd4c; logTblLookup[i++] = -0x3fbcdd53; logTblLookup[i++] = 0x3e9bb000; logTblLookup[i++] = 0x38933160; logTblLookup[i++] = 0x3fbc5264; logTblLookup[i++] = 0x3e9d3000; logTblLookup[i++] = 0x3798aad3; logTblLookup[i++] = 0x3fbbc841; logTblLookup[i++] = 0x3e9ea000; logTblLookup[i++] = -0x38a7d2e1; logTblLookup[i++] = 0x3fbb3ee7; logTblLookup[i++] = 0x3ea02000; logTblLookup[i++] = 0x37421a1b; logTblLookup[i++] = 0x3fbab656; logTblLookup[i++] = 0x3ea19000; logTblLookup[i++] = 0x386f2a05; logTblLookup[i++] = 0x3fba2e8c; logTblLookup[i++] = -0x3ea30000; logTblLookup[i++] = 0x38c5e10e; logTblLookup[i++] = 0x3fb9a786; logTblLookup[i++] = 0x3ea48000; logTblLookup[i++] = 0x35d00801; logTblLookup[i++] = 0x3fb92144; logTblLookup[i++] = 0x3ea5f000; logTblLookup[i++] = 0x37bf2aef; logTblLookup[i++] = -0x3fb89bc3; logTblLookup[i++] = 0x3ea76000; logTblLookup[i++] = 0x38173260; logTblLookup[i++] = 0x3fb81703; logTblLookup[i++] = 0x3ea8d000; logTblLookup[i++] = 0x382d872e; logTblLookup[i++] = 0x3fb79301; logTblLookup[i++] = 0x3eaa4000; logTblLookup[i++] = -0x3822c3ae; logTblLookup[i++] = 0x3fb70fbb; logTblLookup[i++] = 0x3eabb000; logTblLookup[i++] = 0x37ee2e8b; logTblLookup[i++] = 0x3fb68d31; logTblLookup[i++] = 0x3ead2000; logTblLookup[i++] = 0x372ac3d3; logTblLookup[i++] = 0x3fb60b61; logTblLookup[i++] = -0x3eae8000; logTblLookup[i++] = 0x38dedfac; logTblLookup[i++] = 0x3fb58a48; logTblLookup[i++] = 0x3eaff000; logTblLookup[i++] = 0x38983854; logTblLookup[i++] = 0x3fb509e7; logTblLookup[i++] = 0x3eb16000; logTblLookup[i++] = 0x3802f2ba; logTblLookup[i++] = -0x3fb48a3a; logTblLookup[i++] = 0x3eb2c000; logTblLookup[i++] = 0x38dab982; logTblLookup[i++] = 0x3fb40b41; logTblLookup[i++] = 0x3eb43000; logTblLookup[i++] = 0x38481e9b; logTblLookup[i++] = 0x3fb38cfa; logTblLookup[i++] = 0x3eb59000; logTblLookup[i++] = -0x38dd911b; logTblLookup[i++] = 0x3fb30f63; logTblLookup[i++] = 0x3eb70000; logTblLookup[i++] = 0x380eaa2c; logTblLookup[i++] = 0x3fb2927c; logTblLookup[i++] = 0x3eb86000; logTblLookup[i++] = 0x38a1713c; logTblLookup[i++] = 0x3fb21643; logTblLookup[i++] = -0x3eb9c000; logTblLookup[i++] = 0x38ebfb5e; logTblLookup[i++] = 0x3fb19ab6; logTblLookup[i++] = 0x3ebb3000; logTblLookup[i++] = 0x379c2474; logTblLookup[i++] = 0x3fb11fd4; logTblLookup[i++] = 0x3ebc9000; logTblLookup[i++] = 0x38255fdd; logTblLookup[i++] = -0x3fb0a59b; logTblLookup[i++] = 0x3ebdf000; logTblLookup[i++] = 0x385e0a38; logTblLookup[i++] = 0x3fb02c0b; logTblLookup[i++] = 0x3ebf5000; logTblLookup[i++] = 0x38783b83; logTblLookup[i++] = 0x3fafb322; logTblLookup[i++] = 0x3ec0b000; logTblLookup[i++] = -0x38741da1; logTblLookup[i++] = 0x3faf3ade; logTblLookup[i++] = 0x3ec21000; logTblLookup[i++] = 0x3851da1f; logTblLookup[i++] = 0x3faec33e; logTblLookup[i++] = 0x3ec37000; logTblLookup[i++] = 0x38119a33; logTblLookup[i++] = 0x3fae4c41; logTblLookup[i++] = -0x3ec4d000; logTblLookup[i++] = 0x374e1b05; logTblLookup[i++] = 0x3fadd5e6; logTblLookup[i++] = 0x3ec62000; logTblLookup[i++] = 0x38dbe42c; logTblLookup[i++] = 0x3fad602b; logTblLookup[i++] = 0x3ec78000; logTblLookup[i++] = 0x388f439b; logTblLookup[i++] = -0x3faceb10; logTblLookup[i++] = 0x3ec8e000; logTblLookup[i++] = 0x37cfd68b; logTblLookup[i++] = 0x3fac7692; logTblLookup[i++] = 0x3eca3000; logTblLookup[i++] = 0x38ca0e11; logTblLookup[i++] = 0x3fac02b0; logTblLookup[i++] = 0x3ecb9000; logTblLookup[i++] = -0x38234113; logTblLookup[i++] = 0x3fab8f6a; logTblLookup[i++] = 0x3ecce000; logTblLookup[i++] = 0x38cac08c; logTblLookup[i++] = 0x3fab1cbe; logTblLookup[i++] = 0x3ece4000; logTblLookup[i++] = 0x37d605b8; logTblLookup[i++] = 0x3faaaaab; logTblLookup[i++] = -0x3ecf9000; logTblLookup[i++] = 0x3891f660; logTblLookup[i++] = 0x3faa392f; logTblLookup[i++] = 0x3ed0e000; logTblLookup[i++] = 0x38e0326b; logTblLookup[i++] = 0x3fa9c84a; logTblLookup[i++] = 0x3ed24000; logTblLookup[i++] = 0x378121cb; logTblLookup[i++] = -0x3fa957fb; logTblLookup[i++] = 0x3ed39000; logTblLookup[i++] = 0x3824966c; logTblLookup[i++] = 0x3fa8e83f; logTblLookup[i++] = 0x3ed4e000; logTblLookup[i++] = 0x386c9a9a; logTblLookup[i++] = 0x3fa87917; logTblLookup[i++] = 0x3ed63000; logTblLookup[i++] = -0x388c612c; logTblLookup[i++] = 0x3fa80a81; logTblLookup[i++] = 0x3ed78000; logTblLookup[i++] = 0x38949924; logTblLookup[i++] = 0x3fa79c7b; logTblLookup[i++] = 0x3ed8d000; logTblLookup[i++] = 0x388f075f; logTblLookup[i++] = 0x3fa72f05; logTblLookup[i++] = -0x3eda2000; logTblLookup[i++] = 0x38777bcd; logTblLookup[i++] = 0x3fa6c21e; logTblLookup[i++] = 0x3edb7000; logTblLookup[i++] = 0x38359d3d; logTblLookup[i++] = 0x3fa655c4; logTblLookup[i++] = 0x3edcc000; logTblLookup[i++] = 0x37b12d26; logTblLookup[i++] = -0x3fa5e9f7; logTblLookup[i++] = 0x3ede0000; logTblLookup[i++] = 0x38f04587; logTblLookup[i++] = 0x3fa57eb5; logTblLookup[i++] = 0x3edf5000; logTblLookup[i++] = 0x38a6ced4; logTblLookup[i++] = 0x3fa513fd; logTblLookup[i++] = 0x3ee0a000; logTblLookup[i++] = -0x381ff116; logTblLookup[i++] = 0x3fa4a9cf; logTblLookup[i++] = 0x3ee1e000; logTblLookup[i++] = 0x38ebd3e7; logTblLookup[i++] = 0x3fa44029; logTblLookup[i++] = 0x3ee33000; logTblLookup[i++] = 0x3874e3ff; logTblLookup[i++] = 0x3fa3d70a; logTblLookup[i++] = -0x3ee47000; logTblLookup[i++] = 0x38fbe3cd; logTblLookup[i++] = 0x3fa36e72; logTblLookup[i++] = 0x3ee5c000; logTblLookup[i++] = 0x3860744d; logTblLookup[i++] = 0x3fa3065e; logTblLookup[i++] = 0x3ee70000; logTblLookup[i++] = 0x38d785c3; logTblLookup[i++] = -0x3fa29ecf; logTblLookup[i++] = 0x3ee85000; logTblLookup[i++] = 0x37c75ce4; logTblLookup[i++] = 0x3fa237c3; logTblLookup[i++] = 0x3ee99000; logTblLookup[i++] = 0x387e7e01; logTblLookup[i++] = 0x3fa1d13a; logTblLookup[i++] = 0x3eead000; logTblLookup[i++] = -0x38bfcd71; logTblLookup[i++] = 0x3fa16b31; logTblLookup[i++] = 0x3eec1000; logTblLookup[i++] = 0x38f392c5; logTblLookup[i++] = 0x3fa105a9; logTblLookup[i++] = 0x3eed6000; logTblLookup[i++] = 0x3754f8b1; logTblLookup[i++] = 0x3fa0a0a1; logTblLookup[i++] = -0x3eeea000; logTblLookup[i++] = 0x37d40984; logTblLookup[i++] = 0x3fa03c17; logTblLookup[i++] = 0x3eefe000; logTblLookup[i++] = 0x38059907; logTblLookup[i++] = 0x3f9fd80a; logTblLookup[i++] = 0x3ef12000; logTblLookup[i++] = 0x38081a7c; logTblLookup[i++] = -0x3f9f747a; logTblLookup[i++] = 0x3ef26000; logTblLookup[i++] = 0x37e350d1; logTblLookup[i++] = 0x3f9f1166; logTblLookup[i++] = 0x3ef3a000; logTblLookup[i++] = 0x3784c3ad; logTblLookup[i++] = 0x3f9eaecd; logTblLookup[i++] = 0x3ef4d000; logTblLookup[i++] = -0x38fd32cc; logTblLookup[i++] = 0x3f9e4cad; logTblLookup[i++] = 0x3ef61000; logTblLookup[i++] = 0x38cce923; logTblLookup[i++] = 0x3f9deb07; logTblLookup[i++] = 0x3ef75000; logTblLookup[i++] = 0x38906320; logTblLookup[i++] = 0x3f9d89d9; logTblLookup[i++] = -0x3ef89000; logTblLookup[i++] = 0x380f5faf; logTblLookup[i++] = 0x3f9d2922; logTblLookup[i++] = 0x3ef9c000; logTblLookup[i++] = 0x38f2de41; logTblLookup[i++] = 0x3f9cc8e1; logTblLookup[i++] = 0x3efb0000; logTblLookup[i++] = 0x3891fd38; logTblLookup[i++] = -0x3f9c6917; logTblLookup[i++] = 0x3efc4000; logTblLookup[i++] = 0x37946dfd; logTblLookup[i++] = 0x3f9c09c1; logTblLookup[i++] = 0x3efd7000; logTblLookup[i++] = 0x38ac47bc; logTblLookup[i++] = 0x3f9baadf; logTblLookup[i++] = 0x3efeb000; logTblLookup[i++] = -0x379e41ec; logTblLookup[i++] = 0x3f9b4c70; logTblLookup[i++] = 0x3effe000; logTblLookup[i++] = 0x3897042c; logTblLookup[i++] = 0x3f9aee73; logTblLookup[i++] = 0x3f008000; logTblLookup[i++] = 0x397d5893; logTblLookup[i++] = 0x3f9a90e8; logTblLookup[i++] = -0x3f012000; logTblLookup[i++] = 0x392952d3; logTblLookup[i++] = 0x3f9a33cd; logTblLookup[i++] = 0x3f01c000; logTblLookup[i++] = 0x389eefce; logTblLookup[i++] = 0x3f99d723; logTblLookup[i++] = 0x3f025000; logTblLookup[i++] = 0x396fced5; logTblLookup[i++] = -0x3f997ae7; logTblLookup[i++] = 0x3f02f000; logTblLookup[i++] = 0x390a5e93; logTblLookup[i++] = 0x3f991f1a; logTblLookup[i++] = 0x3f039000; logTblLookup[i++] = 0x37f97073; logTblLookup[i++] = 0x3f98c3bb; logTblLookup[i++] = 0x3f042000; logTblLookup[i++] = -0x392e4426; logTblLookup[i++] = 0x3f9868c8; logTblLookup[i++] = 0x3f04c000; logTblLookup[i++] = 0x385e9eae; logTblLookup[i++] = 0x3f980e41; logTblLookup[i++] = 0x3f055000; logTblLookup[i++] = 0x393b5f67; logTblLookup[i++] = 0x3f97b426; logTblLookup[i++] = -0x3f05f000; logTblLookup[i++] = 0x3865c84a; logTblLookup[i++] = 0x3f975a75; logTblLookup[i++] = 0x3f068000; logTblLookup[i++] = 0x3931e65d; logTblLookup[i++] = 0x3f97012e; logTblLookup[i++] = 0x3f072000; logTblLookup[i++] = 0x38130ba4; logTblLookup[i++] = -0x3f96a850; logTblLookup[i++] = 0x3f07b000; logTblLookup[i++] = 0x39120e4e; logTblLookup[i++] = 0x3f964fda; logTblLookup[i++] = 0x3f084000; logTblLookup[i++] = 0x3979cf17; logTblLookup[i++] = 0x3f95f7cc; logTblLookup[i++] = 0x3f08e000; logTblLookup[i++] = -0x38b81788; logTblLookup[i++] = 0x3f95a025; logTblLookup[i++] = 0x3f097000; logTblLookup[i++] = 0x3938caca; logTblLookup[i++] = 0x3f9548e5; logTblLookup[i++] = 0x3f0a1000; logTblLookup[i++] = 0x37809491; logTblLookup[i++] = 0x3f94f209; logTblLookup[i++] = -0x3f0aa000; logTblLookup[i++] = 0x38c3d2f5; logTblLookup[i++] = 0x3f949b93; logTblLookup[i++] = 0x3f0b3000; logTblLookup[i++] = 0x392e55d6; logTblLookup[i++] = 0x3f944581; logTblLookup[i++] = 0x3f0bc000; logTblLookup[i++] = 0x39755dec; logTblLookup[i++] = -0x3f93efd2; logTblLookup[i++] = 0x3f0c6000; logTblLookup[i++] = 0x385c1fec; logTblLookup[i++] = 0x3f939a86; logTblLookup[i++] = 0x3f0cf000; logTblLookup[i++] = 0x38e6b468; logTblLookup[i++] = 0x3f93459c; logTblLookup[i++] = 0x3f0d8000; logTblLookup[i++] = -0x392a5abf; logTblLookup[i++] = 0x3f92f114; logTblLookup[i++] = 0x3f0e1000; logTblLookup[i++] = 0x395c0fb9; logTblLookup[i++] = 0x3f929cec; logTblLookup[i++] = 0x3f0eb000; logTblLookup[i++] = 0x3707f33c; logTblLookup[i++] = 0x3f924925; logTblLookup[i++] = -0x3f0f4000; logTblLookup[i++] = 0x383ebce1; logTblLookup[i++] = 0x3f91f5bd; logTblLookup[i++] = 0x3f0fd000; logTblLookup[i++] = 0x38a34b87; logTblLookup[i++] = 0x3f91a2b4; logTblLookup[i++] = 0x3f106000; logTblLookup[i++] = 0x38dcd193; logTblLookup[i++] = -0x3f915009; logTblLookup[i++] = 0x3f10f000; logTblLookup[i++] = 0x3905fe33; logTblLookup[i++] = 0x3f90fdbc; logTblLookup[i++] = 0x3f118000; logTblLookup[i++] = 0x39186bdf; logTblLookup[i++] = 0x3f90abcc; logTblLookup[i++] = 0x3f121000; logTblLookup[i++] = -0x3925b7a4; logTblLookup[i++] = 0x3f905a38; logTblLookup[i++] = 0x3f12a000; logTblLookup[i++] = 0x392de74c; logTblLookup[i++] = 0x3f900901; logTblLookup[i++] = 0x3f133000; logTblLookup[i++] = 0x3931009a; logTblLookup[i++] = 0x3f8fb824; logTblLookup[i++] = -0x3f13c000; logTblLookup[i++] = 0x392f0945; logTblLookup[i++] = 0x3f8f67a2; logTblLookup[i++] = 0x3f145000; logTblLookup[i++] = 0x392806fb; logTblLookup[i++] = 0x3f8f177a; logTblLookup[i++] = 0x3f14e000; logTblLookup[i++] = 0x391bff61; logTblLookup[i++] = -0x3f8ec7ab; logTblLookup[i++] = 0x3f157000; logTblLookup[i++] = 0x390af813; logTblLookup[i++] = 0x3f8e7835; logTblLookup[i++] = 0x3f160000; logTblLookup[i++] = 0x38e9ed45; logTblLookup[i++] = 0x3f8e2918; logTblLookup[i++] = 0x3f169000; logTblLookup[i++] = -0x38b4012f; logTblLookup[i++] = 0x3f8dda52; logTblLookup[i++] = 0x3f172000; logTblLookup[i++] = 0x38686dc8; logTblLookup[i++] = 0x3f8d8be3; logTblLookup[i++] = 0x3f17b000; logTblLookup[i++] = 0x37aa6542; logTblLookup[i++] = 0x3f8d3dcb; logTblLookup[i++] = -0x3f183000; logTblLookup[i++] = 0x396b99a8; logTblLookup[i++] = 0x3f8cf009; logTblLookup[i++] = 0x3f18c000; logTblLookup[i++] = 0x393d07d4; logTblLookup[i++] = 0x3f8ca29c; logTblLookup[i++] = 0x3f195000; logTblLookup[i++] = 0x39099c89; logTblLookup[i++] = -0x3f8c5584; logTblLookup[i++] = 0x3f19e000; logTblLookup[i++] = 0x38a2ba33; logTblLookup[i++] = 0x3f8c08c1; logTblLookup[i++] = 0x3f1a7000; logTblLookup[i++] = 0x37a27674; logTblLookup[i++] = 0x3f8bbc51; logTblLookup[i++] = 0x3f1af000; logTblLookup[i++] = -0x395276ea; logTblLookup[i++] = 0x3f8b7034; logTblLookup[i++] = 0x3f1b8000; logTblLookup[i++] = 0x390bdaa4; logTblLookup[i++] = 0x3f8b246b; logTblLookup[i++] = 0x3f1c1000; logTblLookup[i++] = 0x3880fe58; logTblLookup[i++] = 0x3f8ad8f3; logTblLookup[i++] = -0x3f1c9000; logTblLookup[i++] = 0x397069ab; logTblLookup[i++] = 0x3f8a8dcd; logTblLookup[i++] = 0x3f1d2000; logTblLookup[i++] = 0x391b9f3f; logTblLookup[i++] = 0x3f8a42f8; logTblLookup[i++] = 0x3f1db000; logTblLookup[i++] = 0x38844a00; logTblLookup[i++] = -0x3f89f874; logTblLookup[i++] = 0x3f1e3000; logTblLookup[i++] = 0x3963fffc; logTblLookup[i++] = 0x3f89ae41; logTblLookup[i++] = 0x3f1ec000; logTblLookup[i++] = 0x39013539; logTblLookup[i++] = 0x3f89645c; logTblLookup[i++] = 0x3f1f5000; logTblLookup[i++] = -0x37ce4dad; logTblLookup[i++] = 0x3f891ac7; logTblLookup[i++] = 0x3f1fd000; logTblLookup[i++] = 0x392dc269; logTblLookup[i++] = 0x3f88d181; logTblLookup[i++] = 0x3f206000; logTblLookup[i++] = 0x38749102; logTblLookup[i++] = 0x3f888889; logTblLookup[i++] = -0x3f20e000; logTblLookup[i++] = 0x3947f423; logTblLookup[i++] = 0x3f883fde; logTblLookup[i++] = 0x3f217000; logTblLookup[i++] = 0x389c6de0; logTblLookup[i++] = 0x3f87f781; logTblLookup[i++] = 0x3f21f000; logTblLookup[i++] = 0x394ff17d; logTblLookup[i++] = -0x3f87af70; logTblLookup[i++] = 0x3f228000; logTblLookup[i++] = 0x389a5134; logTblLookup[i++] = 0x3f8767ab; logTblLookup[i++] = 0x3f230000; logTblLookup[i++] = 0x3945e10e; logTblLookup[i++] = 0x3f872033; logTblLookup[i++] = 0x3f239000; logTblLookup[i++] = -0x38687e67; logTblLookup[i++] = 0x3f86d905; logTblLookup[i++] = 0x3f241000; logTblLookup[i++] = 0x3929e8f5; logTblLookup[i++] = 0x3f869223; logTblLookup[i++] = 0x3f24a000; logTblLookup[i++] = 0x37aa0e8c; logTblLookup[i++] = 0x3f864b8a; logTblLookup[i++] = -0x3f252000; logTblLookup[i++] = 0x38f85db0; logTblLookup[i++] = 0x3f86053c; logTblLookup[i++] = 0x3f25a000; logTblLookup[i++] = 0x395eb4ab; logTblLookup[i++] = 0x3f85bf37; logTblLookup[i++] = 0x3f263000; logTblLookup[i++] = 0x38735f9a; logTblLookup[i++] = -0x3f85797c; logTblLookup[i++] = 0x3f26b000; logTblLookup[i++] = 0x39169d1d; logTblLookup[i++] = 0x3f853408; logTblLookup[i++] = 0x3f273000; logTblLookup[i++] = 0x396c08dc; logTblLookup[i++] = 0x3f84eedd; logTblLookup[i++] = 0x3f27c000; logTblLookup[i++] = -0x38747ea0; logTblLookup[i++] = 0x3f84a9fa; logTblLookup[i++] = 0x3f284000; logTblLookup[i++] = 0x3909e601; logTblLookup[i++] = 0x3f84655e; logTblLookup[i++] = 0x3f28c000; logTblLookup[i++] = 0x3952605d; logTblLookup[i++] = 0x3f842108; logTblLookup[i++] = -0x3f295000; logTblLookup[i++] = 0x37b4996f; logTblLookup[i++] = 0x3f83dcf9; logTblLookup[i++] = 0x3f29d000; logTblLookup[i++] = 0x38ad05ba; logTblLookup[i++] = 0x3f839930; logTblLookup[i++] = 0x3f2a5000; logTblLookup[i++] = 0x391233cd; logTblLookup[i++] = -0x3f8355ad; logTblLookup[i++] = 0x3f2ad000; logTblLookup[i++] = 0x3949aa5a; logTblLookup[i++] = 0x3f83126f; logTblLookup[i++] = 0x3f2b5000; logTblLookup[i++] = 0x397ceada; logTblLookup[i++] = 0x3f82cf75; logTblLookup[i++] = 0x3f2be000; logTblLookup[i++] = -0x382fe66e; logTblLookup[i++] = 0x3f828cc0; logTblLookup[i++] = 0x3f2c6000; logTblLookup[i++] = 0x38adb5cd; logTblLookup[i++] = 0x3f824a4e; logTblLookup[i++] = 0x3f2ce000; logTblLookup[i++] = 0x38fb25fb; logTblLookup[i++] = 0x3f820821; logTblLookup[i++] = -0x3f2d6000; logTblLookup[i++] = 0x3920261b; logTblLookup[i++] = 0x3f81c636; logTblLookup[i++] = 0x3f2de000; logTblLookup[i++] = 0x393e9874; logTblLookup[i++] = 0x3f81848e; logTblLookup[i++] = 0x3f2e6000; logTblLookup[i++] = 0x3958ee36; logTblLookup[i++] = -0x3f814328; logTblLookup[i++] = 0x3f2ee000; logTblLookup[i++] = 0x396f2b8a; logTblLookup[i++] = 0x3f810204; logTblLookup[i++] = 0x3f2f7000; logTblLookup[i++] = 0x35aa4906; logTblLookup[i++] = 0x3f80c122; logTblLookup[i++] = 0x3f2ff000; logTblLookup[i++] = -0x3776d68c; logTblLookup[i++] = 0x3f808081; logTblLookup[i++] = 0x3f307000; logTblLookup[i++] = 0x37cbd11e; logTblLookup[i++] = 0x3f804020; logTblLookup[i++] = 0x3f30f000; logTblLookup[i++] = 0x37fbf692; logTblLookup[i++] = 0x3f800000; logTblLookup[i++] = -0x3f317000; logTblLookup[i++] = 0x3805fdf4; - - return logTblLookup; - } - - private static uint[] _logTblLookup = InitLog(); - - [MethodImpl(MaxOpt)] - private static unsafe float CoreFastLog(float x) - { - [MethodImpl(MaxOpt)] - static unsafe uint asuint(float x) - { -#if SSE - if (Sse.IsSupported) - return Vector128.CreateScalarUnsafe(x).AsUInt32().ToScalar(); // ToScalar "relies" on Sse (the fallback is garbage) - else -#endif - return *(uint*) &x; // this produces bad codegen on < net5 - } - - [MethodImpl(MaxOpt)] - static unsafe float asfloat(uint x) - { -#if SSE - if (Sse.IsSupported) - return Vector128.CreateScalarUnsafe(x).AsSingle().ToScalar(); // ToScalar "relies" on Sse (the fallback is garbage) - else -#endif - return *(float*) &x; // this produces bad codegen on < net5 - } - - uint ux = asuint(x); - - - if (ux - 0x00800000 < 0x7f800000 - 0x00800000) // inverted because likeliness - { - goto EndCheck; - } - else - { - /* x < 0x1p-126 or inf or nan. */ - if (ux * 2 == 0) /* log(0) = -inf */ - return float.NegativeInfinity; - if (ux == 0x7f800000) /* log(inf) = inf */ - return x; - if ((ux & 0x80000000) > 0 || ux * 2 >= 0xff000000) - return float.NaN; - - /* - * 'x' has to be denormal, Normalize it - * there is a possibility that only the last (23'rd) bit is set - * Hence multiply by 2^23 to bring to 1.xxxxx format. - */ - ux = asuint(x * 8388608); - ux -= 23 << 23; - } - - EndCheck: - const int EXPSHIFTBITS_SP32 = 23; // number of bits to shift left to get the exponent - // exponent bias, calculated as (2^(k-1)) - 1, were k = number of bits used to encode the exponent - const int EMAX_SP32 = 127; - const int MANTBITS_SP32 = 0x007fffff; // the bits the mantissa takes up - - int expo = (int) ((ux >> EXPSHIFTBITS_SP32) - EMAX_SP32); - float f_expo = (float) expo; - - const uint NEAR_ONE_LO = 0b111111011100000000000000000000; // BitConverter.SingleToInt32Bits(1 - 1 * 0.0625f); - const uint NEAR_ONE_HI = 0b111111110101010000000000000000; // BitConverter.SingleToInt32Bits(1 + 1.0625f * 0.0625f); - - // Values not very close to 1, !(e^(-1/16) <= x <= e^(1/16) - if (ux - NEAR_ONE_LO >= NEAR_ONE_HI - NEAR_ONE_LO) - { - /* - * Here onwards, 'x' is neither -ve, nor close to 1 - */ - uint mant, mant1, idx; - float y, f, finv, r, r2, q, w; - - const int MASK_MANT_ALL7 = 0b_1111111_10000000_00000000; - // const int MASK_MANT8 = 0x00008000; - mant = ux & MANTBITS_SP32; - mant1 = ux & MASK_MANT_ALL7; - /*This step is needed for more accuracy */ - /* mant1 += ((ux & MASK_MANT8) << 1); */ - - const int LOGF_N = 8; - idx = mant1 >> (EXPSHIFTBITS_SP32 - LOGF_N); - - const int HALFEXPBITS_SP32 = 0b_111111_00000000_00000000_00000000; - y = asfloat(mant | HALFEXPBITS_SP32); - f = asfloat(mant1 | HALFEXPBITS_SP32); - - float f_128_head; - float f_128_tail; -#if POH - var tbl = ((uint*)Unsafe.AsPointer(ref _logTblLookup[0])) + (idx * 3); - finv = asfloat(tbl[0]); - f_128_head = asfloat(tbl[1]); - f_128_tail = asfloat(tbl[2]); -#else - fixed (uint* tbl = _logTblLookup) - { - var p = tbl + (idx * 3); - finv = asfloat(p[0]); - f_128_head = asfloat(p[1]); - f_128_tail = asfloat(p[2]); - } -#endif - - r = (f - y) * finv; - const float C1 = .5f; - const float C2 = 3.333333432674407958984375E-1f; // 1/3 - - r2 = r * r; /* r^2 */ - q = r + (r2 * (C1 + r * C2)); - - const float LOG2_TAIL = 1.18725025653839111328f * 0.00000762939f; - q = (f_expo * LOG2_TAIL) - q; - - const float LOG2_HEAD = 1.3862762451171875f * 0.5f; - w = (LOG2_HEAD * f_expo) + f_128_head; - - q = f_128_tail + q + w; - - return q; - - } - else - { - [MethodImpl(MaxOpt)] - static float InlineLog1Pf(float x) - { - float r, r2, w; - - r = x - 1.0f; - - w = r / (2.0f + r); - - float correction = w * r; - - w += w; - - float w2 = w * w; - - const float A1 = 8.33333333333317923934e-02f; - const float A2 = 1.25000000037717509602e-02f; - - r2 = (w * w2 * (A1 + A2 * w2)) - correction; - - float f = r2 + r; - - return f; - } - - return InlineLog1Pf(x); - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.MathFPort.MissingMethods.cs b/sources/Maths/Maths/Scalar.MathFPort.MissingMethods.cs deleted file mode 100644 index 638c0d03f0..0000000000 --- a/sources/Maths/Maths/Scalar.MathFPort.MissingMethods.cs +++ /dev/null @@ -1,379 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - partial class Scalar - { - ///////////////////////////////////////////////// BEGIN GO CODE /////////////////////////////////////////////// - - // Adapted from https://golang.org/src/math/atanh.go - // ==================================================== - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - // ==================================================== - // The original C code, the long comment, and the constants - // below are from FreeBSD's /usr/src/lib/msun/src/e_atanh.c - // and came with this notice. The go code is a simplified - // version of the original C. - // ==================================================== - // Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - // - // Developed at SunPro, a Sun Microsystems, Inc. business. - // Permission to use, copy, modify, and distribute this - // software is freely granted, provided that this notice - // is preserved. - // ==================================================== - [MethodImpl(MaxOpt)] - private static double CoreAtanh(double x) - { - const double nearZero = 1.0 / (1 << 28); // 2**-28 - // special cases - if (x < -1 || x > 1 || double.IsNaN(x)) - { - return double.NaN; - } - - switch (x) - { - case 1: - { - return double.PositiveInfinity; - } - case -1: - { - return double.NegativeInfinity; - } - } - - var sign = false; - if (x < 0) - { - x = -x; - sign = true; - } - - double temp; - if (x < nearZero) - { - temp = x; - } - else if (x < 0.5) - { - temp = x + x; - temp = 0.5 * Log1P(temp + temp * x / (1 - x)); - } - else - { - temp = 0.5 * Log1P((x + x) / (1 - x)); - } - - if (sign) - { - temp = -temp; - } - - return temp; - } - - // Adapted from: https://golang.org/src/math/log1p.go - // ==================================================== - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - // ==================================================== - // The original C code, the long comment, and the constants - // below are from FreeBSD's /usr/src/lib/msun/src/s_log1p.c - // and came with this notice. The go code is a simplified - // version of the original C. - // ==================================================== - // Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - // - // Developed at SunPro, a Sun Microsystems, Inc. business. - // Permission to use, copy, modify, and distribute this - // software is freely granted, provided that this notice - // is preserved. - // ==================================================== - - [MethodImpl(MaxOpt)] - private static unsafe double Log1P(double x) - { - const double sqrt2M1 = 4.142135623730950488017e-01; // Sqrt(2)-1 = 0x3fda827999fcef34 - const double sqrt2HalfM1 = -2.928932188134524755992e-01; // Sqrt(2)/2-1 = 0xbfd2bec333018866 - const double small = 1.0 / (1 << 29); // 2**-29 = 0x3e20000000000000 - const double tiny = 1.0 / (1L << 54); // 2**-54 - const double two53 = 1L << 53; // 2**53 - const double ln2Hi = 6.93147180369123816490e-01; // 3fe62e42fee00000 - const double ln2Lo = 1.90821492927058770002e-10; // 3dea39ef35793c76 - const double lp1 = 6.666666666666735130e-01; // 3FE5555555555593 - const double lp2 = 3.999999999940941908e-01; // 3FD999999997FA04 - const double lp3 = 2.857142874366239149e-01; // 3FD2492494229359 - const double lp4 = 2.222219843214978396e-01; // 3FCC71C51D8E78AF - const double lp5 = 1.818357216161805012e-01; // 3FC7466496CB03DE - const double lp6 = 1.531383769920937332e-01; // 3FC39A09D078C69F - const double lp7 = 1.479819860511658591e-01; // 3FC2F112DF3E5244 - - // special cases - if (x < -1 || double.IsNaN(x)) - { - // includes -Inf - return double.NaN; - } - - if (x == -1) - { - return double.NegativeInfinity; - } - - if (double.IsPositiveInfinity(x)) - { - return double.PositiveInfinity; - } - - var absx = x; - if (absx < 0) - { - absx = -absx; - } - - double f = default; - ulong iu = default; - var k = 1; - if (absx < sqrt2M1) - { - // |x| < Sqrt(2)-1 - if (absx < small) - { - // |x| < 2**-29 - if (absx < tiny) - { - // |x| < 2**-54 - return x; - } - - return x - x * x * 0.5; - } - - if (x > sqrt2HalfM1) - { - // Sqrt(2)/2-1 < x - // (Sqrt(2)/2-1) < x < (Sqrt(2)-1) - k = 0; - f = x; - iu = 1; - } - } - - double c = default; - if (k != 0) - { - double u; - if (absx < two53) - { - // 1<<53 - u = 1.0 + x; - var ius = BitConverter.DoubleToInt64Bits(u); - iu = *(ulong*) &ius; - k = (int) ((iu >> 52) - 1023); - // correction term - if (k > 0) - { - c = 1.0 - (u - x); - } - else - { - c = x - (u - 1.0); - } - - c /= u; - } - else - { - u = x; - var ius = BitConverter.DoubleToInt64Bits(u); - iu = *(ulong*) &ius; - k = (int) ((iu >> 52) - 1023); - c = 0; - } - - iu &= 0x000fffffffffffff; - if (iu < 0x0006a09e667f3bcd) - { - // mantissa of Sqrt(2) - var uu = iu | 0x3ff0000000000000; - u = BitConverter.Int64BitsToDouble(*(long*) &uu); // normalize u - } - else - { - k++; - var uu = iu | 0x3fe0000000000000; - u = BitConverter.Int64BitsToDouble(*(long*) &uu); // normalize u/2 - iu = (0x0010000000000000 - iu) >> 2; - } - - f = u - 1.0; // Sqrt(2)/2 < u < Sqrt(2) - } - - var hfsq = 0.5 * f * f; - double s, r, z; - if (iu == 0) - { - // |f| < 2**-20 - if (f == 0) - { - if (k == 0) - { - return 0; - } - - c += k * ln2Lo; - return k * ln2Hi + c; - } - - r = hfsq * (1.0 - 0.66666666666666666 * f); // avoid division - if (k == 0) - { - return f - r; - } - - return k * ln2Hi - (r - (k * ln2Lo + c) - f); - } - - s = f / (2.0 + f); - z = s * s; - - r = z * (lp1 + z * (lp2 + z * (lp3 + z * (lp4 + z * (lp5 + z * (lp6 + z * lp7)))))); - if (k == 0) - { - return f - (hfsq - s * (hfsq + r)); - } - - return k * ln2Hi - (hfsq - (s * (hfsq + r) + (k * ln2Lo + c)) - f); - } - - // Adapted from: https://golang.org/src/math/acosh.go - // ==================================================== - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - // ==================================================== - // The original C code, the long comment, and the constants - // below are from FreeBSD's /usr/src/lib/msun/src/e_acosh.c - // and came with this notice. The go code is a simplified - // version of the original C. - // ==================================================== - // Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - // - // Developed at SunPro, a Sun Microsystems, Inc. business. - // Permission to use, copy, modify, and distribute this - // software is freely granted, provided that this notice - // is preserved. - // ==================================================== - [MethodImpl(MaxOpt)] - private static double CoreAcosh(double x) - { - const double ln2 = 6.93147180559945286227e-01; // 0x3FE62E42FEFA39EF - const double large = 1 << 28; // 2**28 - // first case is special case - if (x < 1 || double.IsNaN(x)) - { - return double.NaN; - } - - if (x == 1) - { - return 0; - } - - if (x >= large) - { - return Log(x) + ln2; // x > 2**28 - } - - if (x > 2) - { - return Log(2 * x - 1 / (x + Sqrt(x * x - 1))); // 2**28 > x > 2 - } - - var t = x - 1; - return Log1P(t + Sqrt(2 * t + t * t)); // 2 >= x > 1 - } - - // Adapted from: https://golang.org/src/math/asinh.go - // ==================================================== - // Copyright 2010 The Go Authors. All rights reserved. - // Use of this source code is governed by a BSD-style - // license that can be found in the LICENSE file. - // ==================================================== - // The original C code, the long comment, and the constants - // below are from FreeBSD's /usr/src/lib/msun/src/s_asinh.c - // and came with this notice. The go code is a simplified - // version of the original C. - // ==================================================== - // Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - // - // Developed at SunPro, a Sun Microsystems, Inc. business. - // Permission to use, copy, modify, and distribute this - // software is freely granted, provided that this notice - // is preserved. - // ==================================================== - [MethodImpl(MaxOpt)] - private static double CoreAsinh(double x) - { - const double ln2 = 6.93147180559945286227e-01; // 0x3FE62E42FEFA39EF - const double nearZero = 1.0 / (1 << 28); // 2**-28 - const double large = 1 << 28; // 2**28 - // special cases - if (IsNaN(x) || double.IsInfinity(x)) - { - return x; - } - - var sign = false; - if (x < 0) - { - x = -x; - sign = true; - } - - double temp; - if (x > large) - { - temp = Log(x) + ln2; // |x| > 2**28 - } - else if (x > 2) - { - temp = Log(2 * x + 1 / (Sqrt(x * x + 1) + x)); // 2**28 > |x| > 2.0 - } - else if (x < nearZero) - { - temp = x; // |x| < 2**-28 - } - else - { - temp = Log1P(x + x * x / (1 + Sqrt(1 + x * x))); // 2.0 > |x| > 2**-28 - } - - if (sign) - { - temp = -temp; - } - - return temp; - } - - ////////////////////////////////////////////////// END GO CODE //////////////////////////////////////////////// - - [MethodImpl(MaxOpt)] - private static double CoreCbrt(double x) -#if NETSTANDARD2_0 - => Math.Ceiling(Math.Pow(x, 1d / 3)); -#else - => Math.Cbrt(x); -#endif - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.MathFPort.cs b/sources/Maths/Maths/Scalar.MathFPort.cs deleted file mode 100644 index f42d9d3897..0000000000 --- a/sources/Maths/Maths/Scalar.MathFPort.cs +++ /dev/null @@ -1,5658 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -#if SSE || AdvSIMD -using System.Runtime.Intrinsics; -#endif -#if SSE -using System.Runtime.Intrinsics.X86; -#endif -#if AdvSIMD -using System.Runtime.Intrinsics.Arm; -#endif - -// it doesn't like default because it may be null -#pragma warning disable 8603 - -namespace Silk.NET.Maths -{ - public static partial class Scalar - { - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // This partial contains the helper methods which forward to MathF or Math, used a lot within Silk.NET.Maths - // - // For the most part, these are pretty direct forwards. However there are a lot of unnecessary up-casts in a lot - // of places. Possible tasks could be: - // a) TODO identifying where we're up-casting unnecessarily - // (it's done a lot throughout this file as System.Math pretty much only supports double) - // b) TODO removing unnecessary up-casts with dedicated, managed methods. - // c) TODO implement any unimplemented methods - // Ctrl+F for ThrowOpUnsupportedPrecision - // - // These should be done around 2.0 Preview 5 time, but if you're reading this comment after 2.0's initial - // release then feel free to PR in some of these changes as we clearly have failed. - //////////////////////////////////////////////////////////////////////////////////////////////////////////////// - - /// - /// Returns the absolute value of a number. - /// - /// The value to get the absolute of - /// The type of - /// The absolute of the given value - [MethodImpl(MaxOpt)] - public static unsafe T Abs(T x) where T : unmanaged - { - if (typeof(T) == typeof(Half)) - { -#if NET5_0 && INTRINSICS - if (Sse2.IsSupported) - { - return (T)(object)(Half)Sse.And(Vector128.CreateScalarUnsafe((float) (Half) (object) x), Vector128.Create(-0.0f)).ToScalar(); - } - else if (AdvSimd.IsSupported) - { - return (T)(object)(Half)AdvSimd.And(Vector128.CreateScalarUnsafe((float) (Half) (object) x), Vector128.Create(-0.0f)).ToScalar(); - } - else -#elif NETCOREAPP3_1 && INTRINSICS - if (Sse.IsSupported) - { - return (T)(object)(Half)Sse.And(Vector128.CreateScalarUnsafe((float) (Half) (object) x), Vector128.CreateScalarUnsafe(-0.0f)).ToScalar(); - } - else -#endif - { - var v = *(ushort*) &x; - v &= 0x7FFF; - return *(T*) &v; - } - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if NET5_0 && INTRINSICS - if (Sse.IsSupported) - { - return (T)(object)(float)Sse.And(Vector128.CreateScalarUnsafe((float)(object)x), Vector128.Create((uint)0x7FFF_FFFF).AsSingle()).ToScalar(); - } - else if (AdvSimd.IsSupported) - { - return (T) (object) (float)AdvSimd.AbsScalar(Vector64.CreateScalarUnsafe((float) (object) x)).ToScalar(); - } - else -#elif NETCOREAPP3_1 && INTRINSICS - if (Sse.IsSupported) - { - return (T)(object)(float)Sse.And(Vector128.CreateScalarUnsafe((float)(object)x), Vector128.CreateScalarUnsafe((uint)0x7FFF_FFFF).AsSingle()).ToScalar(); - } - else -#endif - { - var v = *(uint*) &x; - v &= 0x7FFF_FFFF; - return *(T*) &v; - } - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { -#if NET5_0 && INTRINSICS - if (Sse2.IsSupported) - { - return (T)(object)(double)Sse2.And(Vector128.CreateScalarUnsafe((double)(object)x), Vector128.Create((ulong)0x7FFF_FFFF_FFFF_FFF).AsDouble()).ToScalar(); - } - else if (AdvSimd.IsSupported) - { - return (T) (object) (double)AdvSimd.AbsScalar(Vector64.CreateScalar((double) (object) x)).ToScalar(); - } - else -#elif NETCOREAPP3_1 && INTRINSICS - if (Sse2.IsSupported) - { - return (T)(object)(double)Sse2.And(Vector128.CreateScalarUnsafe((double)(object)x), Vector128.CreateScalarUnsafe((ulong)0x7FFF_FFFF_FFFF_FFF).AsDouble()).ToScalar(); - } - else -#endif - { - var v = *(ulong*) &x; - v &= 0x7FFF_FFFF_FFFF_FFFF; - return *(T*) &v; - } - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { -#if SSE - if (Ssse3.IsSupported) - { - return (T)(object)(sbyte)Ssse3.Abs(Vector128.CreateScalar((sbyte) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T) (object) (sbyte)AdvSimd.Abs(Vector64.CreateScalar((sbyte) (object) x)).ToScalar(); - } -#endif - var px = (sbyte) (object) x; - sbyte mask = (sbyte) (px >> (sizeof(sbyte) - 1)); - return (T) (object) (sbyte) ((px + mask) ^ mask); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return x; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { -#if SSE - if (Ssse3.IsSupported) - { - return (T)(object)(int)Ssse3.Abs(Vector128.CreateScalar((int) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T) (object)(int) AdvSimd.Abs(Vector64.CreateScalar((int) (object) x)).ToScalar(); - } -#endif - var px = (int) (object) x; - int mask = (int) (px >> (sizeof(int) - 1)); - return (T) (object) (int) ((px + mask) ^ mask); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return x; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - var px = (long) (object) x; - long mask = (long) (px >> (sizeof(long) - 1)); - return (T) (object) (long) ((px + mask) ^ mask); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return x; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { -#if SSE - if (Ssse3.IsSupported) - { - return (T)(object)(short)Ssse3.Abs(Vector128.CreateScalar((short) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T) (object)(short)AdvSimd.Abs(Vector64.CreateScalar((short) (object) x)).ToScalar(); - } -#endif - var px = (short) (object) x; - short mask = (short) (px >> (sizeof(short) - 1)); - return (T) (object) (short) ((px + mask) ^ mask); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return x; - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - return (T)(object) new Complex(System.Numerics.Complex.Abs((Complex)(object)x), 0); - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) Math.Abs((decimal) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose cosine is the specified number. - /// - /// A number representing a cosine, where must be greater than or equal to -1, but less than or equal to 1. - /// The type of - /// - ///An angle, θ, measured in radians, such that 0 ≤ θ ≤ π. - /// - /// -or- - /// - /// NaN if x < -1 or x > 1 or x equals NaN. - /// - [MethodImpl(MaxOpt)] - public static T Acos(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Acos((float) (Half) (object) x); // KIPLING -#else - return (T) (object) (Half) MathF.Abs((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Acos((float) (object) x); // KIPLING -#else - return (T) (object) MathF.Acos((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Acos((double) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Acos((sbyte) (object) x); // KIPLING - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Acos((byte) (object) x); // KIPLING - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Acos((int) (object) x); // KIPLING - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Acos((uint) (object) x); // KIPLING - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Acos((long) (object) x); // KIPLING - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Acos((ulong) (object) x); // KIPLING - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Acos((short) (object) x); // KIPLING - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Acos((ushort) (object) x); // KIPLING - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Acos((Complex) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose hyperbolic cosine is the specified number. - /// - /// A number representing a hyperbolic cosine, where must be greater than or equal to 1, but less than or equal to . - /// The type of . - /// - /// An angle, θ, measured in radians, such that 0 ≤ θ ≤ ∞. - /// - /// -or- - /// - /// NaN if x < 1 or x equals NaN. - /// - [MethodImpl(MaxOpt)] - public static T Acosh(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) (float) CoreAcosh((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) CoreAcosh((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) CoreAcosh((double) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) CoreAcosh((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) CoreAcosh((byte) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) CoreAcosh((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (byte) CoreAcosh((byte) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) CoreAcosh((long) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) CoreAcosh((ulong) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) CoreAcosh((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) CoreAcosh((int) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose sine is the specified number. - /// - /// A number representing a sine, where must be greater than or equal to -1, but less than or equal to 1. - /// The type of - /// An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. - /// - /// -or- - /// - /// NaN if x < -1 or x > 1 or x equals NaN. - /// - [MethodImpl(MaxOpt)] - public static T Asin(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Asin((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Abs((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Asin((float) (object) x); -#else - return (T) (object) MathF.Asin((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Asin((double) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Asin((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Asin((byte) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Asin((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Asin((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Asin((long) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Asin((ulong) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Asin((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Asin((ushort) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Asin((Complex) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose hyperbolic sine is the specified number. - /// - /// A number representing a hyperbolic sine, where must be greater than or equal to , but less than or equal to . - /// - /// - [MethodImpl(MaxOpt)] - public static T Asinh(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) (float) CoreAsinh((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) CoreAsinh((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) CoreAsinh((double) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) CoreAsinh((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) CoreAsinh((byte) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) CoreAsinh((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) CoreAsinh((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) CoreAsinh((long) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) CoreAsinh((ulong) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) CoreAsinh((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) CoreAsinh((ushort) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose tangent is the specified number. - /// - /// A number representing a tangent. - /// The type of . - /// - ///An angle, θ, measured in radians, such that -π/2 ≤ θ ≤ π/2. - /// - /// -or- - /// - /// NaN if equals , -π/2 rounded to double precision (-1.5707963267949) if equals , or π/2 rounded to double precision (1.5707963267949) if equals . - /// - [MethodImpl(MaxOpt)] - public static T Atan(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Atan((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Abs((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Atan((float) (object) x); -#else - return (T) (object) MathF.Atan((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Atan((double) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Atan((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Atan((byte) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Atan((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Atan((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Atan((long) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Atan((ulong) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Atan((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Atan((ushort) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Atan((Complex) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose hyperbolic tangent is the specified number. - /// - /// A number representing a hyperbolic tangent, where must be greater than or equal to -1, but less than or equal to 1. - /// The type of . - /// - /// An angle, θ, measured in radians, such that -∞ < θ < -1, or 1 < θ < ∞. - /// - /// -or- - /// - /// if x < -1 or x > 1 or x equals . - /// - [MethodImpl(MaxOpt)] - public static T Atanh(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) Atanh((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) Atanh((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) CoreAtanh((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) CoreAtanh((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) CoreAtanh((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) CoreAtanh((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) CoreAtanh((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) CoreAtanh((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) CoreAtanh((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) CoreAtanh((long) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) CoreAtanh((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the cube root of a specified number. - /// - /// The number whose cube root is to be found. - /// The type of - /// - /// The cube root of . - /// - /// -or- - /// - /// if is equals . - /// - [MethodImpl(MaxOpt)] - public static T Cbrt(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) CoreCbrt((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) CoreCbrt((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) CoreCbrt((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) CoreCbrt((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) CoreCbrt((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) CoreCbrt((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) CoreCbrt((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) CoreCbrt((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) CoreCbrt((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) CoreCbrt((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Pow((Complex) (object) x, 1.0/3); // TODO: find a more efficient impl? - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) CoreCbrt((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the smallest integral value that is greater than or equal to the specified single-precision floating-point number. - /// - /// A number. - /// The type of . - /// The smallest integral value that is greater than or equal to . If is equal to , , or , that value is returned. Note that this method returns instead of an integral type. - [MethodImpl(MaxOpt)] - public static T Ceiling(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) Math.Ceiling((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Ceiling((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Ceiling((float) (object) x); -#else - return (T) (object) MathF.Ceiling((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Ceiling((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) Math.Ceiling((decimal) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return x; - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return x; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return x; - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return x; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return x; - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return x; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return x; - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return x; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the cosine of the specified angle. - /// - /// An angle, measured in radians. - /// The type of . - /// The cosine of . If is equal to , , or , this method returns . - [MethodImpl(MaxOpt)] - public static T Cos(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) Math.Cos((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Cos((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Cos((float) (object) x); -#else - return (T) (object) MathF.Cos((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Cos((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Cos((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Cos((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Cos((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Cos((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Cos((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Cos((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Cos((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Cos((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Cos((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the hyperbolic cosine of the specified angle. - /// - /// An angle, measured in radians. - /// The type of . - /// The hyperbolic cosine of . If equal to or , is returned. If is equal to , is returned. - [MethodImpl(MaxOpt)] - public static T Cosh(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) Math.Cosh((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Cosh((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Cosh((float) (object) x); -#else - return (T) (object) MathF.Cosh((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Cosh((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Cosh((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Cosh((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Cosh((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Cosh((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Cosh((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Cosh((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Cosh((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Cosh((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Cosh((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns e raised to the specified power. - /// - /// A number specifying a power. - /// The type of . - /// The number e raised to the power . If equals or , that value is returned. If equals , 0 is returned. - [MethodImpl(MaxOpt)] - public static T Exp(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) CoreFastExp((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) CoreFastExp((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Exp((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Exp((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Exp((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Exp((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Exp((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Exp((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Exp((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Exp((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Exp((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Exp((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the largest integral value less than or equal to the specified single-precision floating-point number. - /// - /// A number. - /// The type of . - /// The largest integral value less than or equal to . If is equal to , , or , that value is returned. - [MethodImpl(MaxOpt)] - public static T Floor(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if SSE - if (Sse41.IsSupported) - { - return (T)(object)(Half)Sse41.FloorScalar(Vector128.CreateScalarUnsafe((float) (Half) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(Half)AdvSimd.FloorScalar(Vector64.CreateScalarUnsafe((float) (Half) (object) x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (Half) Math.Floor((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Floor((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if SSE - if (Sse41.IsSupported) - { - return (T)(object)Sse41.FloorScalar(Vector128.CreateScalarUnsafe((float) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)AdvSimd.FloorScalar(Vector64.CreateScalarUnsafe((float) (object) x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (float) Math.Floor((float) (object) x); -#else - return (T) (object) MathF.Floor((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { -#if SSE - if (Sse41.IsSupported) - { - return (T)(object)Sse41.FloorScalar(Vector128.CreateScalarUnsafe((double) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)AdvSimd.FloorScalar(Vector64.CreateScalar((double) (object) x)).ToScalar(); - } -#endif - return (T) (object) Math.Floor((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { -#if SSE - if (Sse41.IsSupported) - { - return (T)(object)(decimal)Sse41.FloorScalar(Vector128.CreateScalarUnsafe((double)(decimal) (object) x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(decimal)AdvSimd.FloorScalar(Vector64.CreateScalar((double)(decimal) (object) x)).ToScalar(); - } -#endif - return (T) (object) Math.Floor((decimal) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return x; - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return x; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return x; - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return x; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return x; - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return x; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return x; - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return x; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns an integer that indicates the sign of a single-precision floating-point number. - /// - /// A number. - /// The type of - /// - /// A number that indicates the sign of , as shown in the following table. - /// - /// - /// Return value - /// Meaning - /// - /// - /// -1 - /// is less than zero. - /// - /// - /// 0 - /// is equal to zero. - /// - /// - /// 1 - /// is greater than zero. - /// - /// - /// - /// - /// For unsigned numbers this will never return -1, but will return 0 when is 0 - /// - /// is equal to - [MethodImpl(MaxOpt)] - public static int Sign(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return Math.Sign((float) (Half) (object) x); -#else - return MathF.Sign((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static int Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return Math.Sign((float) (object) x); -#else - return MathF.Sign((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static int Double(T x) - { - if (typeof(T) == typeof(double)) - { - return Math.Sign((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static int Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - return Math.Sign((decimal) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static int SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return Math.Sign((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static int Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return ((byte) (object) x) > 0 ? 1 : 0; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static int Short(T x) - { - if (typeof(T) == typeof(short)) - { - return Math.Sign((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static int UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return ((ushort) (object) x) > 0 ? 1 : 0; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static int Int(T x) - { - if (typeof(T) == typeof(int)) - { - return Math.Sign((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static int UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return ((uint) (object) x) > 0 ? 1 : 0; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static int Long(T x) - { - if (typeof(T) == typeof(long)) - { - return Math.Sign((long) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static int ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return ((ulong) (object) x) > 0 ? 1 : 0; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the sine of the specified angle. - /// - /// An angle, measured in radians. - /// The type of . - /// The sine of . If is equal to , , or , this method returns . - [MethodImpl(MaxOpt)] - public static T Sin(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) (float) Sin_Ported((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) (float) Sin_Ported((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Sin((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Sin((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Sin((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Sin((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Sin((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Sin((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Sin((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Sin((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Sin((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Sin((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the hyperbolic sine of the specified angle. - /// - /// An angle, measured in radians. - /// Type of . - /// The hyperbolic sine of . If is equal to , , or this method returns . - [MethodImpl(MaxOpt)] - public static T Sinh(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Sinh((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Sinh((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Sinh((float) (object) x); -#else - return (T) (object) MathF.Sinh((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Sinh((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Sinh((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Sinh((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Sinh((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Sinh((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Sinh((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Sinh((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Sinh((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Sinh((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Sinh((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the square root of a specified number. - /// - /// The number whose square root is to be found. - /// The type of . - /// - /// One of the values in the following table. - /// - /// - /// parameter - /// Return value - /// - /// - /// Zero or positive - /// The positive square root of . - /// - /// - /// Negative - /// - /// - /// - /// Equals - /// - /// - /// - /// Equals - /// - /// - /// - /// - [MethodImpl(MaxOpt)] - public static T Sqrt(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if SSE - if (Sse42.IsSupported) - { - return (T)(object)(Half)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(Half)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(Half)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(Half)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (Half) (float) Math.Sqrt((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Sqrt((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (float) Math.Sqrt((float) (object) x); -#else - return (T) (object) MathF.Sqrt((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { -#if SSE - if (Sse2.IsSupported) - { - return (T)(object)(double)Sse2.SqrtScalar(Vector128.CreateScalarUnsafe((double)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(double)AdvSimd.SqrtScalar(Vector64.CreateScalar((double)(object)x)).ToScalar(); - } -#endif - return (T) (object) (double) Math.Sqrt((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(sbyte)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(sbyte)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(sbyte)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(sbyte)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (sbyte) (float) Math.Sqrt((float) (sbyte) (object) x); -#else - return (T) (object) (sbyte)(float)MathF.Sqrt((float) (sbyte)(object) x); -#endif - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(byte)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(byte)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(byte)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(byte)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (byte) (float) Math.Sqrt((float) (byte) (object) x); -#else - return (T) (object) (byte)(float)MathF.Sqrt((float) (byte)(object) x); -#endif - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(short)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(short)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(short)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(short)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (short) (float) Math.Sqrt((float) (short) (object) x); -#else - return (T) (object) (short)(float)MathF.Sqrt((float) (short)(object) x); -#endif - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(ushort)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(ushort)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(ushort)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(ushort)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (ushort) (float) Math.Sqrt((float) (ushort) (object) x); -#else - return (T) (object) (ushort)(float)MathF.Sqrt((float) (ushort)(object) x); -#endif - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(int)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(int)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(int)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(int)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (int) (float) Math.Sqrt((float) (int) (object) x); -#else - return (T) (object) (int)(float)MathF.Sqrt((float) (int)(object) x); -#endif - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(uint)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(uint)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(uint)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(uint)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (uint) (float) Math.Sqrt((float) (uint) (object) x); -#else - return (T) (object) (uint)(float)MathF.Sqrt((float) (uint)(object) x); -#endif - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(long)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(long)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(long)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(long)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (long) (float) Math.Sqrt((float) (long) (object) x); -#else - return (T) (object) (long)(float)MathF.Sqrt((float) (long)(object) x); -#endif - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - // TODO: vectorized implementation? - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Sqrt((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { -#if SSE - if (Sse.IsSupported) - { - return (T)(object)(ulong)(float)Sse.SqrtScalar(Vector128.CreateScalarUnsafe((float)(ulong)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(ulong)(float)AdvSimd.SqrtScalar(Vector64.CreateScalarUnsafe((float)(ulong)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (ulong) (float) Math.Sqrt((float) (ulong) (object) x); -#else - return (T) (object) (ulong)(float)MathF.Sqrt((float) (ulong)(object) x); -#endif - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the tangent of the specified angle. - /// - /// An angle, measured in radians. - /// The type of . - /// The tangent of . If is equal to , , or , this method returns . - [MethodImpl(MaxOpt)] - public static T Tan(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Tan((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Tan((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Tan((float) (object) x); -#else - return (T) (object) MathF.Tan((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Tan((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Tan((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Tan((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Tan((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Tan((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Tan((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Tan((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Tan((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Tan((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Tan((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the hyperbolic tangent of the specified angle. - /// - /// An angle, measured in radians. - /// The type of . - /// The hyperbolic tangent of . If is equal to , this method returns -1. If is equal to , this method returns 1. If is equal to , this method returns . - [MethodImpl(MaxOpt)] - public static T Tanh(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Tanh((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Tanh((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Tanh((float) (object) x); -#else - return (T) (object) MathF.Tanh((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Tanh((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Tanh((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Tanh((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Tanh((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Tanh((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Tanh((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Tanh((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Tanh((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Tanh((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Tanh((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Calculates the integral part of a specified single-precision floating-point number. - /// - /// A number to truncate. - /// - /// - /// The integral part of ; that is, the number that remains after any fractional digits have been discarded, or one of the values listed in the following table. - /// - /// - /// - /// Return value - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - [MethodImpl(MaxOpt)] - public static T Truncate(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Truncate((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Truncate((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Truncate((float) (object) x); -#else - return (T) (object) MathF.Truncate((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Truncate((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) (decimal) Math.Truncate((decimal) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return x; - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return x; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return x; - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return x; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return x; - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return x; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return x; - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return x; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the natural (base e) logarithm of a specified number. - /// - /// The number whose logarithm is to be found. - /// The type of . - /// - /// One of the values in the following table. - /// - /// - /// parameter - /// Return value - /// - /// - /// Positive - /// The natural logarithm of ; that is, ln , or log e - /// - /// - /// Zero - /// - /// - /// - /// Negative - /// - /// - /// - /// Equal to - /// - /// - /// - /// Equal to - /// - /// - /// - /// - [MethodImpl(MaxOpt)] - public static T Log(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) CoreFastLog((float) (Half) (object) x); - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) CoreFastLog((float) (object) x); - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Log((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Log((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Log((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Log((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Log((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Log((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Log((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Log((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Log((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Log((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the base 10 logarithm of a specified number. - /// - /// The number whose logarithm is to be found. - /// The type of . - /// - /// One of the values in the following table. - /// - /// - /// parameter - /// Return value - /// - /// - /// Positive - /// The base 10 log of ; that is log 10 - /// - /// - /// Zero - /// - /// - /// - /// Negative - /// - /// - /// - /// Equal to - /// - /// - /// - /// Equal to - /// - /// - /// - /// - [MethodImpl(MaxOpt)] - public static T Log10(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Log10((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Log10((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Log10((float) (object) x); -#else - return (T) (object) MathF.Log10((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Log10((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Log10((sbyte) (object) x); - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Log10((byte) (object) x); - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Log10((short) (object) x); - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Log10((ushort) (object) x); - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Log10((int) (object) x); - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Log10((uint) (object) x); - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Log10((long) (object) x); - } - - return Complex(x); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Log10((Complex) (object) x); - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Log10((ulong) (object) x); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Rounds a single-precision floating-point value to the nearest integral value, and rounds midpoint values to the nearest even number. - /// - /// A number to be rounded. - /// The type of . - /// - /// The integer nearest . If the fractional component of is halfway between two integers, one of which is even and the other odd, then the even number is returned. Note that this method returns instead of an integral type - /// - /// - /// This method uses the default rounding convention of . - /// - [MethodImpl(MaxOpt)] - public static T Round(T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Round((float) (Half) (object) x); -#else - return (T) (object) (Half) MathF.Round((float) (Half) (object) x); -#endif - } - - return Float(x); - - [MethodImpl(MaxOpt)] - static T Float(T x) - { - if (typeof(T) == typeof(float)) - { -#if SSE - if (Sse42.IsSupported) - { - return (T)(object)(float)Sse41.RoundToNearestIntegerScalar(Vector128.CreateScalarUnsafe((float)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(float)AdvSimd.RoundToNearestScalar(Vector64.CreateScalar((float)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (float) Math.Round((float) (object) x); -#else - return (T) (object) MathF.Round((float) (object) x); -#endif - } - - return Double(x); - } - - [MethodImpl(MaxOpt)] - static T Double(T x) - { - if (typeof(T) == typeof(double)) - { -#if SSE - if (Sse42.IsSupported) - { - return (T)(object)(double)Sse41.RoundToNearestIntegerScalar(Vector128.CreateScalarUnsafe((double)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - return (T)(object)(double)AdvSimd.RoundToNearestScalar(Vector64.CreateScalar((double)(object)x)).ToScalar(); - } -#endif - return (T) (object) (double) Math.Round((double) (object) x); - } - - return Decimal(x); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) (decimal) Math.Round((decimal) (object) x); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return x; - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return x; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return x; - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return x; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return x; - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return x; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return x; - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return x; - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the remainder resulting from the division of a specified number by another specified number. - /// - /// A dividend. - /// A divisor. - /// The type of and . - /// - /// A number equal to - ( Q), where Q is the quotient of / rounded to the nearest integer (if / falls halfway between two integers, the even integer is returned). - /// - /// If - ( Q) is zero, the value +0 is returned if is positive, or -0 if is negative. - /// - /// If = 0, NaN is returned. - /// - [MethodImpl(MaxOpt)] - public static T IEEERemainder(T x, T y) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.IEEERemainder - ((float) (Half) (object) x, (float) (Half) (object) y); -#else - return (T) (object) (Half) MathF.IEEERemainder((float) (Half) (object) x, (float) (Half) (object) y); -#endif - } - - return Float(x, y); - - [MethodImpl(MaxOpt)] - static T Float(T x, T y) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.IEEERemainder((float) (object) x, (float) (object) y); -#else - return (T) (object) MathF.IEEERemainder((float) (object) x, (float) (object) y); -#endif - } - - return Double(x, y); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, T y) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.IEEERemainder((double) (object) x, (double) (object) y); - } - - return Decimal(x, y); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, T y) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x, y); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x, T y) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.IEEERemainder((sbyte) (object) x, (sbyte) (object) y); - } - - return Byte(x, y); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x, T y) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.IEEERemainder((byte) (object) x, (byte) (object) y); - } - - return Short(x, y); - } - - [MethodImpl(MaxOpt)] - static T Short(T x, T y) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.IEEERemainder((short) (object) x, (short) (object) y); - } - - return UShort(x, y); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x, T y) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.IEEERemainder((ushort) (object) x, (ushort) (object) y); - } - - return Int(x, y); - } - - [MethodImpl(MaxOpt)] - static T Int(T x, T y) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.IEEERemainder((int) (object) x, (int) (object) y); - } - - return UInt(x, y); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x, T y) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.IEEERemainder((uint) (object) x, (uint) (object) y); - } - - return Long(x, y); - } - - [MethodImpl(MaxOpt)] - static T Long(T x, T y) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.IEEERemainder((long) (object) x, (long) (object) y); - } - - return ULong(x, y); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x, T y) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.IEEERemainder((ulong) (object) x, (ulong) (object) y); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the logarithm of a specified number in a specified base. - /// - /// The number whose logarithm is to be found. - /// The base. - /// The type of and . - /// - /// One of the values in the following table. (+Infinity denotes , -Infinity denotes , and NaN denotes .) - /// - /// - /// - /// newBase - /// Return value - /// - /// - /// >0 - /// (0<newBase<1) -or- (newBase>1) - /// lognewBase(a) - /// - /// - /// <0 - /// (any value) - /// NaN - /// - /// - /// (any value) - /// newBase<0 - /// NaN - /// - /// - /// != 1 - /// newBase = 0 - /// NaN - /// - /// - /// != 1 - /// newBase = +Infinity - /// NaN - /// - /// - /// = NaN - /// (any value) - /// NaN - /// - /// - /// (any value) - /// newBase = NaN - /// NaN - /// - /// - /// (any value) - /// newBase = 1 - /// NaN - /// - /// - /// = 0 - /// 0 < newBase < 1 - /// +Infinity - /// - /// - /// = 0 - /// newBase > 1 - /// -Infinity - /// - /// - /// = +Infinity - /// 0 < newBase < 1 - /// -Infinity - /// - /// - /// = +Infinity - /// newBase > 1 - /// +Infinity - /// - /// - /// = 1 - /// newBase = 0 - /// 0 - /// - /// - /// = 1 - /// newBase = +Infinity - /// 0 - /// - /// - /// - [MethodImpl(MaxOpt)] - public static T Log(T x, T y) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Log((float) (Half) (object) x, (float) (Half) (object) y); -#else - return (T) (object) (Half) MathF.Log((float) (Half) (object) x, (float) (Half) (object) y); -#endif - } - - return Float(x, y); - - [MethodImpl(MaxOpt)] - static T Float(T x, T y) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Log((float) (object) x, (float) (object) y); -#else - return (T) (object) MathF.Log((float) (object) x, (float) (object) y); -#endif - } - - return Double(x, y); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, T y) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Log((double) (object) x, (double) (object) y); - } - - return Decimal(x, y); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, T y) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x, y); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x, T y) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Log((sbyte) (object) x, (sbyte) (object) y); - } - - return Byte(x, y); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x, T y) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Log((byte) (object) x, (byte) (object) y); - } - - return Short(x, y); - } - - [MethodImpl(MaxOpt)] - static T Short(T x, T y) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Log((short) (object) x, (short) (object) y); - } - - return UShort(x, y); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x, T y) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Log((ushort) (object) x, (ushort) (object) y); - } - - return Int(x, y); - } - - [MethodImpl(MaxOpt)] - static T Int(T x, T y) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Log((int) (object) x, (int) (object) y); - } - - return UInt(x, y); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x, T y) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Log((uint) (object) x, (uint) (object) y); - } - - return Long(x, y); - } - - [MethodImpl(MaxOpt)] - static T Long(T x, T y) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Log((long) (object) x, (long) (object) y); - } - - return Complex(x, y); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x, T y) - { - if (typeof(T) == typeof(Complex)) - { - // Complex.Log is not defined on two complex numbers - var baseValue = (Complex) (object) y; - if (baseValue.Imaginary is 0) - return (T) (object) (Complex) System.Numerics.Complex.Log((Complex) (object) x, baseValue.Real); - // log(x, y) = log(x) / log(y) - return (T) (object) (System.Numerics.Complex.Log((Complex) (object) x) / System.Numerics.Complex.Log(baseValue)); - } - - return ULong(x, y); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x, T y) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Log((ulong) (object) x, (ulong) (object) y); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the larger of two numbers. - /// - /// The first of two numbers to compare. - /// The second of two numbers to compare. - /// The type of and . - /// Parameter or , whichever is larger. If , or , or both and are equal to , is returned. - [MethodImpl(MaxOpt)] - public static T Max(T x, T y) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Max((float) (Half) (object) x, (float) (Half) (object) y); -#else - return (T) (object) (Half) MathF.Max((float) (Half) (object) x, (float) (Half) (object) y); -#endif - } - - return Float(x, y); - - [MethodImpl(MaxOpt)] - static T Float(T x, T y) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Max((float) (object) x, (float) (object) y); -#else - return (T) (object) MathF.Max((float) (object) x, (float) (object) y); -#endif - } - - return Double(x, y); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, T y) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Max((double) (object) x, (double) (object) y); - } - - return Decimal(x, y); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, T y) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) (decimal) Math.Max((decimal) (object) x, (decimal) (object) y); - } - - return SByte(x, y); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x, T y) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Max((sbyte) (object) x, (sbyte) (object) y); - } - - return Byte(x, y); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x, T y) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Max((byte) (object) x, (byte) (object) y); - } - - return Short(x, y); - } - - [MethodImpl(MaxOpt)] - static T Short(T x, T y) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Max((short) (object) x, (short) (object) y); - } - - return UShort(x, y); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x, T y) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Max((ushort) (object) x, (ushort) (object) y); - } - - return Int(x, y); - } - - [MethodImpl(MaxOpt)] - static T Int(T x, T y) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Max((int) (object) x, (int) (object) y); - } - - return UInt(x, y); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x, T y) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Max((uint) (object) x, (uint) (object) y); - } - - return Long(x, y); - } - - [MethodImpl(MaxOpt)] - static T Long(T x, T y) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Max((long) (object) x, (long) (object) y); - } - - return ULong(x, y); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x, T y) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Max((ulong) (object) x, (ulong) (object) y); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the smaller of two numbers. - /// - /// The first of two numbers to compare. - /// The second of two numbers to compare. - /// The type of and . - /// Parameter or , whichever is smaller. If , or , or both and are equal to , is returned. - [MethodImpl(MaxOpt)] - public static T Min(T x, T y) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Min((float) (Half) (object) x, (float) (Half) (object) y); -#else - return (T) (object) (Half) MathF.Min((float) (Half) (object) x, (float) (Half) (object) y); -#endif - } - - return Float(x, y); - - [MethodImpl(MaxOpt)] - static T Float(T x, T y) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Min((float) (object) x, (float) (object) y); -#else - return (T) (object) MathF.Min((float) (object) x, (float) (object) y); -#endif - } - - return Double(x, y); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, T y) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Min((double) (object) x, (double) (object) y); - } - - return Decimal(x, y); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, T y) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) (decimal) Math.Min((decimal) (object) x, (decimal) (object) y); - } - - return SByte(x, y); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x, T y) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Min((sbyte) (object) x, (sbyte) (object) y); - } - - return Byte(x, y); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x, T y) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Min((byte) (object) x, (byte) (object) y); - } - - return Short(x, y); - } - - [MethodImpl(MaxOpt)] - static T Short(T x, T y) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Min((short) (object) x, (short) (object) y); - } - - return UShort(x, y); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x, T y) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Min((ushort) (object) x, (ushort) (object) y); - } - - return Int(x, y); - } - - [MethodImpl(MaxOpt)] - static T Int(T x, T y) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Min((int) (object) x, (int) (object) y); - } - - return UInt(x, y); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x, T y) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Min((uint) (object) x, (uint) (object) y); - } - - return Long(x, y); - } - - [MethodImpl(MaxOpt)] - static T Long(T x, T y) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Min((long) (object) x, (long) (object) y); - } - - return ULong(x, y); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x, T y) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Min((ulong) (object) x, (ulong) (object) y); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns a specified number raised to the specified power. - /// - /// A number to be raised to a power. - /// A number that specifies a power. - /// The type of and . - /// The number raised to the power . - /// - /// , , and . - /// - /// |Parameters|Return value| - /// |----------------|------------------| - /// |`x` or `y` = `NaN`.|`NaN`| - /// |`x` = Any value except `NaN`; `y` = 0.|1| - /// |`x` = `NegativeInfinity`; `y` < 0.|0| - /// |`x` = `NegativeInfinity`; `y` is a positive odd integer.|`NegativeInfinity`| - /// |`x` = `NegativeInfinity`; `y` is positive but not an odd integer.|`PositiveInfinity`| - /// |`x` < 0 but not `NegativeInfinity`; `y` is not an integer, `NegativeInfinity`, or `PositiveInfinity`.|`NaN`| - /// |`x` = -1; `y` = `NegativeInfinity` or `PositiveInfinity`.|`NaN`| - /// |-1 < `x` < 1; `y` = `NegativeInfinity`.|`PositiveInfinity`| - /// |-1 < `x` < 1; `y` = `PositiveInfinity`.|0| - /// |`x` < -1 or `x` > 1; `y` = `NegativeInfinity`.|0| - /// |`x` < -1 or `x` > 1; `y` = `PositiveInfinity`.|`PositiveInfinity`| - /// |`x` = 0; `y` < 0.|`PositiveInfinity`| - /// |`x` = 0; `y` > 0.|0| - /// |`x` = 1; `y` is any value except `NaN`.|1| - /// |`x` = `PositiveInfinity`; `y` < 0.|0| - /// |`x` = `PositiveInfinity`; `y` > 0.|`PositiveInfinity`| - /// - /// ]]> - /// - [MethodImpl(MaxOpt)] - public static T Pow(T x, T y) where T : notnull - { - if (typeof(T) == typeof(Half)) - { - return (T) (object) (Half) CoreFastPow((float) (Half) (object) x, (float) (Half) (object) y); - } - - return Float(x, y); - - [MethodImpl(MaxOpt)] - static T Float(T x, T y) - { - if (typeof(T) == typeof(float)) - { - return (T) (object) CoreFastPow((float) (object) x, (float) (object) y); - } - - return Double(x, y); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, T y) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Pow((double) (object) x, (double) (object) y); - } - - return Decimal(x, y); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, T y) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x, y); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x, T y) - { - if (typeof(T) == typeof(sbyte)) - { - var py = (sbyte) (object) y; - var px = (sbyte) (object) x; - if (py != 0) - { - var oabsy = Abs(py); - var absy = oabsy; - sbyte result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - if (oabsy == py) - return (T) (object) result; - return (T) (object) (sbyte) Scalar.Reciprocal(result); - } - else - { - if (px != 0) return (T) (object) (sbyte) 1; - else return (T) (object) (sbyte) 0; - } - } - - return Byte(x, y); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x, T y) - { - if (typeof(T) == typeof(byte)) - { - var py = (byte) (object) y; - var px = (byte) (object) x; - if (py != 0) - { - var oabsy = py; - var absy = oabsy; - byte result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - return (T) (object) result; - } - else - { - if (px != 0) return (T) (object) (byte) 1; - else return (T) (object) (byte) 0; - } - } - - return Short(x, y); - } - - [MethodImpl(MaxOpt)] - static T Short(T x, T y) - { - if (typeof(T) == typeof(short)) - { - var py = (short) (object) y; - var px = (short) (object) x; - if (py != 0) - { - var oabsy = Abs(py); - var absy = oabsy; - short result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - if (oabsy == py) - return (T) (object) result; - return (T) (object) (short) Scalar.Reciprocal(result); - } - else - { - if (px != 0) return (T) (object) (short) 1; - else return (T) (object) (short) 0; - } - } - - return UShort(x, y); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x, T y) - { - if (typeof(T) == typeof(ushort)) - { - var py = (ushort) (object) y; - var px = (ushort) (object) x; - if (py != 0) - { - var oabsy = py; - var absy = oabsy; - ushort result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - return (T) (object) result; - } - else - { - if (px != 0) return (T) (object) (ushort) 1; - else return (T) (object) (ushort) 0; - } - } - - return Int(x, y); - } - - [MethodImpl(MaxOpt)] - static T Int(T x, T y) - { - if (typeof(T) == typeof(int)) - { - var py = (int) (object) y; - var px = (int) (object) x; - if (py != 0) - { - var oabsy = Abs(py); - var absy = oabsy; - int result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - if (oabsy == py) - return (T) (object) result; - return (T) (object) (int) Scalar.Reciprocal(result); - } - else - { - if (px != 0) return (T) (object) (int) 1; - else return (T) (object) (int) 0; - } - } - - return UInt(x, y); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x, T y) - { - if (typeof(T) == typeof(uint)) - { - var py = (uint) (object) y; - var px = (uint) (object) x; - if (py != 0) - { - var oabsy = py; - var absy = oabsy; - uint result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - return (T) (object) result; - } - else - { - if (px != 0) return (T) (object) (uint) 1; - else return (T) (object) (uint) 0; - } - } - - return Long(x, y); - } - - [MethodImpl(MaxOpt)] - static T Long(T x, T y) - { - if (typeof(T) == typeof(long)) - { - var py = (long) (object) y; - var px = (long) (object) x; - if (py != 0) - { - var oabsy = Abs(py); - var absy = oabsy; - long result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - if (oabsy == py) - return (T) (object) result; - return (T) (object) (long) Scalar.Reciprocal(result); - } - else - { - if (px != 0) return (T) (object) (long) 1; - else return (T) (object) (long) 0; - } - } - - return Complex(x, y); - } - - [MethodImpl(MaxOpt)] - static T Complex(T x, T y) - { - if (typeof(T) == typeof(Complex)) - { - return (T) (object) (Complex) System.Numerics.Complex.Pow((Complex) (object) x, (Complex) (object) y); - } - - return ULong(x, y); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x, T y) - { - if (typeof(T) == typeof(ulong)) - { - var py = (ulong) (object) y; - var px = (ulong) (object) x; - if (py != 0) - { - var oabsy = py; - var absy = oabsy; - ulong result = 1; - while (true) - { - if ((absy & 1) != 0) - result *= px; - absy >>= 1; - if (absy == 0) - break; - px *= px; - } - - return (T) (object) result; - } - else - { - if (px != 0) return (T) (object) (ulong) 1; - else return (T) (object) (ulong) 0; - } - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Returns the angle whose tangent is the quotient of two specified numbers. - /// - /// The y coordinate of a point. - /// The x coordinate of a point. - /// The type of and . - /// - /// An angle, θ, measured in radians, such that -π ≤ θ ≤ π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. Observe the following: - /// - /// For (, ) in quadrant 1, 0 < θ < π/2. - /// For (, ) in quadrant 2, π/2 < θ ≤ π. - /// For (, ) in quadrant 3, -π < θ < -π/2. - /// For (, ) in quadrant 4, -π/2 < θ < 0. - /// - /// - /// If y is 0 and x is not negative, θ = 0. - /// If y is 0 and x is negative, θ = π. - /// If y is positive and x is 0, θ = π/2. - /// If y is 0 and x is 0, θ = -π/2. - /// - /// If or is , or if and are either or , the method returns . - /// - /// - /// The return value is the angle in the Cartesian plane formed by the x-axis, and a vector starting from the origin, (0,0), and terminating at the point, (x,y). - /// - [MethodImpl(MaxOpt)] - public static T Atan2(T y, T x) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Atan2((float) (Half) (object) x, (float) (Half) (object) y); -#else - return (T) (object) (Half) MathF.Atan2((float) (Half) (object) x, (float) (Half) (object) y); -#endif - } - - return Float(x, y); - - [MethodImpl(MaxOpt)] - static T Float(T x, T y) - { - if (typeof(T) == typeof(float)) - { -#if !MATHF - return (T) (object) (float) Math.Atan2((float) (object) x, (float) (object) y); -#else - return (T) (object) MathF.Atan2((float) (object) x, (float) (object) y); -#endif - } - - return Double(x, y); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, T y) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) Math.Atan2((double) (object) x, (double) (object) y); - } - - return Decimal(x, y); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, T y) - { - if (typeof(T) == typeof(decimal)) - { - ThrowOpUnsupportedPrecision(); - return default; - } - - return SByte(x, y); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x, T y) - { - if (typeof(T) == typeof(sbyte)) - { - return (T) (object) (sbyte) Math.Atan2((sbyte) (object) x, (sbyte) (object) y); - } - - return Byte(x, y); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x, T y) - { - if (typeof(T) == typeof(byte)) - { - return (T) (object) (byte) Math.Atan2((byte) (object) x, (byte) (object) y); - } - - return Short(x, y); - } - - [MethodImpl(MaxOpt)] - static T Short(T x, T y) - { - if (typeof(T) == typeof(short)) - { - return (T) (object) (short) Math.Atan2((short) (object) x, (short) (object) y); - } - - return UShort(x, y); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x, T y) - { - if (typeof(T) == typeof(ushort)) - { - return (T) (object) (ushort) Math.Atan2((ushort) (object) x, (ushort) (object) y); - } - - return Int(x, y); - } - - [MethodImpl(MaxOpt)] - static T Int(T x, T y) - { - if (typeof(T) == typeof(int)) - { - return (T) (object) (int) Math.Atan2((int) (object) x, (int) (object) y); - } - - return UInt(x, y); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x, T y) - { - if (typeof(T) == typeof(uint)) - { - return (T) (object) (uint) Math.Atan2((uint) (object) x, (uint) (object) y); - } - - return Long(x, y); - } - - [MethodImpl(MaxOpt)] - static T Long(T x, T y) - { - if (typeof(T) == typeof(long)) - { - return (T) (object) (long) Math.Atan2((long) (object) x, (long) (object) y); - } - - return ULong(x, y); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x, T y) - { - if (typeof(T) == typeof(ulong)) - { - return (T) (object) (ulong) Math.Atan2((ulong) (object) x, (ulong) (object) y); - } - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Rounds a single-precision floating-point value to a specified number of fractional digits, and rounds midpoint values to the nearest even number. - /// - /// A number to be rounded. - /// The number of fractional digits in the return value. - /// The type of . - /// The number nearest to that contains a number of fractional digits equal to digits. - /// is less than 0 or greater than the maximum number of integral and fractional digits supported by the type. - /// - /// This method uses the default rounding convention of - /// If the value of is , the method returns . - /// If is or , the method returns or , respectively. - /// - [MethodImpl(MaxOpt)] - public static T Round(T x, int digits) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if MATHF - return (T) (object) (Half) (float) MathF.Round((float)(Half) (object) x, digits); -#else - return (T) (object) (Half) (float) Math.Round((float) (Half) (object) x, digits); -#endif - } - - return Float(x, digits); - - [MethodImpl(MaxOpt)] - static T Float(T x, int digits) - { - if (typeof(T) == typeof(float)) - { -#if MATHF - return (T) (object) (float) MathF.Round((float)(object) x, digits); -#else - return (T) (object) (float) Math.Round((float) (object) x, digits); -#endif - } - - return Double(x, digits); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, int digits) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Round((double) (object) x, digits); - } - - return Decimal(x, digits); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, int digits) - { - if (typeof(T) == typeof(decimal)) - ThrowOpUnsupportedPrecision(); - - return Other(x, digits); - } - - [MethodImpl(MaxOpt)] - static T Other(T x, int digits) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - ) - return x; - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Rounds a single-precision floating-point value to a specified number of fractional digits, and uses the specified rounding convention for midpoint values. - /// - /// A number to be rounded. - /// The number of fractional digits in the return value. - /// Specification for how to round if it is midway between two other numbers. - /// The type of . - /// The number nearest to that contains a number of fractional digits equal to digits. If has fewer fractional digits than , is returned unchanged. - /// is less than 0 or greater than the maximum number of integral and fractional digits supported by the type. - /// - /// If the value of is , the method returns . - /// If is or , the method returns or , respectively. - /// - [MethodImpl(MaxOpt)] - public static T Round(T x, int digits, System.MidpointRounding mode) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if MATHF - return (T) (object) (Half) (float) MathF.Round((float)(Half) (object) x, digits, mode); -#else - return (T) (object) (Half) (float) Math.Round((float) (Half) (object) x, digits, mode); -#endif - } - - return Float(x, digits, mode); - - [MethodImpl(MaxOpt)] - static T Float(T x, int digits, MidpointRounding mode) - { - if (typeof(T) == typeof(float)) - { -#if MATHF - return (T) (object) (float) MathF.Round((float)(object) x, digits, mode); -#else - return (T) (object) (float) Math.Round((float) (object) x, digits, mode); -#endif - } - - return Double(x, digits, mode); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, int digits, MidpointRounding mode) - { - if (typeof(T) == typeof(double)) - { - return (T) (object) (double) Math.Round((double) (object) x, digits, mode); - } - - return Decimal(x, digits, mode); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, int digits, MidpointRounding mode) - { - if (typeof(T) == typeof(decimal)) - ThrowOpUnsupportedPrecision(); - - return Other(x, digits, mode); - } - - [MethodImpl(MaxOpt)] - static T Other(T x, int digits, MidpointRounding mode) - { - if (typeof(T) == typeof(sbyte) - || typeof(T) == typeof(byte) - || typeof(T) == typeof(ushort) - || typeof(T) == typeof(short) - || typeof(T) == typeof(uint) - || typeof(T) == typeof(int) - || typeof(T) == typeof(ulong) - || typeof(T) == typeof(long) - - ) - return x; - - ThrowUnsupportedType(); - return default; - } - } - - /// - /// Rounds a single-precision floating-point value to the nearest integer, and uses the specified rounding convention for midpoint values. - /// - /// A single-precision floating-point number to be rounded. - /// Specification for how to round x if it is midway between two other numbers. - /// The type of . - /// The integer nearest . If is halfway between two integers, one of which is even and the other odd, then mode determines which of the two is returned. Note that this method returns instead of an integral type. - /// is not a valid value of . - /// - /// If the value of is , the method returns . - /// If is or , the method returns or , respectively. - /// \ - [MethodImpl(MaxOpt)] - public static T Round(T x, System.MidpointRounding mode) where T : notnull - { - if (typeof(T) == typeof(Half)) - { -#if !MATHF - return (T) (object) (Half) (float) Math.Round((float) (Half) (object) x, mode); -#else - return (T) (object) (Half) MathF.Round((float) (Half) (object) x, mode); -#endif - } - - return Float(x, mode); - - [MethodImpl(MaxOpt)] - static T Float(T x, MidpointRounding mode) - { - if (typeof(T) == typeof(float)) - { -#if SSE - if (Sse42.IsSupported) - { - if (mode == MidpointRounding.ToZero) - return (T)(object)(float)Sse41.RoundToZeroScalar(Vector128.CreateScalarUnsafe((float)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToPositiveInfinity) - return (T)(object)(float)Sse41.RoundToPositiveInfinityScalar(Vector128.CreateScalarUnsafe((float)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToNegativeInfinity) - return (T)(object)(float)Sse41.RoundToNegativeInfinityScalar(Vector128.CreateScalarUnsafe((float)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToEven) - return (T)(object)(float)Sse41.RoundToNearestIntegerScalar(Vector128.CreateScalarUnsafe((float)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - if (mode == MidpointRounding.ToZero) - return (T)(object)(float)AdvSimd.RoundToZeroScalar(Vector64.CreateScalarUnsafe((float)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToPositiveInfinity) - return (T)(object)(float)AdvSimd.RoundToPositiveInfinityScalar(Vector64.CreateScalarUnsafe((float)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToNegativeInfinity) - return (T)(object)(float)AdvSimd.RoundToNegativeInfinityScalar(Vector64.CreateScalarUnsafe((float)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToEven) - return (T)(object)(float)AdvSimd.RoundToNearestScalar(Vector64.CreateScalarUnsafe((float)(object)x)).ToScalar(); - } -#endif -#if !MATHF - return (T) (object) (float) Math.Round((float) (object) x, mode); -#else - return (T) (object) MathF.Round((float) (object) x, mode); -#endif - } - - return Double(x, mode); - } - - [MethodImpl(MaxOpt)] - static T Double(T x, MidpointRounding mode) - { - if (typeof(T) == typeof(double)) - { -#if SSE - if (Sse42.IsSupported) - { - if (mode == MidpointRounding.ToZero) - return (T)(object)(double)Sse41.RoundToZeroScalar(Vector128.CreateScalarUnsafe((double)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToPositiveInfinity) - return (T)(object)(double)Sse41.RoundToPositiveInfinityScalar(Vector128.CreateScalarUnsafe((double)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToNegativeInfinity) - return (T)(object)(double)Sse41.RoundToNegativeInfinityScalar(Vector128.CreateScalarUnsafe((double)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToEven) - return (T)(object)(double)Sse41.RoundToNearestIntegerScalar(Vector128.CreateScalarUnsafe((double)(object)x)).ToScalar(); - } -#endif -#if AdvSIMD - if (AdvSimd.IsSupported) - { - if (mode == MidpointRounding.ToZero) - return (T)(object)(double)AdvSimd.RoundToZeroScalar(Vector64.CreateScalar((double)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToPositiveInfinity) - return (T)(object)(double)AdvSimd.RoundToPositiveInfinityScalar(Vector64.CreateScalar((double)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToNegativeInfinity) - return (T)(object)(double)AdvSimd.RoundToNegativeInfinityScalar(Vector64.CreateScalar((double)(object)x)).ToScalar(); - - if (mode == MidpointRounding.ToEven) - return (T)(object)(double)AdvSimd.RoundToNearestScalar(Vector64.CreateScalar((double)(object)x)).ToScalar(); - } -#endif - return (T) (object) (double) Math.Round((double) (object) x, mode); - } - - return Decimal(x, mode); - } - - [MethodImpl(MaxOpt)] - static T Decimal(T x, MidpointRounding mode) - { - if (typeof(T) == typeof(decimal)) - { - return (T) (object) (decimal) Math.Round((decimal) (object) x, mode); - } - - return SByte(x); - } - - [MethodImpl(MaxOpt)] - static T SByte(T x) - { - if (typeof(T) == typeof(sbyte)) - { - return x; - } - - return Byte(x); - } - - [MethodImpl(MaxOpt)] - static T Byte(T x) - { - if (typeof(T) == typeof(byte)) - { - return x; - } - - return Short(x); - } - - [MethodImpl(MaxOpt)] - static T Short(T x) - { - if (typeof(T) == typeof(short)) - { - return x; - } - - return UShort(x); - } - - [MethodImpl(MaxOpt)] - static T UShort(T x) - { - if (typeof(T) == typeof(ushort)) - { - return x; - } - - return Int(x); - } - - [MethodImpl(MaxOpt)] - static T Int(T x) - { - if (typeof(T) == typeof(int)) - { - return x; - } - - return UInt(x); - } - - [MethodImpl(MaxOpt)] - static T UInt(T x) - { - if (typeof(T) == typeof(uint)) - { - return x; - } - - return Long(x); - } - - [MethodImpl(MaxOpt)] - static T Long(T x) - { - if (typeof(T) == typeof(long)) - { - return x; - } - - return ULong(x); - } - - [MethodImpl(MaxOpt)] - static T ULong(T x) - { - if (typeof(T) == typeof(ulong)) - { - return x; - } - - ThrowUnsupportedType(); - return default; - } - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Pow.cs b/sources/Maths/Maths/Scalar.Pow.cs deleted file mode 100644 index 083f16441b..0000000000 --- a/sources/Maths/Maths/Scalar.Pow.cs +++ /dev/null @@ -1,19 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - public static partial class Scalar - { - [MethodImpl(MaxOpt)] - private static float CoreFastPow(float x, float y) - { - // improvements can be made here, namely by actually porting a full impl - // see https://github.com/amd/aocl-libm-ose/blob/master/src/optmized/powf.c - - return Exp(y * Log(x)); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Scalar.Sin.cs b/sources/Maths/Maths/Scalar.Sin.cs deleted file mode 100644 index 8a2daffb3b..0000000000 --- a/sources/Maths/Maths/Scalar.Sin.cs +++ /dev/null @@ -1,476 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - static partial class Scalar - { - // - // See https://gist.github.com/tannergooding/103be726d48dc3d0b09e890bad0b892f - // - // This is a port of the amd/win-libm implementation provided in assembly here: https://github.com/amd/win-libm/blob/master/sinf.asm - // The original source is Copyright (c) 2002-2019 Advanced Micro Devices, Inc. and provided under the MIT License. - // - // Permission is hereby granted, free of charge, to any person obtaining a copy - // of this Software and associated documentaon files (the "Software"), to deal - // in the Software without restriction, including without limitation the rights - // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - // copies of the Software, and to permit persons to whom the Software is - // furnished to do so, subject to the following conditions: - // - // The above copyright notice and this permission notice shall be included in - // all copies or substantial portions of the Software. - // - // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - // THE SOFTWARE. - - private static readonly long[] _piBits = - { - 0, - 5215, - 13000023176, - 11362338026, - 67174558139, - 34819822259, - 10612056195, - 67816420731, - 57840157550, - 19558516809, - 50025467026, - 25186875954, - 18152700886 - }; - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static long GetPiBits(int index) - { - switch (index) - { - case 0: - return 0; - case 1: - return 5215; - case 2: - return 13000023176; - case 3: - return 11362338026; - case 4: - return 67174558139; - case 5: - return 34819822259; - case 6: - return 10612056195; - case 7: - return 67816420731; - case 8: - return 57840157550; - case 9: - return 19558516809; - case 10: - return 50025467026; - case 11: - return 25186875954; - case 12: - return 18152700886; - default: - ThrowIndexOutOfRange(); - return default; - } - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - internal static float Sin_Ported(float x) - { - const double PiOverTwo = 1.5707963267948966; - const double PiOverTwoPartOne = 1.5707963267341256; - const double PiOverTwoPartOneTail = 6.077100506506192E-11; - const double PiOverTwoPartTwo = 6.077100506303966E-11; - const double PiOverTwoPartTwoTail = 2.0222662487959506E-21; - const double PiOverFour = 0.7853981633974483; - const double TwoOverPi = 0.6366197723675814; - const double TwoPowNegSeven = 0.0078125; - const double TwoPowNegThirteen = 0.0001220703125; - const double C0 = -1.0 / 2.0; // 1 / 2! - const double C1 = +1.0 / 24.0; // 1 / 4! - const double C2 = -1.0 / 720.0; // 1 / 6! - const double C3 = +1.0 / 40320.0; // 1 / 8! - const double C4 = -1.0 / 3628800.0; // 1 / 10! - const double S1 = -1.0 / 6.0; // 1 / 3! - const double S2 = +1.0 / 120.0; // 1 / 5! - const double S3 = -1.0 / 5040.0; // 1 / 7! - const double S4 = +1.0 / 362880.0; // 1 / 9! - - - if (CoreIsFinite(x)) - { - double ax = Math.Abs(x); - - double result; - if (ax <= PiOverFour) - { - if (ax >= TwoPowNegSeven) - { - result = SinTaylorSeriesFourIterations(x); - } - else if (ax >= TwoPowNegThirteen) - { - result = SinTaylorSeriesOneIteration(x); - } - else - { - result = x; - } - } - else - { - var wasNegative = 0; - - if (CoreIsNegative(x)) - { - x = -x; - wasNegative = 1; - } - - int region; - - if (x < 16000000.0) - { - // Reduce x to be in the range of -(PI / 4) to (PI / 4), inclusive - - // This is done by subtracting multiples of (PI / 2). Double-precision - // isn't quite accurate enough and introduces some error, but we account - // for that using a tail value that helps account for this. - - var axExp = BitConverter.DoubleToInt64Bits(ax) >> 52; - - region = (int) (x * TwoOverPi + 0.5); - double piOverTwoCount = region; - - var rHead = x - (piOverTwoCount * PiOverTwoPartOne); - var rTail = (piOverTwoCount * PiOverTwoPartOneTail); - - var r = rHead - rTail; - var rExp = (BitConverter.DoubleToInt64Bits(r) << 1) >> 53; - - if ((axExp - rExp) > 15) - { - // The remainder is pretty small compared with x, which implies that x is - // near a multiple of (PI / 2). That is, x matches the multiple to at least - // 15 bits and so we perform an additional fixup to account for any error - - r = rHead; - - rTail = (piOverTwoCount * PiOverTwoPartTwo); - rHead = r - rTail; - rTail = (piOverTwoCount * PiOverTwoPartTwoTail) - ((r - rHead) - rTail); - - r = rHead - rTail; - } - - if (rExp >= 0x3F2) // r >= 2^-13 - { - result = (region & 1) == 0 - ? SinTaylorSeriesFourIterations(r) // region 0 or 2 - : CosTaylorSeriesFourIterations(r); // region 1 or 3 - } - else if (rExp > 0x3DE) // r > 1.1641532182693481E-10 - { - result = (region & 1) == 0 - ? SinTaylorSeriesOneIteration(r) // region 0 or 2 - : CosTaylorSeriesOneIteration(r); // region 1 or 3 - } - else - { - if ((region & 1) == 0) // region 0 or 2 - { - result = r; - } - else // region 1 or 3 - { - result = 1; - } - } - } - else - { - var r = ReduceForLargeInput(x, out region); - - result = (region & 1) == 0 - ? SinTaylorSeriesFourIterations(r) // region 0 or 2 - : CosTaylorSeriesFourIterations(r);// region 1 or 3 - } - - region >>= 1; - - var tmp1 = region & wasNegative; - - region = ~region; - wasNegative = ~wasNegative; - - var tmp2 = region & wasNegative; - - if (((tmp1 | tmp2) & 1) == 0) - { - // If the original region was 0/1 and arg is negative, then we negate the result. - // -or- - // If the original region was 2/3 and arg is positive, then we negate the result. - - result = -result; - } - } - - return (float) result; - } - - // modified to raise NaN on infinite - return float.NaN; - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - static double CosTaylorSeriesOneIteration(double x1) - { - // 1 - (x^2 / 2!) - var x2 = x1 * x1; - return 1.0 + (x2 * C1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - static double CosTaylorSeriesFourIterations(double x1) - { - // 1 - (x^2 / 2!) + (x^4 / 4!) - (x^6 / 6!) + (x^8 / 8!) - (x^10 / 10!) - - var x2 = x1 * x1; - var x4 = x2 * x2; - - return 1.0 + (x2 * C0) + (x4 * ((C1 + (x2 * C2)) + (x4 * (C3 + (x2 * C4))))); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - static unsafe double ReduceForLargeInput(double x, out int region) - { - Debug.Assert(!CoreIsNegative(x)); - - // This method simulates multi-precision floating-point - // arithmetic and is accurate for all 1 <= x < infinity - - const int bitsPerIteration = 36; - var ux = BitConverter.DoubleToInt64Bits(x); - - var xExp = (int) (((ux & 0x7FF0000000000000) >> 52) - 1023); - ux = ((ux & 0x000FFFFFFFFFFFFF) | 0x0010000000000000) >> 29; - - // Now ux is the mantissa bit pattern of x as a long integer - long mask = 1; - mask = (mask << bitsPerIteration) - 1; - - // Set first and last to the positions of the first and last chunks of (2 / PI) that we need - var first = xExp / bitsPerIteration; - var resultExp = xExp - (first * bitsPerIteration); - - // 120 is the theoretical maximum number of bits (actually - // 115 for IEEE single precision) that we need to extract - // from the middle of (2 / PI) to compute the reduced argument - // accurately enough for our purposes - - var last = first + (120 / bitsPerIteration); - - // Unroll the loop. This is only correct because we know that bitsper is fixed as 36. - - var result = stackalloc long[10]; - - result[4] = 0; - var u = _piBits[last] * ux; - - result[3] = u & mask; - var carry = u >> bitsPerIteration; - u = _piBits[last - 1] * ux + carry; - - result[2] = u & mask; - carry = u >> bitsPerIteration; - u = _piBits[last - 2] * ux + carry; - - result[1] = u & mask; - carry = u >> bitsPerIteration; - u = _piBits[first] * ux + carry; - - result[0] = u & mask; - - // Reconstruct the result - var ltb = (int) ((((result[0] << bitsPerIteration) | result[1]) >> (bitsPerIteration - 1 - resultExp)) & - 7); - - long mantissa; - long nextBits; - - // determ says whether the fractional part is >= 0.5 - var determ = (ltb & 1) != 0; - - var i = 1; - - if (determ) - { - // The mantissa is >= 0.5. We want to subtract it from 1.0 by negating all the bits - region = ((ltb >> 1) + 1) & 3; - - mantissa = 1; - mantissa = ~(result[1]) & ((mantissa << (bitsPerIteration - resultExp)) - 1); - - while (mantissa < 0x0000000000010000) - { - i++; - mantissa = (mantissa << bitsPerIteration) | (~(result[i]) & mask); - } - - nextBits = (~(result[i + 1]) & mask); - } - else - { - region = (ltb >> 1); - - mantissa = 1; - mantissa = result[1] & ((mantissa << (bitsPerIteration - resultExp)) - 1); - - while (mantissa < 0x0000000000010000) - { - i++; - mantissa = (mantissa << bitsPerIteration) | result[i]; - } - - nextBits = result[i + 1]; - } - - // Normalize the mantissa. - // The shift value 6 here, determined by trial and error, seems to give optimal speed. - - var bc = 0; - - while (mantissa < 0x0000400000000000) - { - bc += 6; - mantissa <<= 6; - } - - while (mantissa < 0x0010000000000000) - { - bc++; - mantissa <<= 1; - } - - mantissa |= nextBits >> (bitsPerIteration - bc); - - var rExp = 52 + resultExp - bc - i * bitsPerIteration; - - // Put the result exponent rexp onto the mantissa pattern - u = (rExp + 1023L) << 52; - ux = (mantissa & 0x000FFFFFFFFFFFFF) | u; - - if (determ) - { - // If we negated the mantissa we negate x too - ux |= unchecked((long) (0x8000000000000000)); - } - - x = BitConverter.Int64BitsToDouble(ux); - - // x is a double precision version of the fractional part of - // (x * (2 / PI)). Multiply x by (PI / 2) in double precision - // to get the reduced result. - - return x * PiOverTwo; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - static double SinTaylorSeriesOneIteration(double x1) - { - // x - (x^3 / 3!) - - var x2 = x1 * x1; - var x3 = x2 * x1; - - return x1 + (x3 * S1); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - static double SinTaylorSeriesFourIterations(double x1) - { - // x - (x^3 / 3!) + (x^5 / 5!) - (x^7 / 7!) + (x^9 / 9!) - - var x2 = x1 * x1; - var x3 = x2 * x1; - var x4 = x2 * x2; - - return x1 + ((S1 + (x2 * S2) + (x4 * (S3 + (x2 * S4)))) * x3); - } - } - -#if NET5_0 - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsNegative(double d) => BitConverter.DoubleToInt64Bits(d) < 0; - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static unsafe bool CoreIsNegative(float f) => *(int*) &f < 0; - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static unsafe bool CoreIsFinite(float f) => (*(int*) &f & 0x7FFFFFFF) < 0x7F800000; - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static unsafe bool CoreIsSubnormal(float f) - { - var bits = *(int*) &f; - bits &= 0x7FFFFFFF; - return (bits < 0x7F800000) && (bits != 0) && ((bits & 0x7F800000) == 0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsSubnormal(double f) - { - var bits = BitConverter.DoubleToInt64Bits(f); - bits &= 0x7FFFFFFFFFFFFFFF; - return (bits < 0x7FF0000000000000) && (bits != 0) && ((bits & 0x7FF0000000000000) == 0); - } -#else - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsNegative(double d) => BitConverter.DoubleToInt64Bits(d) < 0; - - // ripped straight from BitConverter on > NetStandard2.1. - // in fact, everything below is ripped from methods on NetStandard2.1, but which aren't available on NetStandard2.0 - private static unsafe int SingleToInt(float f) - { - return *((int*) &f); - } - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsNegative(float f) - { - // FUCK I HATE NETSTANDARD - return SingleToInt(f) < 0; - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsFinite(float f) => ((SingleToInt(f)) & 0x7FFFFFFF) < 0x7F800000; - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsSubnormal(float f) - { - var bits = SingleToInt(f); - bits &= 0x7FFFFFFF; - return (bits < 0x7F800000) && (bits != 0) && ((bits & 0x7F800000) == 0); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining | (MethodImplOptions) 512)] - private static bool CoreIsSubnormal(double f) - { - long bits = BitConverter.DoubleToInt64Bits(f); - bits &= 0x7FFFFFFFFFFFFFFF; - return (bits < 0x7FF0000000000000) && (bits != 0) && ((bits & 0x7FF0000000000000) == 0); - } -#endif - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Silk.NET.Maths.csproj b/sources/Maths/Maths/Silk.NET.Maths.csproj index b418b557e1..4aabf2ef39 100644 --- a/sources/Maths/Maths/Silk.NET.Maths.csproj +++ b/sources/Maths/Maths/Silk.NET.Maths.csproj @@ -11,21 +11,6 @@ true - - - True - True - Scalar.As.tt - - - - - - TextTemplatingFileGenerator - Scalar.As.cs - - - true diff --git a/sources/Maths/Maths/Sphere.cs b/sources/Maths/Maths/Sphere.cs index 5985308774..d7f576e2e9 100644 --- a/sources/Maths/Maths/Sphere.cs +++ b/sources/Maths/Maths/Sphere.cs @@ -2,6 +2,7 @@ // The .NET Foundation licenses this file to you under the MIT license. using System; +using System.Numerics; using System.Runtime.Serialization; namespace Silk.NET.Maths @@ -12,13 +13,15 @@ namespace Silk.NET.Maths [Serializable] [DataContract] public struct Sphere - : IEquatable> where T : unmanaged, IFormattable, IEquatable, IComparable + : IEquatable> + where T : IRootFunctions { /// /// The center. /// [DataMember] public Vector3D Center; + /// /// The radius. /// @@ -52,38 +55,13 @@ public Sphere(T centerX, T centerY, T centerZ, T radius) /// The diameter. /// [IgnoreDataMember] - public T Diameter => Scalar.Multiply(Radius, Scalar.Two); + public T Diameter => Radius * T.CreateTruncating(2); /// /// The radius squared. /// [IgnoreDataMember] - public T SquaredRadius => Scalar.Multiply(Radius, Radius); - - - /// - /// Calculates whether this sphere contains a point. - /// - /// The point. - /// True if this sphere contains the point; False otherwise. - /// This does consider a point on the edge contained. - public bool Contains(Vector3D point) - { - return Scalar.LessThanOrEqual(Vector3D.DistanceSquared(point, Center), Radius); - } - - /// - /// Calculates whether this sphere contains another sphere - /// - /// The sphere. - /// True if this sphere contains the given sphere; False otherwise. - /// This does consider a sphere that touches the edge contained. - public bool Contains(Sphere other) - { - var distanceSquared = Vector3D.DistanceSquared(Center, other.Center); - var radiusDiff = Scalar.Subtract(Radius, other.Radius); - return Scalar.LessThanOrEqual(distanceSquared, Scalar.Multiply(radiusDiff, radiusDiff)); - } + public T SquaredRadius => Radius * Radius; /// /// Calculates the squared distance to the nearest edge from the point. @@ -92,7 +70,7 @@ public bool Contains(Sphere other) /// The distance squared. public T GetDistanceToNearestEdgeSquared(Vector3D point) { - return Scalar.Subtract(Vector3D.DistanceSquared(Center, point), SquaredRadius); + return Vector3D.DistanceSquared(Center, point) - SquaredRadius; } /// @@ -100,7 +78,7 @@ public T GetDistanceToNearestEdgeSquared(Vector3D point) /// /// The point. /// The distance. - public T GetDistanceToNearestEdge(Vector3D point) => Scalar.Sqrt(GetDistanceToNearestEdgeSquared(point)); + public T GetDistanceToNearestEdge(Vector3D point) => T.Sqrt(GetDistanceToNearestEdgeSquared(point)); /// /// Calculates a new sphere translated by a given distance. @@ -112,16 +90,6 @@ public Sphere GetTranslated(Vector3D distance) return new(Center + distance, Radius); } - /// - /// Calculates a sphere inflated to contain the given point. - /// - /// The point. - /// The sphere. - public Sphere GetInflated(Vector3D point) - { - return new(Center, Scalar.Max(Radius, Vector3D.Distance(Center, point))); - } - /// Returns a boolean indicating whether the given Sphere is equal to this Sphere instance. /// The Sphere to compare this instance to. /// True if the other Sphere is equal to this instance; False otherwise. @@ -162,15 +130,63 @@ public override int GetHashCode() { return !value1.Equals(value2); } - + /// /// Returns this sphere casted to /// /// The type to cast to /// The casted sphere - public Sphere As() where TOther : unmanaged, IFormattable, IEquatable, IComparable + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Sphere As() + where TOther : IRootFunctions + { + return new(Center.As(), TOther.CreateTruncating(Radius)); + } + } + + /// + /// Helper methods to work with + /// + public static class Sphere + { + /// + /// Calculates whether this sphere contains a point. + /// + /// The sphere. + /// The point. + /// True if this sphere contains the point; False otherwise. + /// This does consider a point on the edge contained. + public static bool Contains(this Sphere sphere, Vector3D point) + where T : INumber, IRootFunctions + { + return Vector3D.DistanceSquared(point, sphere.Center) <= sphere.Radius; + } + + /// + /// Calculates whether this sphere contains another sphere + /// + /// The sphere. + /// The other sphere. + /// True if this sphere contains the given sphere; False otherwise. + /// This does consider a sphere that touches the edge contained. + public static bool Contains(this Sphere sphere, Sphere other) + where T : INumber, IRootFunctions + { + var distanceSquared = Vector3D.DistanceSquared(sphere.Center, other.Center); + var radiusDiff = sphere.Radius - other.Radius; + return distanceSquared <= radiusDiff * radiusDiff; + } + + /// + /// Calculates a sphere inflated to contain the given point. + /// + /// The sphere. + /// The point. + /// The sphere. + public static Sphere GetInflated(this Sphere sphere, Vector3D point) + where T : INumber, IRootFunctions { - return new(Center.As(), Scalar.As(Radius)); + return new(sphere.Center, T.Max(sphere.Radius, Vector3D.Distance(sphere.Center, point))); } } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Vector2D.Ops.cs b/sources/Maths/Maths/Vector2D.Ops.cs index 3c556c26d3..971c5efd73 100644 --- a/sources/Maths/Maths/Vector2D.Ops.cs +++ b/sources/Maths/Maths/Vector2D.Ops.cs @@ -1,288 +1,15 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Runtime.CompilerServices; +using System.Numerics; namespace Silk.NET.Maths { - /// - /// Methods for working with - /// - public static class Vector2D + public static partial class Vector2D { - /// Returns a vector whose elements are the absolute values of each of the specified vector's elements. - /// A vector. - /// The absolute value vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Abs(Vector2D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Abs(value.X), Scalar.Abs(value.Y)); - - /// Adds two vectors together. - /// The first vector to add. - /// The second vector to add. - /// The summed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Add(Vector2D left, Vector2D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Add(left.X, right.X), Scalar.Add(left.Y, right.Y)); - - /// Restricts a vector between a minimum and a maximum value. - /// The vector to restrict. - /// The minimum value. - /// The maximum value. - /// The restricted vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Clamp(Vector2D value1, Vector2D min, Vector2D max) - where T : unmanaged, IFormattable, IEquatable, IComparable - // We must follow HLSL behavior in the case user specified min value is bigger than max value. - => Min(Max(value1, min), max); - - /// Computes the Euclidean distance between the two given points. - /// The first point. - /// The second point. - /// The distance. - [MethodImpl((MethodImplOptions) 768)] - public static T Distance(Vector2D value1, Vector2D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Sqrt(DistanceSquared(value1, value2)); - - /// Returns the Euclidean distance squared between two specified points. - /// The first point. - /// The second point. - /// The distance squared. - [MethodImpl((MethodImplOptions) 768)] - public static T DistanceSquared(Vector2D value1, Vector2D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - var difference = value1 - value2; - return Dot(difference, difference); - } - - /// Divides the first vector by the second. - /// The first vector. - /// The second vector. - /// The vector resulting from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Divide(Vector2D left, Vector2D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Divide(left.X, right.X), Scalar.Divide(left.Y, right.Y)); - - /// Divides the specified vector by a specified scalar value. - /// The vector. - /// The scalar value. - /// The vector that results from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Divide(Vector2D left, T divisor) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Divide(left.X, divisor), Scalar.Divide(left.Y, divisor)); - - /// Returns the dot product of two vectors. - /// The first vector. - /// The second vector. - /// The dot product. - [MethodImpl((MethodImplOptions) 768)] - public static T Dot(Vector2D value1, Vector2D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Add(Scalar.Multiply(value1.X, value2.X), Scalar.Multiply(value1.Y, value2.Y)); - - /// Linearly interpolates between two vectors based on the given weighting. - /// The first source vector. - /// The second source vector. - /// Value between 0 and 1 indicating the weight of the second source vector. - /// The interpolated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Lerp(Vector2D value1, Vector2D value2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - => (value1 * Scalar.Subtract(Scalar.One, amount)) + (value2 * amount); - - /// Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors - /// The first source vector - /// The second source vector - /// The maximized vector - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Max(Vector2D value1, Vector2D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Max(value1.X, value2.X), Scalar.Max(value1.Y, value2.Y)); - - /// Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors. - /// The first source vector. - /// The second source vector. - /// The minimized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Min(Vector2D value1, Vector2D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Min(value1.X, value2.X), Scalar.Min(value1.Y, value2.Y)); - - /// Multiplies two vectors together. - /// The first source vector. - /// The second source vector. - /// The product vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector2D left, Vector2D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Multiply(left.X, right.X), Scalar.Multiply(left.Y, right.Y)); - - /// Multiplies a vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector2D left, T right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Multiply(left.X, right), Scalar.Multiply(left.Y, right)); - - /// Multiplies a vector by the given scalar. - /// The scalar value. - /// The source vector. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(T left, Vector2D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Multiply(left, right.X), Scalar.Multiply(left, right.Y)); - - /// Negates a given vector. - /// The source vector. - /// The negated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Negate(Vector2D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Returns a vector with the same direction as the given vector, but with a length of 1. - /// The vector to normalize. - /// The normalized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Normalize(Vector2D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value / value.Length; - - /// Returns the reflection of a vector off a surface that has the specified normal. - /// The source vector. - /// The normal of the surface being reflected off. - /// The reflected vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Reflect(Vector2D vector, Vector2D normal) - where T : unmanaged, IFormattable, IEquatable, IComparable - => vector - Scalar.Multiply(Scalar.Two, Dot(vector, normal)) * normal; - - /// Returns a vector whose elements are the square root of each of the source vector's elements. - /// The source vector. - /// The square root vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D SquareRoot(Vector2D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Sqrt(value.X), Scalar.Sqrt(value.Y)); - - /// Subtracts the second vector from the first. - /// The first source vector. - /// The second source vector. - /// The difference vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Subtract(Vector2D left, Vector2D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left - right; - - /// Transforms a vector by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - public static Vector2D Transform(Vector2D position, Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M11), Scalar.Multiply(position.Y, matrix.M21)), matrix.M41), - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M12), Scalar.Multiply(position.Y, matrix.M22)), matrix.M42) - ); - } - - /// Transforms a vector normal by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - public static Vector2D TransformNormal(Vector2D normal, Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Multiply(normal.X, matrix.M11), Scalar.Multiply(normal.Y, matrix.M21)), - Scalar.Add(Scalar.Multiply(normal.X, matrix.M12), Scalar.Multiply(normal.Y, matrix.M22))); - } - - /// Transforms a vector by the given Quaternion rotation value. - /// The source vector to be rotated. - /// The rotation to apply. - /// The transformed vector. - public static Vector2D Transform(Vector2D value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - return new( - Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2)), Scalar.Multiply(value.Y, Scalar.Subtract(xy2, wz2))), - Scalar.Add(Scalar.Multiply(value.X, Scalar.Add(xy2, wz2)), Scalar.Multiply(value.Y, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2))) - ); - } - - /// Transforms a vector by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - public static Vector2D Transform(Vector2D position, Matrix3X2 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M11), Scalar.Multiply(position.Y, matrix.M21)), matrix.M31), - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M12), Scalar.Multiply(position.Y, matrix.M22)), matrix.M32) - ); - } - - /// Transforms a vector normal by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - public static Vector2D TransformNormal(Vector2D normal, Matrix3X2 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Multiply(normal.X, matrix.M11), Scalar.Multiply(normal.Y, matrix.M21)), - Scalar.Add(Scalar.Multiply(normal.X, matrix.M12), Scalar.Multiply(normal.Y, matrix.M22)) - ); - } - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector2D value1, Matrix2X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector2D value1, Matrix2X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector2D value1, Matrix2X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; + /// Computes the cross product of two vectors. + public static T Cross(this Vector2D left, Vector2D right) + where T : INumberBase => + (left.X * right.Y) - (left.Y * right.X); } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Vector2D.Ops.gen.cs b/sources/Maths/Maths/Vector2D.Ops.gen.cs new file mode 100644 index 0000000000..4a7acc7caa --- /dev/null +++ b/sources/Maths/Maths/Vector2D.Ops.gen.cs @@ -0,0 +1,718 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Vector2D + { + /// Extensions for vectors with elements implementing . + extension(Vector2D vector) + where T : IRootFunctions + { + /// Gets the length of the vector. + public T Length => T.Sqrt(vector.LengthSquared); + } + + /// Extensions for vectors with elements implementing . + extension(Vector2D vector) + where T : INumberBase + { + /// Gets the length squared of the vector. + public T LengthSquared => Vector2D.Dot(vector, vector); + } + + /// Desconstructs a vector into its components. + /// The vector to deconstruct. + /// The X component. + /// The Y component. + public static void Deconstruct(this Vector2D vector, out T x, out T y) + where T : INumberBase + { + x = vector.X; + y = vector.Y; + } + + /// Computes the dot product of two vectors. + public static T Dot(Vector2D left, Vector2D right) + where T : INumberBase => + left.X * right.X + left.Y * right.Y; + + /// Reflects a vector over a normal vector. + public static Vector2D Reflect(Vector2D vector, Vector2D normal) + where T : INumberBase + { + T dot = Dot(vector, normal); + return vector - (normal * (dot + dot)); + } + + /// Normalizes a vector. + public static Vector2D Normalize(this Vector2D vector) + where T : IRootFunctions + { + T length = vector.Length; + return length != T.Zero ? vector / length : Vector2D.Zero; + } + + /// Returns the Euclidean distance between the two given points. + /// The first point. + /// The second point. + /// The distance. + public static T Distance(Vector2D value1, Vector2D value2) + where T : IRootFunctions => + T.Sqrt(DistanceSquared(value1, value2)); + + /// Returns the Euclidean distance squared between the two given points. + /// The first point. + /// The second point. + /// The distance squared. + public static T DistanceSquared(Vector2D value1, Vector2D value2) + where T : INumberBase + { + var difference = value1 - value2; + return Dot(difference, difference); + } + + /// Linearly interpolates between two vectors using a scalar t-value (clamped between 0 and 1). + public static Vector2D LerpClamped(Vector2D a, Vector2D b, T amount) + where T : IFloatingPointIeee754 => + Lerp(a, b, T.Clamp(amount, T.Zero, T.One)); + + /// Linearly interpolates between two vectors using a vector t-value (clamped between 0 and 1). + public static Vector2D LerpClamped(Vector2D a, Vector2D b, Vector2D amount) + where T : IFloatingPointIeee754 => + new(T.Lerp(a.X, b.X, T.Clamp(amount.X, T.Zero, T.One)), + T.Lerp(a.Y, b.Y, T.Clamp(amount.Y, T.Zero, T.One))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static (Vector2D Sin, Vector2D Cos) SinCos(Vector2D x) + where T : ITrigonometricFunctions => + (new(T.Sin(x.X), T.Sin(x.Y)), new(T.Cos(x.X), T.Cos(x.Y))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static (Vector2D SinPi, Vector2D CosPi) SinCosPi(Vector2D x) + where T : ITrigonometricFunctions => + (new(T.SinPi(x.X), T.SinPi(x.Y)), new(T.CosPi(x.X), T.CosPi(x.Y))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static (Vector2D Quotient, Vector2D Remainder) DivRem(Vector2D left, Vector2D right) + where T : IBinaryInteger + { + var (qX, rX) = T.DivRem(left.X, right.X); + var (qY, rY) = T.DivRem(left.Y, right.Y); + return (new Vector2D(qX, qY), new Vector2D(rX, rY)); + } + + /// Multiplies a vector by a scalar value. + /// The source vector. + /// The scaling factor. + /// The scaled vector. + public static Vector2D Multiply(Vector2D left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a vector by a scalar value. + /// The scaling factor. + /// The source vector. + /// The scaled vector. + public static Vector2D Multiply(T left, Vector2D right) + where T : INumberBase => + left * right; + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Sign(Vector2D value) + where TSelf : INumber => + new(TSelf.Sign(value.X), TSelf.Sign(value.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Max(Vector2D x, Vector2D y) + where TSelf : INumber => + new(TSelf.Max(x.X, y.X), TSelf.Max(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Max(Vector2D x, TSelf y) + where TSelf : INumber => + new(TSelf.Max(x.X, y), TSelf.Max(x.Y, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MaxNumber(Vector2D x, Vector2D y) + where TSelf : INumber => + new(TSelf.MaxNumber(x.X, y.X), TSelf.MaxNumber(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D MaxNumber(Vector2D x, TSelf y) + where TSelf : INumber => + new(TSelf.MaxNumber(x.X, y), TSelf.MaxNumber(x.Y, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Min(Vector2D x, Vector2D y) + where TSelf : INumber => + new(TSelf.Min(x.X, y.X), TSelf.Min(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Min(Vector2D x, TSelf y) + where TSelf : INumber => + new(TSelf.Min(x.X, y), TSelf.Min(x.Y, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MinNumber(Vector2D x, Vector2D y) + where TSelf : INumber => + new(TSelf.MinNumber(x.X, y.X), TSelf.MinNumber(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D MinNumber(Vector2D x, TSelf y) + where TSelf : INumber => + new(TSelf.MinNumber(x.X, y), TSelf.MinNumber(x.Y, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Clamp(Vector2D value, Vector2D min, Vector2D max) + where TSelf : INumber => + new(TSelf.Clamp(value.X, min.X, max.X), TSelf.Clamp(value.Y, min.Y, max.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector2D Clamp(Vector2D value, TSelf min, TSelf max) + where TSelf : INumber => + new(TSelf.Clamp(value.X, min, max), TSelf.Clamp(value.Y, min, max)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D CopySign(Vector2D value, Vector2D sign) + where TSelf : INumber => + new(TSelf.CopySign(value.X, sign.X), TSelf.CopySign(value.Y, sign.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D CopySign(Vector2D value, TSelf sign) + where TSelf : INumber => + new(TSelf.CopySign(value.X, sign), TSelf.CopySign(value.Y, sign)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Abs(Vector2D value) + where TSelf : INumberBase => + new(TSelf.Abs(value.X), TSelf.Abs(value.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MaxMagnitude(Vector2D x, Vector2D y) + where TSelf : INumberBase => + new(TSelf.MaxMagnitude(x.X, y.X), TSelf.MaxMagnitude(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MaxMagnitudeNumber(Vector2D x, Vector2D y) + where TSelf : INumberBase => + new(TSelf.MaxMagnitudeNumber(x.X, y.X), TSelf.MaxMagnitudeNumber(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MinMagnitude(Vector2D x, Vector2D y) + where TSelf : INumberBase => + new(TSelf.MinMagnitude(x.X, y.X), TSelf.MinMagnitude(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MinMagnitudeNumber(Vector2D x, Vector2D y) + where TSelf : INumberBase => + new(TSelf.MinMagnitudeNumber(x.X, y.X), TSelf.MinMagnitudeNumber(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D MultiplyAddEstimate(Vector2D left, Vector2D right, Vector2D addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right.X, addend.X), TSelf.MultiplyAddEstimate(left.Y, right.Y, addend.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D MultiplyAddEstimate(Vector2D left, Vector2D right, TSelf addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right.X, addend), TSelf.MultiplyAddEstimate(left.Y, right.Y, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A vector whose members will be provided for . + public static Vector2D MultiplyAddEstimate(Vector2D left, TSelf right, Vector2D addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right, addend.X), TSelf.MultiplyAddEstimate(left.Y, right, addend.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector2D MultiplyAddEstimate(Vector2D left, TSelf right, TSelf addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right, addend), TSelf.MultiplyAddEstimate(left.Y, right, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D PopCount(Vector2D value) + where TSelf : IBinaryInteger => + new(TSelf.PopCount(value.X), TSelf.PopCount(value.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D TrailingZeroCount(Vector2D value) + where TSelf : IBinaryInteger => + new(TSelf.TrailingZeroCount(value.X), TSelf.TrailingZeroCount(value.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Ceiling(Vector2D x) + where TSelf : IFloatingPoint => + new(TSelf.Ceiling(x.X), TSelf.Ceiling(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Floor(Vector2D x) + where TSelf : IFloatingPoint => + new(TSelf.Floor(x.X), TSelf.Floor(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Round(Vector2D x) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X), TSelf.Round(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Round(Vector2D x, int digits) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, digits), TSelf.Round(x.Y, digits)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Round(Vector2D x, MidpointRounding mode) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, mode), TSelf.Round(x.Y, mode)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector2D Round(Vector2D x, int digits, MidpointRounding mode) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, digits, mode), TSelf.Round(x.Y, digits, mode)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Truncate(Vector2D x) + where TSelf : IFloatingPoint => + new(TSelf.Truncate(x.X), TSelf.Truncate(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Atan2(Vector2D y, Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Atan2(y.X, x.X), TSelf.Atan2(y.Y, x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Atan2Pi(Vector2D y, Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Atan2Pi(y.X, x.X), TSelf.Atan2Pi(y.Y, x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Lerp(Vector2D value1, Vector2D value2, TSelf amount) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Lerp(value1.X, value2.X, amount), TSelf.Lerp(value1.Y, value2.Y, amount)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D BitDecrement(Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.BitDecrement(x.X), TSelf.BitDecrement(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D BitIncrement(Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.BitIncrement(x.X), TSelf.BitIncrement(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D FusedMultiplyAdd(Vector2D left, Vector2D right, Vector2D addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right.X, addend.X), TSelf.FusedMultiplyAdd(left.Y, right.Y, addend.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D FusedMultiplyAdd(Vector2D left, Vector2D right, TSelf addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right.X, addend), TSelf.FusedMultiplyAdd(left.Y, right.Y, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A vector whose members will be provided for . + public static Vector2D FusedMultiplyAdd(Vector2D left, TSelf right, Vector2D addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right, addend.X), TSelf.FusedMultiplyAdd(left.Y, right, addend.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector2D FusedMultiplyAdd(Vector2D left, TSelf right, TSelf addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right, addend), TSelf.FusedMultiplyAdd(left.Y, right, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Ieee754Remainder(Vector2D left, Vector2D right) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Ieee754Remainder(left.X, right.X), TSelf.Ieee754Remainder(left.Y, right.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Ieee754Remainder(Vector2D left, TSelf right) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Ieee754Remainder(left.X, right), TSelf.Ieee754Remainder(left.Y, right)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D ILogB(Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ILogB(x.X), TSelf.ILogB(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D ReciprocalEstimate(Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ReciprocalEstimate(x.X), TSelf.ReciprocalEstimate(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D ReciprocalSqrtEstimate(Vector2D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ReciprocalSqrtEstimate(x.X), TSelf.ReciprocalSqrtEstimate(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D ScaleB(Vector2D x, Vector2D n) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ScaleB(x.X, n.X), TSelf.ScaleB(x.Y, n.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D ScaleB(Vector2D x, int n) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ScaleB(x.X, n), TSelf.ScaleB(x.Y, n)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Pow(Vector2D x, Vector2D y) + where TSelf : IPowerFunctions => + new(TSelf.Pow(x.X, y.X), TSelf.Pow(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Pow(Vector2D x, TSelf y) + where TSelf : IPowerFunctions => + new(TSelf.Pow(x.X, y), TSelf.Pow(x.Y, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Cbrt(Vector2D x) + where TSelf : IRootFunctions => + new(TSelf.Cbrt(x.X), TSelf.Cbrt(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Sqrt(Vector2D x) + where TSelf : IRootFunctions => + new(TSelf.Sqrt(x.X), TSelf.Sqrt(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D RootN(Vector2D x, int n) + where TSelf : IRootFunctions => + new(TSelf.RootN(x.X, n), TSelf.RootN(x.Y, n)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D RootN(Vector2D x, Vector2D n) + where TSelf : IRootFunctions => + new(TSelf.RootN(x.X, n.X), TSelf.RootN(x.Y, n.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Hypot(Vector2D x, Vector2D y) + where TSelf : IRootFunctions => + new(TSelf.Hypot(x.X, y.X), TSelf.Hypot(x.Y, y.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Hypot(Vector2D x, TSelf y) + where TSelf : IRootFunctions => + new(TSelf.Hypot(x.X, y), TSelf.Hypot(x.Y, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Log(Vector2D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X), TSelf.Log(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector2D Log(Vector2D x, Vector2D newBase) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X, newBase.X), TSelf.Log(x.Y, newBase.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector2D Log(Vector2D x, TSelf newBase) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X, newBase), TSelf.Log(x.Y, newBase)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D LogP1(Vector2D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.LogP1(x.X), TSelf.LogP1(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Log2(Vector2D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log2(x.X), TSelf.Log2(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Log2P1(Vector2D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log2P1(x.X), TSelf.Log2P1(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Log10(Vector2D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log10(x.X), TSelf.Log10(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Log10P1(Vector2D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log10P1(x.X), TSelf.Log10P1(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Exp(Vector2D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp(x.X), TSelf.Exp(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D ExpM1(Vector2D x) + where TSelf : IExponentialFunctions => + new(TSelf.ExpM1(x.X), TSelf.ExpM1(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Exp2(Vector2D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp2(x.X), TSelf.Exp2(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Exp2M1(Vector2D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp2M1(x.X), TSelf.Exp2M1(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Exp10(Vector2D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp10(x.X), TSelf.Exp10(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Exp10M1(Vector2D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp10M1(x.X), TSelf.Exp10M1(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Acos(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Acos(x.X), TSelf.Acos(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D AcosPi(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AcosPi(x.X), TSelf.AcosPi(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Asin(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Asin(x.X), TSelf.Asin(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D AsinPi(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AsinPi(x.X), TSelf.AsinPi(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Atan(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Atan(x.X), TSelf.Atan(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D AtanPi(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AtanPi(x.X), TSelf.AtanPi(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Cos(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Cos(x.X), TSelf.Cos(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D CosPi(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.CosPi(x.X), TSelf.CosPi(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Sin(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Sin(x.X), TSelf.Sin(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D SinPi(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.SinPi(x.X), TSelf.SinPi(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Tan(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Tan(x.X), TSelf.Tan(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D TanPi(Vector2D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.TanPi(x.X), TSelf.TanPi(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D DegreesToRadians(Vector2D degrees) + where TSelf : ITrigonometricFunctions => + new(TSelf.DegreesToRadians(degrees.X), TSelf.DegreesToRadians(degrees.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D RadiansToDegrees(Vector2D radians) + where TSelf : ITrigonometricFunctions => + new(TSelf.RadiansToDegrees(radians.X), TSelf.RadiansToDegrees(radians.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Acosh(Vector2D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Acosh(x.X), TSelf.Acosh(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Asinh(Vector2D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Asinh(x.X), TSelf.Asinh(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Atanh(Vector2D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Atanh(x.X), TSelf.Atanh(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Cosh(Vector2D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Cosh(x.X), TSelf.Cosh(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Sinh(Vector2D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Sinh(x.X), TSelf.Sinh(x.Y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector2D Tanh(Vector2D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Tanh(x.X), TSelf.Tanh(x.Y)); + } +} diff --git a/sources/Maths/Maths/Vector2D.cs b/sources/Maths/Maths/Vector2D.cs deleted file mode 100644 index cb5b5fabdb..0000000000 --- a/sources/Maths/Maths/Vector2D.cs +++ /dev/null @@ -1,356 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text; - -namespace Silk.NET.Maths -{ - /// A structure encapsulating two values and provides hardware accelerated methods. - [Serializable] - [DataContract] - public struct Vector2D - : IEquatable>, IFormattable - where T : unmanaged, IFormattable, IEquatable, IComparable - { - /// The X component of the vector. - [DataMember] - public T X; - - /// The Y component of the vector. - [DataMember] - public T Y; - - /// Creates a new object whose two elements have the same value. - /// The value to assign to both elements. - public Vector2D(T value) => (X, Y) = (value, value); - - /// Creates a vector whose elements have the specified values. - /// The value to assign to the field. - /// The value to assign to the field. - public Vector2D(T x, T y) => (X, Y) = (x, y); - - /// Gets a vector whose 2 elements are equal to one. - public static Vector2D One => new(Scalar.One); - - /// Gets the vector (1,0). - public static Vector2D UnitX => new(Scalar.One, Scalar.Zero); - - /// Gets the vector (0,1). - public static Vector2D UnitY => new(Scalar.Zero, Scalar.One); - - /// Returns a vector whose 2 elements are equal to zero. - public static Vector2D Zero => default; - - /// - /// Indexer for the components of this vector. - /// - /// The component to select. Zero based. - public T this[int i] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 1 || i < 0) - ThrowHelper(); - } - - VerifyBounds(i); - return Unsafe.Add(ref X, i); - } - } - - /// Copies the elements of the vector to a specified array. - /// The destination array. - /// is null - /// The number of elements in the current instance is greater than in the array. - /// is multidimensional. - /// must have at least two elements. The method copies the vector's elements starting at index 0. - [MethodImpl((MethodImplOptions) 768)] - public readonly void CopyTo(T[]? array) => CopyTo(array, 0); - - /// Copies the elements of the vector to a specified array starting at a specified index position. - /// The destination array. - /// The index at which to copy the first element of the vector. - /// is null - /// The number of elements in the current instance is greater than in the array. - /// is less then zero. - /// is greater then or equal to the array length. - /// is multidimensional. - /// array must have a sufficient number of elements to accommodate the two vector elements. In other words, elements index and index + 1 must already exist in array. - [MethodImpl((MethodImplOptions) 768)] - public readonly void CopyTo(T[]? array, int index) - { - if (array is null) - { - throw new NullReferenceException("Object reference not set to an instance of an object."); - } - - if ((index < 0) || (index >= array.Length)) - { - throw new ArgumentOutOfRangeException(nameof(index), "Specified argument was out of the range of valid values."); - } - - if ((array.Length - index) < 2) - { - throw new ArgumentException("Value does not fall within the expected range."); - } - - array[index] = X; - array[index + 1] = Y; - } - - /// Returns a boolean indicating whether the given is equal to this instance. - /// The to compare this instance to. - /// True if the other is equal to this instance; False otherwise. - public readonly bool Equals(Vector2D other) => this == other; - - /// Returns a boolean indicating whether the given Object is equal to this instance. - /// The Object to compare against. - /// True if the Object is equal to this Vector2D; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) => (obj is Vector2D other) && Equals(other); - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() => HashCode.Combine(X, Y); - - /// Returns the length of the vector. - /// The vector's length. - public T Length - { - [MethodImpl((MethodImplOptions) 768)] - get => Scalar.Sqrt(LengthSquared); - } - - /// Returns the length of the vector squared. This operation is cheaper than Length(). - /// The vector's length squared. - public readonly T LengthSquared - { - [MethodImpl((MethodImplOptions) 768)] - get => Vector2D.Dot(this, this); - } - - /// Adds two vectors together. - /// The first source vector. - /// The second source vector. - /// The summed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator +(Vector2D left, Vector2D right) - => new(Scalar.Add(left.X, right.X), Scalar.Add(left.Y, right.Y)); - - /// Divides the first vector by the second. - /// The first source vector. - /// The second source vector. - /// The vector resulting from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator /(Vector2D left, Vector2D right) - => new(Scalar.Divide(left.X, right.X), Scalar.Divide(left.Y, right.Y)); - - /// Divides the vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The result of the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator /(Vector2D value1, T value2) - => new(Scalar.Divide(value1.X, value2), Scalar.Divide(value1.Y, value2)); - - /// Returns a boolean indicating whether the two given vectors are equal. - /// The first vector to compare. - /// The second vector to compare. - /// True if the vectors are equal; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public static bool operator ==(Vector2D left, Vector2D right) - => Scalar.Equal(left.X, right.X) && Scalar.Equal(left.Y, right.Y); - - /// Returns a boolean indicating whether the two given vectors are not equal. - /// The first vector to compare. - /// The second vector to compare. - /// True if the vectors are not equal; False if they are equal. - [MethodImpl((MethodImplOptions) 768)] - public static bool operator !=(Vector2D left, Vector2D right) => !(left == right); - - /// Multiplies two vectors together. - /// The first source vector. - /// The second source vector. - /// The product vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator *(Vector2D left, Vector2D right) - => new(Scalar.Multiply(left.X, right.X), Scalar.Multiply(left.Y, right.Y)); - - /// Multiplies a vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator *(Vector2D left, T right) - => new(Scalar.Multiply(left.X, right), Scalar.Multiply(left.Y, right)); - - /// Multiplies a vector by the given scalar. - /// The scalar value. - /// The source vector. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator *(T left, Vector2D right) => right * left; - - /// Subtracts the second vector from the first. - /// The first source vector. - /// The second source vector. - /// The difference vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator -(Vector2D left, Vector2D right) - => new(Scalar.Subtract(left.X, right.X), Scalar.Subtract(left.Y, right.Y)); - - /// Negates a given vector. - /// The source vector. - /// The negated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D operator -(Vector2D value) => Zero - value; - - /// Returns a String representing this instance. - /// The string representation. - public override readonly string ToString() => ToString("G", CultureInfo.CurrentCulture); - - /// Returns a String representing this instance, using the specified format to format individual elements. - /// The format of individual elements. - /// The string representation. - public readonly string ToString(string? format) => ToString(format, CultureInfo.CurrentCulture); - - /// Returns a String representing this instance, using the specified format to format individual elements and the given IFormatProvider. - /// The format of individual elements. - /// The format provider to use when formatting elements. - /// The string representation. - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - sb.Append('<'); - sb.Append(X.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(Y.ToString(format, formatProvider)); - sb.Append('>'); - return sb.ToString(); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into - /// - /// The source vector - /// The vector - public static explicit operator System.Numerics.Vector2(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector2D(Vector2D from) - => new(Scalar.As(from.X), Scalar.As(from.Y)); - - /// - /// Returns this vector casted to - /// - /// The type to cast to - /// The casted vector - public Vector2D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Scalar.As(X), Scalar.As(Y)); - } - } -} diff --git a/sources/Maths/Maths/Vector2D.gen.cs b/sources/Maths/Maths/Vector2D.gen.cs new file mode 100644 index 0000000000..77783887a9 --- /dev/null +++ b/sources/Maths/Maths/Vector2D.gen.cs @@ -0,0 +1,650 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.CompilerServices; + using System.Runtime.InteropServices; + using System.Text; + + /// A structure encapsulating a 2D vector. + public partial struct Vector2D : + IEquatable>, + IReadOnlyList, + IFormattable, + IParsable>, + ISpanFormattable, + ISpanParsable>, + IUtf8SpanFormattable, + IUtf8SpanParsable> + where T : INumberBase + { + /// Gets a vector whose 2 elements are equal to one. + public static Vector2D One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.One); + } + + /// Returns a vector whose 2 elements are equal to zero. + public static Vector2D Zero + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero); + } + + /// Gets the vector (1, 0). + public static Vector2D UnitX + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.One, T.Zero); + } + + /// Gets the vector (0, 1). + public static Vector2D UnitY + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero, T.One); + } + + /// The X component of the vector. + public T X; + + /// The Y component of the vector. + public T Y; + + /// The number of elements in the vector. + public int Count => 2; + + /// + T IReadOnlyList.this[int index] => this[index]; + + ///Gets the component at the specified index: 0 = X, 1 = Y. + [UnscopedRef] + public ref T this[int index] + { + get + { + switch (index) + { + case 0: + return ref X; + case 1: + return ref Y; + } + + throw new ArgumentOutOfRangeException(nameof(index)); + } + } + + /// Initializes all components of the vector to the same value. + public Vector2D(T value) => (X, Y) = (value, value); + + /// Initializes the vector with individual component values. + public Vector2D(T x, T y) => (X, Y) = (x, y); + + /// Initializes the vector from a span of 2 values. + public Vector2D(ReadOnlySpan values) + { + if (values.Length != 2) + throw new ArgumentException("Input span must contain exactly 2 elements.", nameof(values)); + + X = values[0]; + Y = values[1]; + } + + /// + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + /// Returns an enumerator that iterates through the vector components. + public IEnumerator GetEnumerator() + { + yield return X; + yield return Y; + } + + /// Copies the components of the vector to the specified array starting at index 0. + public void CopyTo(T[] array) => CopyTo(array, 0); + + /// Copies the components of the vector to the specified array starting at the given index. + public void CopyTo(T[] array, int startIndex) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + if (startIndex < 0 || startIndex + 2 > array.Length) + throw new ArgumentOutOfRangeException(nameof(startIndex)); + + array[startIndex] = X; + array[startIndex + 1] = Y; + } + + /// Copies the components of the vector to the specified span starting at index 0. + public void CopyTo(Span span) => CopyTo(span, 0); + + /// Copies the components of the vector to the specified span starting at the given index. + public void CopyTo(Span span, int startIndex) + { + if (startIndex < 0 || startIndex + 2 > span.Length) + throw new ArgumentOutOfRangeException(nameof(startIndex)); + + span[startIndex] = X; + span[startIndex + 1] = Y; + } + + /// Returns a span over the vector components. + public Span AsSpan() => MemoryMarshal.CreateSpan(ref X, 2); + + /// Formats the vector as a string. + public override string ToString() => + $"<{X}, {Y}>"; + + /// Formats the vector as a string using the specified format and format provider. + public string ToString(string? format, IFormatProvider? formatProvider) => + $"<{X.ToString(format, formatProvider)}, {Y.ToString(format, formatProvider)}>"; + + /// Parses a string to a instance. + public static Vector2D Parse(string s, IFormatProvider? provider) => Parse(s.AsSpan(), provider); + + /// Parses a span to a instance. + public static Vector2D Parse(ReadOnlySpan s, IFormatProvider? provider) + { + if (!TryParse(s, provider, out var result)) + throw new FormatException("Invalid format for Vector2D."); + + return result; + } + + /// Formats the vector as a UTF-8 string using the specified format and format provider. + public bool TryFormat(Span utf8Destination, out int bytesWritten, ReadOnlySpan format, IFormatProvider? provider) + { + Span xBuffer = stackalloc char[64]; + Span yBuffer = stackalloc char[64]; + + if (!X.TryFormat(xBuffer, out int xChars, format, provider)|| + !Y.TryFormat(yBuffer, out int yChars, format, provider)) + { + bytesWritten = 0; + return false; + } + + int estimatedSize = Encoding.UTF8.GetByteCount(xBuffer[..xChars]) + + Encoding.UTF8.GetByteCount(yBuffer[..yChars]) + + Encoding.UTF8.GetByteCount("<, >"); + + if (utf8Destination.Length < estimatedSize) + { + bytesWritten = 0; + return false; + } + + int totalBytes = 0; + + totalBytes += Encoding.UTF8.GetBytes("<", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(xBuffer[..xChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(", ", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(yBuffer[..yChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(">", utf8Destination[totalBytes..]); + + bytesWritten = totalBytes; + return true; + } + + /// Formats the vector as a string using the specified format and format provider. + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider? provider) + { + Span xBuffer = stackalloc char[64]; + Span yBuffer = stackalloc char[64]; + + if (!X.TryFormat(xBuffer, out int xChars, format, provider) || + !Y.TryFormat(yBuffer, out int yChars, format, provider)) + { + charsWritten = 0; + return false; + } + + int requiredLength = 1 + xChars + 2 + yChars + 1; + + if (destination.Length < requiredLength) + { + charsWritten = 0; + return false; + } + + int pos = 0; + destination[pos++] = '<'; + + xBuffer[..xChars].CopyTo(destination[pos..]); + pos += xChars; + + destination[pos++] = ','; + destination[pos++] = ' '; + + yBuffer[..yChars].CopyTo(destination[pos..]); + pos += yChars; + + destination[pos++] = '>'; + + charsWritten = pos; + return true; + } + + /// Tries to parse a span to a instance. + public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector2D result) + { + result = default; + + s = s.Trim(); + if (s.Length < 4 || s[0] != '<' || s[^1] != '>') + return false; + + s = s[1..^1]; // Remove < and > + + int commaX = s.IndexOf(','); + if (commaX < 0) + return false; + + ReadOnlySpan xSpan = s[..commaX].Trim(); + ReadOnlySpan ySpan = s[(commaX + 1)..].Trim(); + + if (T.TryParse(xSpan, provider, out var x) && + T.TryParse(ySpan, provider, out var y)) + { + result = new Vector2D(x, y); + return true; + } + + return false; + } + + /// Parses a UTF-8 span to a instance. + public static Vector2D Parse(ReadOnlySpan utf8Text, IFormatProvider? provider) + { + int charCount = Encoding.UTF8.GetCharCount(utf8Text); + Span charBuffer = charCount <= 128 ? stackalloc char[charCount] : new char[charCount]; + Encoding.UTF8.GetChars(utf8Text, charBuffer); + return Parse(charBuffer, provider); + } + + /// Tries to parse a UTF-8 span to a instance. + public static bool TryParse(ReadOnlySpan utf8Text, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector2D result) + { + int charCount = Encoding.UTF8.GetCharCount(utf8Text); + Span charBuffer = charCount <= 128 ? stackalloc char[charCount] : new char[charCount]; + Encoding.UTF8.GetChars(utf8Text, charBuffer); + return TryParse(charBuffer, provider, out result); + } + + /// Tries to parse a string to a instance. + public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector2D result) => + TryParse(s.AsSpan(), provider, out result); + + /// Parses a span to a instance. + static Vector2D ISpanParsable>.Parse(ReadOnlySpan s, IFormatProvider? provider) => + Parse(s, provider); + + /// Parses a string to a instance. + static Vector2D IParsable>.Parse(string s, IFormatProvider? provider) => + Parse(s, provider); + + /// Tries to parse a span to a instance. + static bool ISpanParsable>.TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector2D result) => + TryParse(s, provider, out result); + + /// Tries to parse a string to a instance. + static bool IParsable>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector2D result) => + TryParse(s, provider, out result); + + /// Returns a boolean indicating whether the given two vectors are equal. + /// The first vector to compare. + /// The second vector to compare. + /// true if the given vectors are equal; false otherwise. + public static bool operator ==(Vector2D left, Vector2D right) => + left.X == right.X && + left.Y == right.Y; + + /// Returns a boolean indicating whether the given two vectors are not equal. + /// The first vector to compare. + /// The second vector to compare. + /// true if the given vectors are not equal; false otherwise. + public static bool operator !=(Vector2D left, Vector2D right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is Vector2D other && Equals(other); + + /// + public bool Equals(Vector2D other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(X, Y); + + /// Converts the components of this vector to another type. + public static Vector2D CreateChecked(Vector2D source) + where TOther : INumberBase => + new(T.CreateChecked(source.X), T.CreateChecked(source.Y)); + + /// Converts the components of this vector to another type. + public static Vector2D CreateSaturating(Vector2D source) + where TOther : INumberBase => + new(T.CreateSaturating(source.X), T.CreateSaturating(source.Y)); + + /// Converts the components of this vector to another type. + public static Vector2D CreateTruncating(Vector2D source) + where TOther : INumberBase => + new(T.CreateTruncating(source.X), T.CreateTruncating(source.Y)); + + /// Converts the components of this vector to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Vector2D As() + where TOther : INumberBase => + Vector2D.CreateTruncating(this); + + /// Converts the components of this vector to another type. + public Vector2D AsChecked() + where TOther : INumberBase => + Vector2D.CreateChecked(this); + + /// Converts the components of this vector to another type. + public Vector2D AsSaturating() + where TOther : INumberBase => + Vector2D.CreateSaturating(this); + + /// Converts the components of this vector to another type. + public Vector2D AsTruncating() + where TOther : INumberBase => + Vector2D.CreateTruncating(this); + + /// Implicitly casts a to a . + public static implicit operator Vector2D((T X, T Y) v) => + new(v.X, v.Y); + + /// Implicitly casts a to a . + public static implicit operator (T X, T Y)(Vector2D v) => + (v.X, v.Y); + + /// Returns the given vector. + /// The source vector. + /// The source vector. + public static Vector2D operator +(Vector2D vector) => + vector; + + /// Negates a given vector. + /// The source vector. + /// The negated vector. + public static Vector2D operator -(Vector2D vector) => + new(-vector.X, -vector.Y); + + /// Adds two vectors together. + /// The first source vector. + /// The second source vector. + /// The summed vector. + public static Vector2D operator +(Vector2D left, Vector2D right) => + new(left.X + right.X, left.Y + right.Y); + + /// Subtracts the second vector from the first. + /// The first source vector. + /// The second source vector. + /// The difference vector. + public static Vector2D operator -(Vector2D left, Vector2D right) => + new(left.X - right.X, left.Y - right.Y); + + /// Multiplies two vectors together. + /// The first source vector. + /// The second source vector. + /// The product vector. + public static Vector2D operator *(Vector2D left, Vector2D right) => + new(left.X * right.X, left.Y * right.Y); + + /// Divides the first vector by the second. + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + public static Vector2D operator /(Vector2D left, Vector2D right) => + new(left.X / right.X, left.Y / right.Y); + + /// Adds a scalar to the components of a vector. + /// The source vector. + /// The scalar value. + /// The offset vector. + public static Vector2D operator +(Vector2D vector, T scalar) => + new(vector.X + scalar, vector.Y + scalar); + + /// Subtracts a scalar from the components of a vector. + /// The source vector. + /// The scalar value. + /// The offset vector. + public static Vector2D operator -(Vector2D vector, T scalar) => + new(vector.X - scalar, vector.Y - scalar); + + /// Multiplies a vector by the given scalar. + /// The source vector. + /// The scalar value. + /// The scaled vector. + public static Vector2D operator *(Vector2D vector, T scalar) => + new(vector.X * scalar, vector.Y * scalar); + + /// Multiplies a vector by the given scalar. + /// The scalar value. + /// The source vector. + /// The scaled vector. + public static Vector2D operator *(T scalar, Vector2D vector) => + new(scalar * vector.X, scalar * vector.Y); + + /// Divides the vector by the given scalar. + /// The source vector. + /// The scalar value. + /// The result of the division. + public static Vector2D operator /(Vector2D vector, T scalar) => + new(vector.X / scalar, vector.Y / scalar); + + /// Converts a to a . + public static explicit operator Vector2D(Vector2 from) => + new(T.CreateTruncating(from.X), T.CreateTruncating(from.Y)); + + /// Converts a to a . + public static explicit operator checked Vector2D(Vector2 from) => + new(T.CreateChecked(from.X), T.CreateChecked(from.Y)); + + /// Converts a to . + public static explicit operator Vector2(Vector2D from) => + new(float.CreateTruncating(from.X), float.CreateTruncating(from.Y)); + + /// Converts a to . + public static explicit operator checked Vector2(Vector2D from) => + new(float.CreateChecked(from.X), float.CreateChecked(from.Y)); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector2D(Vector2D from) => + Vector2D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector2D(Vector2D from) => + Vector2D.CreateChecked(from); + } +} diff --git a/sources/Maths/Maths/Vector3D.Ops.cs b/sources/Maths/Maths/Vector3D.Ops.cs index ec06f40112..e5ee09279f 100644 --- a/sources/Maths/Maths/Vector3D.Ops.cs +++ b/sources/Maths/Maths/Vector3D.Ops.cs @@ -1,299 +1,18 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. -using System; -using System.Runtime.CompilerServices; +using System.Numerics; namespace Silk.NET.Maths { - /// - /// Methods for working with - /// - public static class Vector3D + public static partial class Vector3D { - - /// Returns a vector whose elements are the absolute values of each of the source vector's elements. - /// The source vector. - /// The absolute value vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Abs(Vector3D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Abs(value.X), Scalar.Abs(value.Y), Scalar.Abs(value.Z)); - - /// Adds two vectors together. - /// The first source vector. - /// The second source vector. - /// The summed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Add(Vector3D left, Vector3D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left + right; - - /// Restricts a vector between a min and max value. - /// The source vector. - /// The minimum value. - /// The maximum value. - /// The restricted vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Clamp(Vector3D value1, Vector3D min, Vector3D max) - where T : unmanaged, IFormattable, IEquatable, IComparable - // We must follow HLSL behavior in the case user specified min value is bigger than max value. - => Min(Max(value1, min), max); - - /// Computes the cross product of two vectors. - /// The first vector. - /// The second vector. - /// The cross product. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Cross(Vector3D vector1, Vector3D vector2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new( - Scalar.Subtract(Scalar.Multiply(vector1.Y, vector2.Z), - Scalar.Multiply(vector1.Z, vector2.Y)), - Scalar.Subtract(Scalar.Multiply(vector1.Z, vector2.X), - Scalar.Multiply(vector1.X, vector2.Z)), - Scalar.Subtract(Scalar.Multiply(vector1.X, vector2.Y), - Scalar.Multiply(vector1.Y, vector2.X))); - - /// Returns the Euclidean distance between the two given points. - /// The first point. - /// The second point. - /// The distance. - [MethodImpl((MethodImplOptions) 768)] - public static T Distance(Vector3D value1, Vector3D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Sqrt(DistanceSquared(value1, value2)); - - /// Returns the Euclidean distance squared between the two given points. - /// The first point. - /// The second point. - /// The distance squared. - [MethodImpl((MethodImplOptions) 768)] - public static T DistanceSquared(Vector3D value1, Vector3D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - var difference = value1 - value2; - return Dot(difference, difference); - } - - /// Divides the first vector by the second. - /// The first source vector. - /// The second source vector. - /// The vector resulting from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Divide(Vector3D left, Vector3D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left / right; - - /// Divides the vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The result of the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Divide(Vector3D left, T divisor) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left / divisor; - - /// Returns the dot product of two vectors. - /// The first vector. - /// The second vector. - /// The dot product. - [MethodImpl((MethodImplOptions) 768)] - public static T Dot(Vector3D vector1, Vector3D vector2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Add( - Scalar.Add(Scalar.Multiply(vector1.X, vector2.X), - Scalar.Multiply(vector1.Y, vector2.Y)), - Scalar.Multiply(vector1.Z, vector2.Z)); - - /// Linearly interpolates between two vectors based on the given weighting. - /// The first source vector. - /// The second source vector. - /// Value between 0 and 1 indicating the weight of the second source vector. - /// The interpolated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Lerp(Vector3D value1, Vector3D value2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return (value1 * Scalar.Subtract(Scalar.One, amount) + (value2 * amount)); - } - - /// Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors. - /// The first source vector. - /// The second source vector. - /// The maximized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Max(Vector3D value1, Vector3D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Max(value1.X, value2.X), Scalar.Max(value1.Y, value2.Y), - Scalar.Max(value1.Z, value2.Z)); - - /// Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors. - /// The first source vector. - /// The second source vector. - /// The minimized vector. - public static Vector3D Min(Vector3D value1, Vector3D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Min(value1.X, value2.X), Scalar.Min(value1.Y, value2.Y), - Scalar.Min(value1.Z, value2.Z)); - - /// Multiplies two vectors together. - /// The first source vector. - /// The second source vector. - /// The product vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector3D left, Vector3D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left * right; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector3D value1, Matrix3X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector3D value1, Matrix3X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector3D value1, Matrix3X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector3D left, T right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left * right; - - /// Multiplies a vector by the given scalar. - /// The scalar value. - /// The source vector. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(T left, Vector3D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left * right; - - /// Negates a given vector. - /// The source vector. - /// The negated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Negate(Vector3D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Returns a vector with the same direction as the given vector, but with a length of 1. - /// The vector to normalize. - /// The normalized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Normalize(Vector3D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value / value.Length; - - /// Returns the reflection of a vector off a surface that has the specified normal. - /// The source vector. - /// The normal of the surface being reflected off. - /// The reflected vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Reflect(Vector3D vector, Vector3D normal) - where T : unmanaged, IFormattable, IEquatable, IComparable - => vector - (Scalar.Multiply(Scalar.Two, Dot(vector, normal)) * normal); - - /// Returns a vector whose elements are the square root of each of the source vector's elements. - /// The source vector. - /// The square root vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D SquareRoot(Vector3D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Sqrt(value.X), Scalar.Sqrt(value.Y), Scalar.Sqrt(value.Z)); - - /// Subtracts the second vector from the first. - /// The first source vector. - /// The second source vector. - /// The difference vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Subtract(Vector3D left, Vector3D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left - right; - - - /// Transforms a vector by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Transform(Vector3D position, Matrix4X4 matrix) // TODO: Matrix4X3 - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M11), Scalar.Multiply(position.Y, matrix.M21)), Scalar.Multiply(position.Z, matrix.M31)), matrix.M41), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M12), Scalar.Multiply(position.Y, matrix.M22)), Scalar.Multiply(position.Z, matrix.M32)), matrix.M42), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M13), Scalar.Multiply(position.Y, matrix.M23)), Scalar.Multiply(position.Z, matrix.M33)), matrix.M43) - ); - } - - /// Transforms a vector by the given Quaternion rotation value. - /// The source vector to be rotated. - /// The rotation to apply. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Transform(Vector3D value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - // TODO: Vectorize - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2)), Scalar.Multiply(value.Y, Scalar.Subtract(xy2, wz2))), Scalar.Multiply(value.Z, Scalar.Add(xz2, wy2))), - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Add(xy2, wz2)), Scalar.Multiply(value.Y, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2))), Scalar.Multiply(value.Z, Scalar.Subtract(yz2, wx2))), - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(xz2, wy2)), Scalar.Multiply(value.Y, Scalar.Add(yz2, wx2))), Scalar.Multiply(value.Z, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2))) - ); - } - - - - /// Transforms a vector normal by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D TransformNormal(Vector3D normal, Matrix4X4 matrix) // TODO: Matrix3X3 - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(normal.X, matrix.M11), Scalar.Multiply(normal.Y, matrix.M21)), Scalar.Multiply(normal.Z, matrix.M31)), - Scalar.Add(Scalar.Add(Scalar.Multiply(normal.X, matrix.M12), Scalar.Multiply(normal.Y, matrix.M22)), Scalar.Multiply(normal.Z, matrix.M32)), - Scalar.Add(Scalar.Add(Scalar.Multiply(normal.X, matrix.M13), Scalar.Multiply(normal.Y, matrix.M23)), Scalar.Multiply(normal.Z, matrix.M33)) - ); - } + /// Computes the cross product of two vectors. + public static Vector3D Cross(Vector3D left, Vector3D right) + where T : INumberBase => + new Vector3D( + (left.Y * right.Z) - (left.Z * right.Y), + (left.Z * right.X) - (left.X * right.Z), + (left.X * right.Y) - (left.Y * right.X)); } -} \ No newline at end of file +} diff --git a/sources/Maths/Maths/Vector3D.Ops.gen.cs b/sources/Maths/Maths/Vector3D.Ops.gen.cs new file mode 100644 index 0000000000..cf50b96a4a --- /dev/null +++ b/sources/Maths/Maths/Vector3D.Ops.gen.cs @@ -0,0 +1,722 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Vector3D + { + /// Extensions for vectors with elements implementing . + extension(Vector3D vector) + where T : IRootFunctions + { + /// Gets the length of the vector. + public T Length => T.Sqrt(vector.LengthSquared); + } + + /// Extensions for vectors with elements implementing . + extension(Vector3D vector) + where T : INumberBase + { + /// Gets the length squared of the vector. + public T LengthSquared => Vector3D.Dot(vector, vector); + } + + /// Desconstructs a vector into its components. + /// The vector to deconstruct. + /// The X component. + /// The Y component. + /// The Z component. + public static void Deconstruct(this Vector3D vector, out T x, out T y, out T z) + where T : INumberBase + { + x = vector.X; + y = vector.Y; + z = vector.Z; + } + + /// Computes the dot product of two vectors. + public static T Dot(Vector3D left, Vector3D right) + where T : INumberBase => + left.X * right.X + left.Y * right.Y + left.Z * right.Z; + + /// Reflects a vector over a normal vector. + public static Vector3D Reflect(Vector3D vector, Vector3D normal) + where T : INumberBase + { + T dot = Dot(vector, normal); + return vector - (normal * (dot + dot)); + } + + /// Normalizes a vector. + public static Vector3D Normalize(this Vector3D vector) + where T : IRootFunctions + { + T length = vector.Length; + return length != T.Zero ? vector / length : Vector3D.Zero; + } + + /// Returns the Euclidean distance between the two given points. + /// The first point. + /// The second point. + /// The distance. + public static T Distance(Vector3D value1, Vector3D value2) + where T : IRootFunctions => + T.Sqrt(DistanceSquared(value1, value2)); + + /// Returns the Euclidean distance squared between the two given points. + /// The first point. + /// The second point. + /// The distance squared. + public static T DistanceSquared(Vector3D value1, Vector3D value2) + where T : INumberBase + { + var difference = value1 - value2; + return Dot(difference, difference); + } + + /// Linearly interpolates between two vectors using a scalar t-value (clamped between 0 and 1). + public static Vector3D LerpClamped(Vector3D a, Vector3D b, T amount) + where T : IFloatingPointIeee754 => + Lerp(a, b, T.Clamp(amount, T.Zero, T.One)); + + /// Linearly interpolates between two vectors using a vector t-value (clamped between 0 and 1). + public static Vector3D LerpClamped(Vector3D a, Vector3D b, Vector3D amount) + where T : IFloatingPointIeee754 => + new(T.Lerp(a.X, b.X, T.Clamp(amount.X, T.Zero, T.One)), + T.Lerp(a.Y, b.Y, T.Clamp(amount.Y, T.Zero, T.One)), + T.Lerp(a.Z, b.Z, T.Clamp(amount.Z, T.Zero, T.One))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static (Vector3D Sin, Vector3D Cos) SinCos(Vector3D x) + where T : ITrigonometricFunctions => + (new(T.Sin(x.X), T.Sin(x.Y), T.Sin(x.Z)), new(T.Cos(x.X), T.Cos(x.Y), T.Cos(x.Z))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static (Vector3D SinPi, Vector3D CosPi) SinCosPi(Vector3D x) + where T : ITrigonometricFunctions => + (new(T.SinPi(x.X), T.SinPi(x.Y), T.SinPi(x.Z)), new(T.CosPi(x.X), T.CosPi(x.Y), T.CosPi(x.Z))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static (Vector3D Quotient, Vector3D Remainder) DivRem(Vector3D left, Vector3D right) + where T : IBinaryInteger + { + var (qX, rX) = T.DivRem(left.X, right.X); + var (qY, rY) = T.DivRem(left.Y, right.Y); + var (qZ, rZ) = T.DivRem(left.Z, right.Z); + return (new Vector3D(qX, qY, qZ), new Vector3D(rX, rY, rZ)); + } + + /// Multiplies a vector by a scalar value. + /// The source vector. + /// The scaling factor. + /// The scaled vector. + public static Vector3D Multiply(Vector3D left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a vector by a scalar value. + /// The scaling factor. + /// The source vector. + /// The scaled vector. + public static Vector3D Multiply(T left, Vector3D right) + where T : INumberBase => + left * right; + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Sign(Vector3D value) + where TSelf : INumber => + new(TSelf.Sign(value.X), TSelf.Sign(value.Y), TSelf.Sign(value.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Max(Vector3D x, Vector3D y) + where TSelf : INumber => + new(TSelf.Max(x.X, y.X), TSelf.Max(x.Y, y.Y), TSelf.Max(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Max(Vector3D x, TSelf y) + where TSelf : INumber => + new(TSelf.Max(x.X, y), TSelf.Max(x.Y, y), TSelf.Max(x.Z, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MaxNumber(Vector3D x, Vector3D y) + where TSelf : INumber => + new(TSelf.MaxNumber(x.X, y.X), TSelf.MaxNumber(x.Y, y.Y), TSelf.MaxNumber(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D MaxNumber(Vector3D x, TSelf y) + where TSelf : INumber => + new(TSelf.MaxNumber(x.X, y), TSelf.MaxNumber(x.Y, y), TSelf.MaxNumber(x.Z, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Min(Vector3D x, Vector3D y) + where TSelf : INumber => + new(TSelf.Min(x.X, y.X), TSelf.Min(x.Y, y.Y), TSelf.Min(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Min(Vector3D x, TSelf y) + where TSelf : INumber => + new(TSelf.Min(x.X, y), TSelf.Min(x.Y, y), TSelf.Min(x.Z, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MinNumber(Vector3D x, Vector3D y) + where TSelf : INumber => + new(TSelf.MinNumber(x.X, y.X), TSelf.MinNumber(x.Y, y.Y), TSelf.MinNumber(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D MinNumber(Vector3D x, TSelf y) + where TSelf : INumber => + new(TSelf.MinNumber(x.X, y), TSelf.MinNumber(x.Y, y), TSelf.MinNumber(x.Z, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Clamp(Vector3D value, Vector3D min, Vector3D max) + where TSelf : INumber => + new(TSelf.Clamp(value.X, min.X, max.X), TSelf.Clamp(value.Y, min.Y, max.Y), TSelf.Clamp(value.Z, min.Z, max.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector3D Clamp(Vector3D value, TSelf min, TSelf max) + where TSelf : INumber => + new(TSelf.Clamp(value.X, min, max), TSelf.Clamp(value.Y, min, max), TSelf.Clamp(value.Z, min, max)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D CopySign(Vector3D value, Vector3D sign) + where TSelf : INumber => + new(TSelf.CopySign(value.X, sign.X), TSelf.CopySign(value.Y, sign.Y), TSelf.CopySign(value.Z, sign.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D CopySign(Vector3D value, TSelf sign) + where TSelf : INumber => + new(TSelf.CopySign(value.X, sign), TSelf.CopySign(value.Y, sign), TSelf.CopySign(value.Z, sign)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Abs(Vector3D value) + where TSelf : INumberBase => + new(TSelf.Abs(value.X), TSelf.Abs(value.Y), TSelf.Abs(value.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MaxMagnitude(Vector3D x, Vector3D y) + where TSelf : INumberBase => + new(TSelf.MaxMagnitude(x.X, y.X), TSelf.MaxMagnitude(x.Y, y.Y), TSelf.MaxMagnitude(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MaxMagnitudeNumber(Vector3D x, Vector3D y) + where TSelf : INumberBase => + new(TSelf.MaxMagnitudeNumber(x.X, y.X), TSelf.MaxMagnitudeNumber(x.Y, y.Y), TSelf.MaxMagnitudeNumber(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MinMagnitude(Vector3D x, Vector3D y) + where TSelf : INumberBase => + new(TSelf.MinMagnitude(x.X, y.X), TSelf.MinMagnitude(x.Y, y.Y), TSelf.MinMagnitude(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MinMagnitudeNumber(Vector3D x, Vector3D y) + where TSelf : INumberBase => + new(TSelf.MinMagnitudeNumber(x.X, y.X), TSelf.MinMagnitudeNumber(x.Y, y.Y), TSelf.MinMagnitudeNumber(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D MultiplyAddEstimate(Vector3D left, Vector3D right, Vector3D addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right.X, addend.X), TSelf.MultiplyAddEstimate(left.Y, right.Y, addend.Y), TSelf.MultiplyAddEstimate(left.Z, right.Z, addend.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D MultiplyAddEstimate(Vector3D left, Vector3D right, TSelf addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right.X, addend), TSelf.MultiplyAddEstimate(left.Y, right.Y, addend), TSelf.MultiplyAddEstimate(left.Z, right.Z, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A vector whose members will be provided for . + public static Vector3D MultiplyAddEstimate(Vector3D left, TSelf right, Vector3D addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right, addend.X), TSelf.MultiplyAddEstimate(left.Y, right, addend.Y), TSelf.MultiplyAddEstimate(left.Z, right, addend.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector3D MultiplyAddEstimate(Vector3D left, TSelf right, TSelf addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right, addend), TSelf.MultiplyAddEstimate(left.Y, right, addend), TSelf.MultiplyAddEstimate(left.Z, right, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D PopCount(Vector3D value) + where TSelf : IBinaryInteger => + new(TSelf.PopCount(value.X), TSelf.PopCount(value.Y), TSelf.PopCount(value.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D TrailingZeroCount(Vector3D value) + where TSelf : IBinaryInteger => + new(TSelf.TrailingZeroCount(value.X), TSelf.TrailingZeroCount(value.Y), TSelf.TrailingZeroCount(value.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Ceiling(Vector3D x) + where TSelf : IFloatingPoint => + new(TSelf.Ceiling(x.X), TSelf.Ceiling(x.Y), TSelf.Ceiling(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Floor(Vector3D x) + where TSelf : IFloatingPoint => + new(TSelf.Floor(x.X), TSelf.Floor(x.Y), TSelf.Floor(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Round(Vector3D x) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X), TSelf.Round(x.Y), TSelf.Round(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Round(Vector3D x, int digits) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, digits), TSelf.Round(x.Y, digits), TSelf.Round(x.Z, digits)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Round(Vector3D x, MidpointRounding mode) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, mode), TSelf.Round(x.Y, mode), TSelf.Round(x.Z, mode)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector3D Round(Vector3D x, int digits, MidpointRounding mode) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, digits, mode), TSelf.Round(x.Y, digits, mode), TSelf.Round(x.Z, digits, mode)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Truncate(Vector3D x) + where TSelf : IFloatingPoint => + new(TSelf.Truncate(x.X), TSelf.Truncate(x.Y), TSelf.Truncate(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Atan2(Vector3D y, Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Atan2(y.X, x.X), TSelf.Atan2(y.Y, x.Y), TSelf.Atan2(y.Z, x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Atan2Pi(Vector3D y, Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Atan2Pi(y.X, x.X), TSelf.Atan2Pi(y.Y, x.Y), TSelf.Atan2Pi(y.Z, x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Lerp(Vector3D value1, Vector3D value2, TSelf amount) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Lerp(value1.X, value2.X, amount), TSelf.Lerp(value1.Y, value2.Y, amount), TSelf.Lerp(value1.Z, value2.Z, amount)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D BitDecrement(Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.BitDecrement(x.X), TSelf.BitDecrement(x.Y), TSelf.BitDecrement(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D BitIncrement(Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.BitIncrement(x.X), TSelf.BitIncrement(x.Y), TSelf.BitIncrement(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D FusedMultiplyAdd(Vector3D left, Vector3D right, Vector3D addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right.X, addend.X), TSelf.FusedMultiplyAdd(left.Y, right.Y, addend.Y), TSelf.FusedMultiplyAdd(left.Z, right.Z, addend.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D FusedMultiplyAdd(Vector3D left, Vector3D right, TSelf addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right.X, addend), TSelf.FusedMultiplyAdd(left.Y, right.Y, addend), TSelf.FusedMultiplyAdd(left.Z, right.Z, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A vector whose members will be provided for . + public static Vector3D FusedMultiplyAdd(Vector3D left, TSelf right, Vector3D addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right, addend.X), TSelf.FusedMultiplyAdd(left.Y, right, addend.Y), TSelf.FusedMultiplyAdd(left.Z, right, addend.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector3D FusedMultiplyAdd(Vector3D left, TSelf right, TSelf addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right, addend), TSelf.FusedMultiplyAdd(left.Y, right, addend), TSelf.FusedMultiplyAdd(left.Z, right, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Ieee754Remainder(Vector3D left, Vector3D right) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Ieee754Remainder(left.X, right.X), TSelf.Ieee754Remainder(left.Y, right.Y), TSelf.Ieee754Remainder(left.Z, right.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Ieee754Remainder(Vector3D left, TSelf right) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Ieee754Remainder(left.X, right), TSelf.Ieee754Remainder(left.Y, right), TSelf.Ieee754Remainder(left.Z, right)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D ILogB(Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ILogB(x.X), TSelf.ILogB(x.Y), TSelf.ILogB(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D ReciprocalEstimate(Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ReciprocalEstimate(x.X), TSelf.ReciprocalEstimate(x.Y), TSelf.ReciprocalEstimate(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D ReciprocalSqrtEstimate(Vector3D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ReciprocalSqrtEstimate(x.X), TSelf.ReciprocalSqrtEstimate(x.Y), TSelf.ReciprocalSqrtEstimate(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D ScaleB(Vector3D x, Vector3D n) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ScaleB(x.X, n.X), TSelf.ScaleB(x.Y, n.Y), TSelf.ScaleB(x.Z, n.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D ScaleB(Vector3D x, int n) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ScaleB(x.X, n), TSelf.ScaleB(x.Y, n), TSelf.ScaleB(x.Z, n)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Pow(Vector3D x, Vector3D y) + where TSelf : IPowerFunctions => + new(TSelf.Pow(x.X, y.X), TSelf.Pow(x.Y, y.Y), TSelf.Pow(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Pow(Vector3D x, TSelf y) + where TSelf : IPowerFunctions => + new(TSelf.Pow(x.X, y), TSelf.Pow(x.Y, y), TSelf.Pow(x.Z, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Cbrt(Vector3D x) + where TSelf : IRootFunctions => + new(TSelf.Cbrt(x.X), TSelf.Cbrt(x.Y), TSelf.Cbrt(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Sqrt(Vector3D x) + where TSelf : IRootFunctions => + new(TSelf.Sqrt(x.X), TSelf.Sqrt(x.Y), TSelf.Sqrt(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D RootN(Vector3D x, int n) + where TSelf : IRootFunctions => + new(TSelf.RootN(x.X, n), TSelf.RootN(x.Y, n), TSelf.RootN(x.Z, n)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D RootN(Vector3D x, Vector3D n) + where TSelf : IRootFunctions => + new(TSelf.RootN(x.X, n.X), TSelf.RootN(x.Y, n.Y), TSelf.RootN(x.Z, n.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Hypot(Vector3D x, Vector3D y) + where TSelf : IRootFunctions => + new(TSelf.Hypot(x.X, y.X), TSelf.Hypot(x.Y, y.Y), TSelf.Hypot(x.Z, y.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Hypot(Vector3D x, TSelf y) + where TSelf : IRootFunctions => + new(TSelf.Hypot(x.X, y), TSelf.Hypot(x.Y, y), TSelf.Hypot(x.Z, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Log(Vector3D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X), TSelf.Log(x.Y), TSelf.Log(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector3D Log(Vector3D x, Vector3D newBase) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X, newBase.X), TSelf.Log(x.Y, newBase.Y), TSelf.Log(x.Z, newBase.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector3D Log(Vector3D x, TSelf newBase) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X, newBase), TSelf.Log(x.Y, newBase), TSelf.Log(x.Z, newBase)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D LogP1(Vector3D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.LogP1(x.X), TSelf.LogP1(x.Y), TSelf.LogP1(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Log2(Vector3D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log2(x.X), TSelf.Log2(x.Y), TSelf.Log2(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Log2P1(Vector3D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log2P1(x.X), TSelf.Log2P1(x.Y), TSelf.Log2P1(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Log10(Vector3D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log10(x.X), TSelf.Log10(x.Y), TSelf.Log10(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Log10P1(Vector3D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log10P1(x.X), TSelf.Log10P1(x.Y), TSelf.Log10P1(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Exp(Vector3D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp(x.X), TSelf.Exp(x.Y), TSelf.Exp(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D ExpM1(Vector3D x) + where TSelf : IExponentialFunctions => + new(TSelf.ExpM1(x.X), TSelf.ExpM1(x.Y), TSelf.ExpM1(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Exp2(Vector3D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp2(x.X), TSelf.Exp2(x.Y), TSelf.Exp2(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Exp2M1(Vector3D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp2M1(x.X), TSelf.Exp2M1(x.Y), TSelf.Exp2M1(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Exp10(Vector3D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp10(x.X), TSelf.Exp10(x.Y), TSelf.Exp10(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Exp10M1(Vector3D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp10M1(x.X), TSelf.Exp10M1(x.Y), TSelf.Exp10M1(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Acos(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Acos(x.X), TSelf.Acos(x.Y), TSelf.Acos(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D AcosPi(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AcosPi(x.X), TSelf.AcosPi(x.Y), TSelf.AcosPi(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Asin(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Asin(x.X), TSelf.Asin(x.Y), TSelf.Asin(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D AsinPi(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AsinPi(x.X), TSelf.AsinPi(x.Y), TSelf.AsinPi(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Atan(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Atan(x.X), TSelf.Atan(x.Y), TSelf.Atan(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D AtanPi(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AtanPi(x.X), TSelf.AtanPi(x.Y), TSelf.AtanPi(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Cos(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Cos(x.X), TSelf.Cos(x.Y), TSelf.Cos(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D CosPi(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.CosPi(x.X), TSelf.CosPi(x.Y), TSelf.CosPi(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Sin(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Sin(x.X), TSelf.Sin(x.Y), TSelf.Sin(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D SinPi(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.SinPi(x.X), TSelf.SinPi(x.Y), TSelf.SinPi(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Tan(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Tan(x.X), TSelf.Tan(x.Y), TSelf.Tan(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D TanPi(Vector3D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.TanPi(x.X), TSelf.TanPi(x.Y), TSelf.TanPi(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D DegreesToRadians(Vector3D degrees) + where TSelf : ITrigonometricFunctions => + new(TSelf.DegreesToRadians(degrees.X), TSelf.DegreesToRadians(degrees.Y), TSelf.DegreesToRadians(degrees.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D RadiansToDegrees(Vector3D radians) + where TSelf : ITrigonometricFunctions => + new(TSelf.RadiansToDegrees(radians.X), TSelf.RadiansToDegrees(radians.Y), TSelf.RadiansToDegrees(radians.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Acosh(Vector3D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Acosh(x.X), TSelf.Acosh(x.Y), TSelf.Acosh(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Asinh(Vector3D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Asinh(x.X), TSelf.Asinh(x.Y), TSelf.Asinh(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Atanh(Vector3D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Atanh(x.X), TSelf.Atanh(x.Y), TSelf.Atanh(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Cosh(Vector3D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Cosh(x.X), TSelf.Cosh(x.Y), TSelf.Cosh(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Sinh(Vector3D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Sinh(x.X), TSelf.Sinh(x.Y), TSelf.Sinh(x.Z)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector3D Tanh(Vector3D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Tanh(x.X), TSelf.Tanh(x.Y), TSelf.Tanh(x.Z)); + } +} diff --git a/sources/Maths/Maths/Vector3D.cs b/sources/Maths/Maths/Vector3D.cs deleted file mode 100644 index 486057d3f7..0000000000 --- a/sources/Maths/Maths/Vector3D.cs +++ /dev/null @@ -1,383 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text; - -namespace Silk.NET.Maths -{ - /// A structure encapsulating three values and provides hardware accelerated methods. - [Serializable] - [DataContract] - public struct Vector3D - : IEquatable>, IFormattable - where T : unmanaged, IFormattable, IEquatable, IComparable - { - /// The X component of the vector. - [DataMember] - public T X; - - /// The Y component of the vector. - [DataMember] - public T Y; - - /// The Z component of the vector. - [DataMember] - public T Z; - - /// Constructs a vector whose elements are all the single specified value. - /// The element to fill the vector with. - public Vector3D(T value) => (X, Y, Z) = (value, value, value); - - /// Constructs a from the given and a third value. - /// The Vector to extract X and Y components from. - /// The Z component. - public Vector3D(Vector2D value, T z) => (X, Y, Z) = (value.X, value.Y, z); - - /// Constructs a vector with the given individual elements. - /// The X component. - /// The Y component. - /// The Z component. - public Vector3D(T x, T y, T z) => (X, Y, Z) = (x, y, z); - - /// Returns the vector (0,0,0). - public static Vector3D Zero => default; - - /// Returns the vector (1,1,1). - public static Vector3D One => new(Scalar.One); - - /// Returns the vector (1,0,0). - public static Vector3D UnitX => new(Scalar.One, Scalar.Zero, Scalar.Zero); - - /// Returns the vector (0,1,0). - public static Vector3D UnitY => new(Scalar.Zero, Scalar.One, Scalar.Zero); - - /// Returns the vector (0,0,1). - public static Vector3D UnitZ => new(Scalar.Zero, Scalar.Zero, Scalar.One); - - /// - /// Indexer for the components of this vector. - /// - /// The component to select. Zero based. - public T this[int i] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 2 || i < 0) - ThrowHelper(); - } - - VerifyBounds(i); - return Unsafe.Add(ref X, i); - } - } - - /// Adds two vectors together. - /// The first source vector. - /// The second source vector. - /// The summed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator +(Vector3D left, Vector3D right) - => new(Scalar.Add(left.X, right.X), Scalar.Add(left.Y, right.Y), Scalar.Add(left.Z, right.Z)); - - /// Divides the first vector by the second. - /// The first source vector. - /// The second source vector. - /// The vector resulting from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator /(Vector3D left, Vector3D right) - => new(Scalar.Divide(left.X, right.X), Scalar.Divide(left.Y, right.Y), - Scalar.Divide(left.Z, right.Z)); - - /// Divides the vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The result of the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator /(Vector3D value1, T value2) - => new(Scalar.Divide(value1.X, value2), Scalar.Divide(value1.Y, value2), - Scalar.Divide(value1.Z, value2)); - - /// Returns a boolean indicating whether the two given vectors are equal. - /// The first vector to compare. - /// The second vector to compare. - /// True if the vectors are equal; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public static bool operator ==(Vector3D left, Vector3D right) - => Scalar.Equal(left.X, right.X) - && Scalar.Equal(left.Y, right.Y) - && Scalar.Equal(left.Z, right.Z); - - /// Returns a boolean indicating whether the two given vectors are not equal. - /// The first vector to compare. - /// The second vector to compare. - /// True if the vectors are not equal; False if they are equal. - [MethodImpl((MethodImplOptions) 768)] - public static bool operator !=(Vector3D left, Vector3D right) => !(left == right); - - /// Multiplies two vectors together. - /// The first source vector. - /// The second source vector. - /// The product vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator *(Vector3D left, Vector3D right) - => new(Scalar.Multiply(left.X, right.X), Scalar.Multiply(left.Y, right.Y), - Scalar.Multiply(left.Z, right.Z)); - - /// Multiplies a vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator *(Vector3D left, T right) - => new(Scalar.Multiply(left.X, right), Scalar.Multiply(left.Y, right), - Scalar.Multiply(left.Z, right)); - - /// Multiplies a vector by the given scalar. - /// The scalar value. - /// The source vector. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator *(T left, Vector3D right) - => right * left; - - /// Subtracts the second vector from the first. - /// The first source vector. - /// The second source vector. - /// The difference vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator -(Vector3D left, Vector3D right) - => new(Scalar.Subtract(left.X, right.X), Scalar.Subtract(left.Y, right.Y), - Scalar.Subtract(left.Z, right.Z)); - - /// Negates a given vector. - /// The source vector. - /// The negated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D operator -(Vector3D value) - => Zero - value; - - /// Copies the contents of the vector into the given array. - [MethodImpl((MethodImplOptions) 768)] - public readonly void CopyTo(T[]? array) - => CopyTo(array, 0); - - /// Copies the contents of the vector into the given array, starting from index. - /// If array is null. - /// If array is multidimensional. - /// If index is greater than end of the array or index is less than zero. - /// If number of elements in source vector is greater than those available in destination array. - [MethodImpl((MethodImplOptions) 768)] - public readonly void CopyTo(T[]? array, int index) - { - if (array is null) - { - throw new NullReferenceException("Object reference not set to an instance of an object."); - } - - if ((index < 0) || (index >= array.Length)) - { - throw new ArgumentOutOfRangeException(nameof(index), "Specified argument was out of the range of valid values."); - } - - if ((array.Length - index) < 3) - { - throw new ArgumentException("Value does not fall within the expected range."); - } - - array[index] = X; - array[index + 1] = Y; - array[index + 2] = Z; - } - - /// Returns a boolean indicating whether the given Object is equal to this instance. - /// The Object to compare against. - /// True if the Object is equal to this Vector3D; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - { - return (obj is Vector3D other) && Equals(other); - } - - /// Returns a boolean indicating whether the given is equal to this instance. - /// The to compare this instance to. - /// True if the other is equal to this instance; False otherwise. - public readonly bool Equals(Vector3D other) - { - return this == other; - } - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - { - return HashCode.Combine(X, Y, Z); - } - - /// Returns the length of the vector. - /// The vector's length. - public T Length - { - [MethodImpl((MethodImplOptions) 768)] - get => Scalar.Sqrt(LengthSquared); - } - - /// Returns the length of the vector squared. This operation is cheaper than Length(). - /// The vector's length squared. - public T LengthSquared - { - [MethodImpl((MethodImplOptions) 768)] - get => Vector3D.Dot(this, this); - } - - /// Returns a String representing this instance. - /// The string representation. - public override readonly string ToString() => ToString("G", CultureInfo.CurrentCulture); - - /// Returns a String representing this instance, using the specified format to format individual elements. - /// The format of individual elements. - /// The string representation. - public readonly string ToString(string? format) => ToString(format, CultureInfo.CurrentCulture); - - /// Returns a String representing this instance, using the specified format to format individual elements and the given IFormatProvider. - /// The format of individual elements. - /// The format provider to use when formatting elements. - /// The string representation. - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - sb.Append('<'); - sb.Append(X.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(Y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(Z.ToString(format, formatProvider)); - sb.Append('>'); - return sb.ToString(); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into - /// - /// The source vector - /// The vector - public static explicit operator System.Numerics.Vector3(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector3D(Vector3D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z)); - - /// - /// Returns this vector casted to - /// - /// The type to cast to - /// The casted vector - public Vector3D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Scalar.As(X), Scalar.As(Y), Scalar.As(Z)); - } - } -} diff --git a/sources/Maths/Maths/Vector3D.gen.cs b/sources/Maths/Maths/Vector3D.gen.cs new file mode 100644 index 0000000000..73b7c614e0 --- /dev/null +++ b/sources/Maths/Maths/Vector3D.gen.cs @@ -0,0 +1,691 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.CompilerServices; + using System.Runtime.InteropServices; + using System.Text; + + /// A structure encapsulating a 3D vector. + public partial struct Vector3D : + IEquatable>, + IReadOnlyList, + IFormattable, + IParsable>, + ISpanFormattable, + ISpanParsable>, + IUtf8SpanFormattable, + IUtf8SpanParsable> + where T : INumberBase + { + /// Gets a vector whose 3 elements are equal to one. + public static Vector3D One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.One); + } + + /// Returns a vector whose 3 elements are equal to zero. + public static Vector3D Zero + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero); + } + + /// Gets the vector (1, 0, 0). + public static Vector3D UnitX + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.One, T.Zero, T.Zero); + } + + /// Gets the vector (0, 1, 0). + public static Vector3D UnitY + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero, T.One, T.Zero); + } + + /// Gets the vector (0, 0, 1). + public static Vector3D UnitZ + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero, T.Zero, T.One); + } + + /// The X component of the vector. + public T X; + + /// The Y component of the vector. + public T Y; + + /// The Z component of the vector. + public T Z; + + /// The number of elements in the vector. + public int Count => 3; + + /// + T IReadOnlyList.this[int index] => this[index]; + + ///Gets the component at the specified index: 0 = X, 1 = Y, 2 = Z. + [UnscopedRef] + public ref T this[int index] + { + get + { + switch (index) + { + case 0: + return ref X; + case 1: + return ref Y; + case 2: + return ref Z; + } + + throw new ArgumentOutOfRangeException(nameof(index)); + } + } + + /// Initializes all components of the vector to the same value. + public Vector3D(T value) => (X, Y, Z) = (value, value, value); + + /// Initializes the vector with individual component values. + public Vector3D(T x, T y, T z) => (X, Y, Z) = (x, y, z); + + /// Initializes the vector using a for the initial elements, and the specified component for the remainder. + public Vector3D(Vector2D other, T z) => (X, Y, Z) = (other.X, other.Y, z); + + /// Initializes the vector from a span of 3 values. + public Vector3D(ReadOnlySpan values) + { + if (values.Length != 3) + throw new ArgumentException("Input span must contain exactly 3 elements.", nameof(values)); + + X = values[0]; + Y = values[1]; + Z = values[2]; + } + + /// + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + /// Returns an enumerator that iterates through the vector components. + public IEnumerator GetEnumerator() + { + yield return X; + yield return Y; + yield return Z; + } + + /// Copies the components of the vector to the specified array starting at index 0. + public void CopyTo(T[] array) => CopyTo(array, 0); + + /// Copies the components of the vector to the specified array starting at the given index. + public void CopyTo(T[] array, int startIndex) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + if (startIndex < 0 || startIndex + 3 > array.Length) + throw new ArgumentOutOfRangeException(nameof(startIndex)); + + array[startIndex] = X; + array[startIndex + 1] = Y; + array[startIndex + 2] = Z; + } + + /// Copies the components of the vector to the specified span starting at index 0. + public void CopyTo(Span span) => CopyTo(span, 0); + + /// Copies the components of the vector to the specified span starting at the given index. + public void CopyTo(Span span, int startIndex) + { + if (startIndex < 0 || startIndex + 3 > span.Length) + throw new ArgumentOutOfRangeException(nameof(startIndex)); + + span[startIndex] = X; + span[startIndex + 1] = Y; + span[startIndex + 2] = Z; + } + + /// Returns a span over the vector components. + public Span AsSpan() => MemoryMarshal.CreateSpan(ref X, 3); + + /// Formats the vector as a string. + public override string ToString() => + $"<{X}, {Y}, {Z}>"; + + /// Formats the vector as a string using the specified format and format provider. + public string ToString(string? format, IFormatProvider? formatProvider) => + $"<{X.ToString(format, formatProvider)}, {Y.ToString(format, formatProvider)}, {Z.ToString(format, formatProvider)}>"; + + /// Parses a string to a instance. + public static Vector3D Parse(string s, IFormatProvider? provider) => Parse(s.AsSpan(), provider); + + /// Parses a span to a instance. + public static Vector3D Parse(ReadOnlySpan s, IFormatProvider? provider) + { + if (!TryParse(s, provider, out var result)) + throw new FormatException("Invalid format for Vector3D."); + + return result; + } + + /// Formats the vector as a UTF-8 string using the specified format and format provider. + public bool TryFormat(Span utf8Destination, out int bytesWritten, ReadOnlySpan format, IFormatProvider? provider) + { + Span xBuffer = stackalloc char[64]; + Span yBuffer = stackalloc char[64]; + Span zBuffer = stackalloc char[64]; + + if (!X.TryFormat(xBuffer, out int xChars, format, provider)|| + !Y.TryFormat(yBuffer, out int yChars, format, provider)|| + !Z.TryFormat(zBuffer, out int zChars, format, provider)) + { + bytesWritten = 0; + return false; + } + + int estimatedSize = Encoding.UTF8.GetByteCount(xBuffer[..xChars]) + + Encoding.UTF8.GetByteCount(yBuffer[..yChars]) + + Encoding.UTF8.GetByteCount(zBuffer[..zChars]) + + Encoding.UTF8.GetByteCount("<, >"); + + if (utf8Destination.Length < estimatedSize) + { + bytesWritten = 0; + return false; + } + + int totalBytes = 0; + + totalBytes += Encoding.UTF8.GetBytes("<", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(xBuffer[..xChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(", ", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(yBuffer[..yChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(", ", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(zBuffer[..zChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(">", utf8Destination[totalBytes..]); + + bytesWritten = totalBytes; + return true; + } + + /// Formats the vector as a string using the specified format and format provider. + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider? provider) + { + Span xBuffer = stackalloc char[64]; + Span yBuffer = stackalloc char[64]; + Span zBuffer = stackalloc char[64]; + + if (!X.TryFormat(xBuffer, out int xChars, format, provider) || + !Y.TryFormat(yBuffer, out int yChars, format, provider) || + !Z.TryFormat(zBuffer, out int zChars, format, provider)) + { + charsWritten = 0; + return false; + } + + int requiredLength = 1 + xChars + 2 + yChars + 2 + zChars + 1; + + if (destination.Length < requiredLength) + { + charsWritten = 0; + return false; + } + + int pos = 0; + destination[pos++] = '<'; + + xBuffer[..xChars].CopyTo(destination[pos..]); + pos += xChars; + + destination[pos++] = ','; + destination[pos++] = ' '; + + yBuffer[..yChars].CopyTo(destination[pos..]); + pos += yChars; + + destination[pos++] = ','; + destination[pos++] = ' '; + + zBuffer[..zChars].CopyTo(destination[pos..]); + pos += zChars; + + destination[pos++] = '>'; + + charsWritten = pos; + return true; + } + + /// Tries to parse a span to a instance. + public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector3D result) + { + result = default; + + s = s.Trim(); + if (s.Length < 6 || s[0] != '<' || s[^1] != '>') + return false; + + s = s[1..^1]; // Remove < and > + + int commaX = s.IndexOf(','); + if (commaX < 0) + return false; + + ReadOnlySpan remainder1 = s.Slice(commaX + 1); + int commaYRelative = remainder1.IndexOf(','); + if (commaYRelative < 0) + return false; + int commaY = commaX + 1 + commaYRelative; + + ReadOnlySpan xSpan = s[..commaX].Trim(); + ReadOnlySpan ySpan = s[(commaX + 1)..commaY].Trim(); + ReadOnlySpan zSpan = s[(commaY + 1)..].Trim(); + + if (T.TryParse(xSpan, provider, out var x) && + T.TryParse(ySpan, provider, out var y) && + T.TryParse(zSpan, provider, out var z)) + { + result = new Vector3D(x, y, z); + return true; + } + + return false; + } + + /// Parses a UTF-8 span to a instance. + public static Vector3D Parse(ReadOnlySpan utf8Text, IFormatProvider? provider) + { + int charCount = Encoding.UTF8.GetCharCount(utf8Text); + Span charBuffer = charCount <= 128 ? stackalloc char[charCount] : new char[charCount]; + Encoding.UTF8.GetChars(utf8Text, charBuffer); + return Parse(charBuffer, provider); + } + + /// Tries to parse a UTF-8 span to a instance. + public static bool TryParse(ReadOnlySpan utf8Text, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector3D result) + { + int charCount = Encoding.UTF8.GetCharCount(utf8Text); + Span charBuffer = charCount <= 128 ? stackalloc char[charCount] : new char[charCount]; + Encoding.UTF8.GetChars(utf8Text, charBuffer); + return TryParse(charBuffer, provider, out result); + } + + /// Tries to parse a string to a instance. + public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector3D result) => + TryParse(s.AsSpan(), provider, out result); + + /// Parses a span to a instance. + static Vector3D ISpanParsable>.Parse(ReadOnlySpan s, IFormatProvider? provider) => + Parse(s, provider); + + /// Parses a string to a instance. + static Vector3D IParsable>.Parse(string s, IFormatProvider? provider) => + Parse(s, provider); + + /// Tries to parse a span to a instance. + static bool ISpanParsable>.TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector3D result) => + TryParse(s, provider, out result); + + /// Tries to parse a string to a instance. + static bool IParsable>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector3D result) => + TryParse(s, provider, out result); + + /// Returns a boolean indicating whether the given two vectors are equal. + /// The first vector to compare. + /// The second vector to compare. + /// true if the given vectors are equal; false otherwise. + public static bool operator ==(Vector3D left, Vector3D right) => + left.X == right.X && + left.Y == right.Y && + left.Z == right.Z; + + /// Returns a boolean indicating whether the given two vectors are not equal. + /// The first vector to compare. + /// The second vector to compare. + /// true if the given vectors are not equal; false otherwise. + public static bool operator !=(Vector3D left, Vector3D right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is Vector3D other && Equals(other); + + /// + public bool Equals(Vector3D other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(X, Y, Z); + + /// Converts the components of this vector to another type. + public static Vector3D CreateChecked(Vector3D source) + where TOther : INumberBase => + new(T.CreateChecked(source.X), T.CreateChecked(source.Y), T.CreateChecked(source.Z)); + + /// Converts the components of this vector to another type. + public static Vector3D CreateSaturating(Vector3D source) + where TOther : INumberBase => + new(T.CreateSaturating(source.X), T.CreateSaturating(source.Y), T.CreateSaturating(source.Z)); + + /// Converts the components of this vector to another type. + public static Vector3D CreateTruncating(Vector3D source) + where TOther : INumberBase => + new(T.CreateTruncating(source.X), T.CreateTruncating(source.Y), T.CreateTruncating(source.Z)); + + /// Converts the components of this vector to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Vector3D As() + where TOther : INumberBase => + Vector3D.CreateTruncating(this); + + /// Converts the components of this vector to another type. + public Vector3D AsChecked() + where TOther : INumberBase => + Vector3D.CreateChecked(this); + + /// Converts the components of this vector to another type. + public Vector3D AsSaturating() + where TOther : INumberBase => + Vector3D.CreateSaturating(this); + + /// Converts the components of this vector to another type. + public Vector3D AsTruncating() + where TOther : INumberBase => + Vector3D.CreateTruncating(this); + + /// Implicitly casts a to a . + public static implicit operator Vector3D((T X, T Y, T Z) v) => + new(v.X, v.Y, v.Z); + + /// Implicitly casts a to a . + public static implicit operator (T X, T Y, T Z)(Vector3D v) => + (v.X, v.Y, v.Z); + + /// Returns the given vector. + /// The source vector. + /// The source vector. + public static Vector3D operator +(Vector3D vector) => + vector; + + /// Negates a given vector. + /// The source vector. + /// The negated vector. + public static Vector3D operator -(Vector3D vector) => + new(-vector.X, -vector.Y, -vector.Z); + + /// Adds two vectors together. + /// The first source vector. + /// The second source vector. + /// The summed vector. + public static Vector3D operator +(Vector3D left, Vector3D right) => + new(left.X + right.X, left.Y + right.Y, left.Z + right.Z); + + /// Subtracts the second vector from the first. + /// The first source vector. + /// The second source vector. + /// The difference vector. + public static Vector3D operator -(Vector3D left, Vector3D right) => + new(left.X - right.X, left.Y - right.Y, left.Z - right.Z); + + /// Multiplies two vectors together. + /// The first source vector. + /// The second source vector. + /// The product vector. + public static Vector3D operator *(Vector3D left, Vector3D right) => + new(left.X * right.X, left.Y * right.Y, left.Z * right.Z); + + /// Divides the first vector by the second. + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + public static Vector3D operator /(Vector3D left, Vector3D right) => + new(left.X / right.X, left.Y / right.Y, left.Z / right.Z); + + /// Adds a scalar to the components of a vector. + /// The source vector. + /// The scalar value. + /// The offset vector. + public static Vector3D operator +(Vector3D vector, T scalar) => + new(vector.X + scalar, vector.Y + scalar, vector.Z + scalar); + + /// Subtracts a scalar from the components of a vector. + /// The source vector. + /// The scalar value. + /// The offset vector. + public static Vector3D operator -(Vector3D vector, T scalar) => + new(vector.X - scalar, vector.Y - scalar, vector.Z - scalar); + + /// Multiplies a vector by the given scalar. + /// The source vector. + /// The scalar value. + /// The scaled vector. + public static Vector3D operator *(Vector3D vector, T scalar) => + new(vector.X * scalar, vector.Y * scalar, vector.Z * scalar); + + /// Multiplies a vector by the given scalar. + /// The scalar value. + /// The source vector. + /// The scaled vector. + public static Vector3D operator *(T scalar, Vector3D vector) => + new(scalar * vector.X, scalar * vector.Y, scalar * vector.Z); + + /// Divides the vector by the given scalar. + /// The source vector. + /// The scalar value. + /// The result of the division. + public static Vector3D operator /(Vector3D vector, T scalar) => + new(vector.X / scalar, vector.Y / scalar, vector.Z / scalar); + + /// Converts a to a . + public static explicit operator Vector3D(Vector3 from) => + new(T.CreateTruncating(from.X), T.CreateTruncating(from.Y), T.CreateTruncating(from.Z)); + + /// Converts a to a . + public static explicit operator checked Vector3D(Vector3 from) => + new(T.CreateChecked(from.X), T.CreateChecked(from.Y), T.CreateChecked(from.Z)); + + /// Converts a to . + public static explicit operator Vector3(Vector3D from) => + new(float.CreateTruncating(from.X), float.CreateTruncating(from.Y), float.CreateTruncating(from.Z)); + + /// Converts a to . + public static explicit operator checked Vector3(Vector3D from) => + new(float.CreateChecked(from.X), float.CreateChecked(from.Y), float.CreateChecked(from.Z)); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector3D(Vector3D from) => + Vector3D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector3D(Vector3D from) => + Vector3D.CreateChecked(from); + } +} diff --git a/sources/Maths/Maths/Vector4D.Ops.cs b/sources/Maths/Maths/Vector4D.Ops.cs deleted file mode 100644 index 16caebd93b..0000000000 --- a/sources/Maths/Maths/Vector4D.Ops.cs +++ /dev/null @@ -1,357 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Runtime.CompilerServices; - -namespace Silk.NET.Maths -{ - /// - /// Methods for working with - /// - public static class Vector4D - { - /// Returns a vector whose elements are the absolute values of each of the source vector's elements. - /// The source vector. - /// The absolute value vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Abs(Vector4D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new( - Scalar.Abs(value.X), - Scalar.Abs(value.Y), - Scalar.Abs(value.Z), - Scalar.Abs(value.W) - ); - - /// Adds two vectors together. - /// The first source vector. - /// The second source vector. - /// The summed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Add(Vector4D left, Vector4D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left + right; - - /// Restricts a vector between a min and max value. - /// The source vector. - /// The minimum value. - /// The maximum value. - /// The restricted vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Clamp(Vector4D value1, Vector4D min, Vector4D max) - where T : unmanaged, IFormattable, IEquatable, IComparable - // We must follow HLSL behavior in the case user specified min value is bigger than max value. - => Min(Max(value1, min), max); - - /// Returns the Euclidean distance between the two given points. - /// The first point. - /// The second point. - /// The distance. - [MethodImpl((MethodImplOptions) 768)] - public static T Distance(Vector4D value1, Vector4D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Sqrt(DistanceSquared(value1, value2)); - - /// Returns the Euclidean distance squared between the two given points. - /// The first point. - /// The second point. - /// The distance squared. - [MethodImpl((MethodImplOptions) 768)] - public static T DistanceSquared(Vector4D value1, Vector4D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - var difference = value1 - value2; - return Dot(difference, difference); - } - - /// Divides the first vector by the second. - /// The first source vector. - /// The second source vector. - /// The vector resulting from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Divide(Vector4D left, Vector4D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left / right; - - /// Divides the vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The result of the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Divide(Vector4D left, T divisor) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left / divisor; - - /// Returns the dot product of two vectors. - /// The first vector. - /// The second vector. - /// The dot product. - [MethodImpl((MethodImplOptions) 768)] - public static T Dot(Vector4D vector1, Vector4D vector2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => Scalar.Add( - Scalar.Add( - Scalar.Add(Scalar.Multiply(vector1.X, vector2.X), - Scalar.Multiply(vector1.Y, vector2.Y)), Scalar.Multiply(vector1.Z, vector2.Z)), - Scalar.Multiply(vector1.W, vector2.W)); - - /// Linearly interpolates between two vectors based on the given weighting. - /// The first source vector. - /// The second source vector. - /// Value between 0 and 1 indicating the weight of the second source vector. - /// The interpolated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Lerp(Vector4D value1, Vector4D value2, T amount) - where T : unmanaged, IFormattable, IEquatable, IComparable - => (value1 * Scalar.Subtract(Scalar.One, amount)) + (value2 * amount); - - /// Returns a vector whose elements are the maximum of each of the pairs of elements in the two source vectors. - /// The first source vector. - /// The second source vector. - /// The maximized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Max(Vector4D value1, Vector4D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Max(value1.X, value2.X), Scalar.Max(value1.Y, value2.Y), - Scalar.Max(value1.Z, value2.Z), Scalar.Max(value1.W, value2.W)); - - /// Returns a vector whose elements are the minimum of each of the pairs of elements in the two source vectors. - /// The first source vector. - /// The second source vector. - /// The minimized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Min(Vector4D value1, Vector4D value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => new(Scalar.Min(value1.X, value2.X), Scalar.Min(value1.Y, value2.Y), - Scalar.Min(value1.Z, value2.Z), Scalar.Min(value1.W, value2.W)); - - /// Multiplies two vectors together. - /// The first source vector. - /// The second source vector. - /// The product vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector4D left, Vector4D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left * right; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector4D value1, Matrix4X4 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector3D Multiply(Vector4D value1, Matrix4X3 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by a matrix. - /// The vector. - /// The matrix. - /// The result of the multiplication. - [MethodImpl((MethodImplOptions) 768)] - public static Vector2D Multiply(Vector4D value1, Matrix4X2 value2) - where T : unmanaged, IFormattable, IEquatable, IComparable - => value1 * value2; - - /// Multiplies a vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(Vector4D left, T right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left * right; - - /// Multiplies a vector by the given scalar. - /// The scalar value. - /// The source vector. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Multiply(T left, Vector4D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left * right; - - /// Negates a given vector. - /// The source vector. - /// The negated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Negate(Vector4D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - => -value; - - /// Returns a vector with the same direction as the given vector, but with a length of 1. - /// The vector to normalize. - /// The normalized vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Normalize(Vector4D vector) - where T : unmanaged, IFormattable, IEquatable, IComparable - => vector / vector.Length; - - /// Returns a vector whose elements are the square root of each of the source vector's elements. - /// The source vector. - /// The square root vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D SquareRoot(Vector4D value) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Scalar.Sqrt(value.X), Scalar.Sqrt(value.Y), Scalar.Sqrt(value.Z), - Scalar.Sqrt(value.W)); - } - - /// Subtracts the second vector from the first. - /// The first source vector. - /// The second source vector. - /// The difference vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Subtract(Vector4D left, Vector4D right) - where T : unmanaged, IFormattable, IEquatable, IComparable - => left - right; - - /// Transforms a vector by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Transform(Vector2D position, Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M11), Scalar.Multiply(position.Y, matrix.M21)), matrix.M41), - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M12), Scalar.Multiply(position.Y, matrix.M22)), matrix.M42), - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M13), Scalar.Multiply(position.Y, matrix.M23)), matrix.M43), - Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M14), Scalar.Multiply(position.Y, matrix.M24)), matrix.M44) - ); - } - - /// Transforms a vector by the given Quaternion rotation value. - /// The source vector to be rotated. - /// The rotation to apply. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Transform(Vector2D value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - return new( - Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2)), Scalar.Multiply(value.Y, Scalar.Subtract(xy2, wz2))), - Scalar.Add(Scalar.Multiply(value.X, Scalar.Add(xy2, wz2)), Scalar.Multiply(value.Y, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2))), - Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(xz2, wy2)), Scalar.Multiply(value.Y, Scalar.Add(yz2, wx2))), - Scalar.One - ); - } - - /// Transforms a vector by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Transform(Vector3D position, Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M11), Scalar.Multiply(position.Y, matrix.M21)), Scalar.Multiply(position.Z, matrix.M31)), matrix.M41), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M12), Scalar.Multiply(position.Y, matrix.M22)), Scalar.Multiply(position.Z, matrix.M32)), matrix.M42), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M13), Scalar.Multiply(position.Y, matrix.M23)), Scalar.Multiply(position.Z, matrix.M33)), matrix.M43), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(position.X, matrix.M14), Scalar.Multiply(position.Y, matrix.M24)), Scalar.Multiply(position.Z, matrix.M34)), matrix.M44) - ); - } - - /// Transforms a vector by the given Quaternion rotation value. - /// The source vector to be rotated. - /// The rotation to apply. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Transform(Vector3D value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2)), Scalar.Multiply(value.Y, Scalar.Subtract(xy2, wz2))), Scalar.Multiply(value.Z, Scalar.Add(xz2, wy2))), - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Add(xy2, wz2)), Scalar.Multiply(value.Y, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2))), Scalar.Multiply(value.Z, Scalar.Subtract(yz2, wx2))), - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(xz2, wy2)), Scalar.Multiply(value.Y, Scalar.Add(yz2, wx2))), Scalar.Multiply(value.Z, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2))), - Scalar.One - ); - } - - /// Transforms a vector by the given matrix. - /// The source vector. - /// The transformation matrix. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Transform(Vector4D vector, Matrix4X4 matrix) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - return new( - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(vector.X, matrix.M11), Scalar.Multiply(vector.Y, matrix.M21)), Scalar.Multiply(vector.Z, matrix.M31)), Scalar.Multiply(vector.W, matrix.M41)), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(vector.X, matrix.M12), Scalar.Multiply(vector.Y, matrix.M22)), Scalar.Multiply(vector.Z, matrix.M32)), Scalar.Multiply(vector.W, matrix.M42)), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(vector.X, matrix.M13), Scalar.Multiply(vector.Y, matrix.M23)), Scalar.Multiply(vector.Z, matrix.M33)), Scalar.Multiply(vector.W, matrix.M43)), - Scalar.Add(Scalar.Add(Scalar.Add(Scalar.Multiply(vector.X, matrix.M14), Scalar.Multiply(vector.Y, matrix.M24)), Scalar.Multiply(vector.Z, matrix.M34)), Scalar.Multiply(vector.W, matrix.M44)) - ); - } - - /// Transforms a vector by the given Quaternion rotation value. - /// The source vector to be rotated. - /// The rotation to apply. - /// The transformed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D Transform(Vector4D value, Quaternion rotation) - where T : unmanaged, IFormattable, IEquatable, IComparable - { - T x2 = Scalar.Add(rotation.X, rotation.X); - T y2 = Scalar.Add(rotation.Y, rotation.Y); - T z2 = Scalar.Add(rotation.Z, rotation.Z); - - T wx2 = Scalar.Multiply(rotation.W, x2); - T wy2 = Scalar.Multiply(rotation.W, y2); - T wz2 = Scalar.Multiply(rotation.W, z2); - T xx2 = Scalar.Multiply(rotation.X, x2); - T xy2 = Scalar.Multiply(rotation.X, y2); - T xz2 = Scalar.Multiply(rotation.X, z2); - T yy2 = Scalar.Multiply(rotation.Y, y2); - T yz2 = Scalar.Multiply(rotation.Y, z2); - T zz2 = Scalar.Multiply(rotation.Z, z2); - - return new( - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(Scalar.Subtract(Scalar.One, yy2), zz2)), Scalar.Multiply(value.Y, Scalar.Subtract(xy2, wz2))), Scalar.Multiply(value.Z, Scalar.Add(xz2, wy2))), - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Add(xy2, wz2)), Scalar.Multiply(value.Y, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), zz2))), Scalar.Multiply(value.Z, Scalar.Subtract(yz2, wx2))), - Scalar.Add(Scalar.Add(Scalar.Multiply(value.X, Scalar.Subtract(xz2, wy2)), Scalar.Multiply(value.Y, Scalar.Add(yz2, wx2))), Scalar.Multiply(value.Z, Scalar.Subtract(Scalar.Subtract(Scalar.One, xx2), yy2))), - value.W - ); - } - } -} \ No newline at end of file diff --git a/sources/Maths/Maths/Vector4D.Ops.gen.cs b/sources/Maths/Maths/Vector4D.Ops.gen.cs new file mode 100644 index 0000000000..b6b3ceaa42 --- /dev/null +++ b/sources/Maths/Maths/Vector4D.Ops.gen.cs @@ -0,0 +1,726 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Numerics; + + /// + /// Methods for working with . + /// + public static partial class Vector4D + { + /// Extensions for vectors with elements implementing . + extension(Vector4D vector) + where T : IRootFunctions + { + /// Gets the length of the vector. + public T Length => T.Sqrt(vector.LengthSquared); + } + + /// Extensions for vectors with elements implementing . + extension(Vector4D vector) + where T : INumberBase + { + /// Gets the length squared of the vector. + public T LengthSquared => Vector4D.Dot(vector, vector); + } + + /// Desconstructs a vector into its components. + /// The vector to deconstruct. + /// The X component. + /// The Y component. + /// The Z component. + /// The W component. + public static void Deconstruct(this Vector4D vector, out T x, out T y, out T z, out T w) + where T : INumberBase + { + x = vector.X; + y = vector.Y; + z = vector.Z; + w = vector.W; + } + + /// Computes the dot product of two vectors. + public static T Dot(Vector4D left, Vector4D right) + where T : INumberBase => + left.X * right.X + left.Y * right.Y + left.Z * right.Z + left.W * right.W; + + /// Reflects a vector over a normal vector. + public static Vector4D Reflect(Vector4D vector, Vector4D normal) + where T : INumberBase + { + T dot = Dot(vector, normal); + return vector - (normal * (dot + dot)); + } + + /// Normalizes a vector. + public static Vector4D Normalize(this Vector4D vector) + where T : IRootFunctions + { + T length = vector.Length; + return length != T.Zero ? vector / length : Vector4D.Zero; + } + + /// Returns the Euclidean distance between the two given points. + /// The first point. + /// The second point. + /// The distance. + public static T Distance(Vector4D value1, Vector4D value2) + where T : IRootFunctions => + T.Sqrt(DistanceSquared(value1, value2)); + + /// Returns the Euclidean distance squared between the two given points. + /// The first point. + /// The second point. + /// The distance squared. + public static T DistanceSquared(Vector4D value1, Vector4D value2) + where T : INumberBase + { + var difference = value1 - value2; + return Dot(difference, difference); + } + + /// Linearly interpolates between two vectors using a scalar t-value (clamped between 0 and 1). + public static Vector4D LerpClamped(Vector4D a, Vector4D b, T amount) + where T : IFloatingPointIeee754 => + Lerp(a, b, T.Clamp(amount, T.Zero, T.One)); + + /// Linearly interpolates between two vectors using a vector t-value (clamped between 0 and 1). + public static Vector4D LerpClamped(Vector4D a, Vector4D b, Vector4D amount) + where T : IFloatingPointIeee754 => + new(T.Lerp(a.X, b.X, T.Clamp(amount.X, T.Zero, T.One)), + T.Lerp(a.Y, b.Y, T.Clamp(amount.Y, T.Zero, T.One)), + T.Lerp(a.Z, b.Z, T.Clamp(amount.Z, T.Zero, T.One)), + T.Lerp(a.W, b.W, T.Clamp(amount.W, T.Zero, T.One))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static (Vector4D Sin, Vector4D Cos) SinCos(Vector4D x) + where T : ITrigonometricFunctions => + (new(T.Sin(x.X), T.Sin(x.Y), T.Sin(x.Z), T.Sin(x.W)), new(T.Cos(x.X), T.Cos(x.Y), T.Cos(x.Z), T.Cos(x.W))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static (Vector4D SinPi, Vector4D CosPi) SinCosPi(Vector4D x) + where T : ITrigonometricFunctions => + (new(T.SinPi(x.X), T.SinPi(x.Y), T.SinPi(x.Z), T.SinPi(x.W)), new(T.CosPi(x.X), T.CosPi(x.Y), T.CosPi(x.Z), T.CosPi(x.W))); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static (Vector4D Quotient, Vector4D Remainder) DivRem(Vector4D left, Vector4D right) + where T : IBinaryInteger + { + var (qX, rX) = T.DivRem(left.X, right.X); + var (qY, rY) = T.DivRem(left.Y, right.Y); + var (qZ, rZ) = T.DivRem(left.Z, right.Z); + var (qW, rW) = T.DivRem(left.W, right.W); + return (new Vector4D(qX, qY, qZ, qW), new Vector4D(rX, rY, rZ, rW)); + } + + /// Multiplies a vector by a scalar value. + /// The source vector. + /// The scaling factor. + /// The scaled vector. + public static Vector4D Multiply(Vector4D left, T right) + where T : INumberBase => + left * right; + + /// Multiplies a vector by a scalar value. + /// The scaling factor. + /// The source vector. + /// The scaled vector. + public static Vector4D Multiply(T left, Vector4D right) + where T : INumberBase => + left * right; + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Sign(Vector4D value) + where TSelf : INumber => + new(TSelf.Sign(value.X), TSelf.Sign(value.Y), TSelf.Sign(value.Z), TSelf.Sign(value.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Max(Vector4D x, Vector4D y) + where TSelf : INumber => + new(TSelf.Max(x.X, y.X), TSelf.Max(x.Y, y.Y), TSelf.Max(x.Z, y.Z), TSelf.Max(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Max(Vector4D x, TSelf y) + where TSelf : INumber => + new(TSelf.Max(x.X, y), TSelf.Max(x.Y, y), TSelf.Max(x.Z, y), TSelf.Max(x.W, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MaxNumber(Vector4D x, Vector4D y) + where TSelf : INumber => + new(TSelf.MaxNumber(x.X, y.X), TSelf.MaxNumber(x.Y, y.Y), TSelf.MaxNumber(x.Z, y.Z), TSelf.MaxNumber(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D MaxNumber(Vector4D x, TSelf y) + where TSelf : INumber => + new(TSelf.MaxNumber(x.X, y), TSelf.MaxNumber(x.Y, y), TSelf.MaxNumber(x.Z, y), TSelf.MaxNumber(x.W, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Min(Vector4D x, Vector4D y) + where TSelf : INumber => + new(TSelf.Min(x.X, y.X), TSelf.Min(x.Y, y.Y), TSelf.Min(x.Z, y.Z), TSelf.Min(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Min(Vector4D x, TSelf y) + where TSelf : INumber => + new(TSelf.Min(x.X, y), TSelf.Min(x.Y, y), TSelf.Min(x.Z, y), TSelf.Min(x.W, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MinNumber(Vector4D x, Vector4D y) + where TSelf : INumber => + new(TSelf.MinNumber(x.X, y.X), TSelf.MinNumber(x.Y, y.Y), TSelf.MinNumber(x.Z, y.Z), TSelf.MinNumber(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D MinNumber(Vector4D x, TSelf y) + where TSelf : INumber => + new(TSelf.MinNumber(x.X, y), TSelf.MinNumber(x.Y, y), TSelf.MinNumber(x.Z, y), TSelf.MinNumber(x.W, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Clamp(Vector4D value, Vector4D min, Vector4D max) + where TSelf : INumber => + new(TSelf.Clamp(value.X, min.X, max.X), TSelf.Clamp(value.Y, min.Y, max.Y), TSelf.Clamp(value.Z, min.Z, max.Z), TSelf.Clamp(value.W, min.W, max.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector4D Clamp(Vector4D value, TSelf min, TSelf max) + where TSelf : INumber => + new(TSelf.Clamp(value.X, min, max), TSelf.Clamp(value.Y, min, max), TSelf.Clamp(value.Z, min, max), TSelf.Clamp(value.W, min, max)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D CopySign(Vector4D value, Vector4D sign) + where TSelf : INumber => + new(TSelf.CopySign(value.X, sign.X), TSelf.CopySign(value.Y, sign.Y), TSelf.CopySign(value.Z, sign.Z), TSelf.CopySign(value.W, sign.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D CopySign(Vector4D value, TSelf sign) + where TSelf : INumber => + new(TSelf.CopySign(value.X, sign), TSelf.CopySign(value.Y, sign), TSelf.CopySign(value.Z, sign), TSelf.CopySign(value.W, sign)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Abs(Vector4D value) + where TSelf : INumberBase => + new(TSelf.Abs(value.X), TSelf.Abs(value.Y), TSelf.Abs(value.Z), TSelf.Abs(value.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MaxMagnitude(Vector4D x, Vector4D y) + where TSelf : INumberBase => + new(TSelf.MaxMagnitude(x.X, y.X), TSelf.MaxMagnitude(x.Y, y.Y), TSelf.MaxMagnitude(x.Z, y.Z), TSelf.MaxMagnitude(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MaxMagnitudeNumber(Vector4D x, Vector4D y) + where TSelf : INumberBase => + new(TSelf.MaxMagnitudeNumber(x.X, y.X), TSelf.MaxMagnitudeNumber(x.Y, y.Y), TSelf.MaxMagnitudeNumber(x.Z, y.Z), TSelf.MaxMagnitudeNumber(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MinMagnitude(Vector4D x, Vector4D y) + where TSelf : INumberBase => + new(TSelf.MinMagnitude(x.X, y.X), TSelf.MinMagnitude(x.Y, y.Y), TSelf.MinMagnitude(x.Z, y.Z), TSelf.MinMagnitude(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MinMagnitudeNumber(Vector4D x, Vector4D y) + where TSelf : INumberBase => + new(TSelf.MinMagnitudeNumber(x.X, y.X), TSelf.MinMagnitudeNumber(x.Y, y.Y), TSelf.MinMagnitudeNumber(x.Z, y.Z), TSelf.MinMagnitudeNumber(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D MultiplyAddEstimate(Vector4D left, Vector4D right, Vector4D addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right.X, addend.X), TSelf.MultiplyAddEstimate(left.Y, right.Y, addend.Y), TSelf.MultiplyAddEstimate(left.Z, right.Z, addend.Z), TSelf.MultiplyAddEstimate(left.W, right.W, addend.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D MultiplyAddEstimate(Vector4D left, Vector4D right, TSelf addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right.X, addend), TSelf.MultiplyAddEstimate(left.Y, right.Y, addend), TSelf.MultiplyAddEstimate(left.Z, right.Z, addend), TSelf.MultiplyAddEstimate(left.W, right.W, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A vector whose members will be provided for . + public static Vector4D MultiplyAddEstimate(Vector4D left, TSelf right, Vector4D addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right, addend.X), TSelf.MultiplyAddEstimate(left.Y, right, addend.Y), TSelf.MultiplyAddEstimate(left.Z, right, addend.Z), TSelf.MultiplyAddEstimate(left.W, right, addend.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector4D MultiplyAddEstimate(Vector4D left, TSelf right, TSelf addend) + where TSelf : INumberBase => + new(TSelf.MultiplyAddEstimate(left.X, right, addend), TSelf.MultiplyAddEstimate(left.Y, right, addend), TSelf.MultiplyAddEstimate(left.Z, right, addend), TSelf.MultiplyAddEstimate(left.W, right, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D PopCount(Vector4D value) + where TSelf : IBinaryInteger => + new(TSelf.PopCount(value.X), TSelf.PopCount(value.Y), TSelf.PopCount(value.Z), TSelf.PopCount(value.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D TrailingZeroCount(Vector4D value) + where TSelf : IBinaryInteger => + new(TSelf.TrailingZeroCount(value.X), TSelf.TrailingZeroCount(value.Y), TSelf.TrailingZeroCount(value.Z), TSelf.TrailingZeroCount(value.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Ceiling(Vector4D x) + where TSelf : IFloatingPoint => + new(TSelf.Ceiling(x.X), TSelf.Ceiling(x.Y), TSelf.Ceiling(x.Z), TSelf.Ceiling(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Floor(Vector4D x) + where TSelf : IFloatingPoint => + new(TSelf.Floor(x.X), TSelf.Floor(x.Y), TSelf.Floor(x.Z), TSelf.Floor(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Round(Vector4D x) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X), TSelf.Round(x.Y), TSelf.Round(x.Z), TSelf.Round(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Round(Vector4D x, int digits) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, digits), TSelf.Round(x.Y, digits), TSelf.Round(x.Z, digits), TSelf.Round(x.W, digits)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Round(Vector4D x, MidpointRounding mode) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, mode), TSelf.Round(x.Y, mode), TSelf.Round(x.Z, mode), TSelf.Round(x.W, mode)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector4D Round(Vector4D x, int digits, MidpointRounding mode) + where TSelf : IFloatingPoint => + new(TSelf.Round(x.X, digits, mode), TSelf.Round(x.Y, digits, mode), TSelf.Round(x.Z, digits, mode), TSelf.Round(x.W, digits, mode)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Truncate(Vector4D x) + where TSelf : IFloatingPoint => + new(TSelf.Truncate(x.X), TSelf.Truncate(x.Y), TSelf.Truncate(x.Z), TSelf.Truncate(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Atan2(Vector4D y, Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Atan2(y.X, x.X), TSelf.Atan2(y.Y, x.Y), TSelf.Atan2(y.Z, x.Z), TSelf.Atan2(y.W, x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Atan2Pi(Vector4D y, Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Atan2Pi(y.X, x.X), TSelf.Atan2Pi(y.Y, x.Y), TSelf.Atan2Pi(y.Z, x.Z), TSelf.Atan2Pi(y.W, x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Lerp(Vector4D value1, Vector4D value2, TSelf amount) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Lerp(value1.X, value2.X, amount), TSelf.Lerp(value1.Y, value2.Y, amount), TSelf.Lerp(value1.Z, value2.Z, amount), TSelf.Lerp(value1.W, value2.W, amount)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D BitDecrement(Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.BitDecrement(x.X), TSelf.BitDecrement(x.Y), TSelf.BitDecrement(x.Z), TSelf.BitDecrement(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D BitIncrement(Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.BitIncrement(x.X), TSelf.BitIncrement(x.Y), TSelf.BitIncrement(x.Z), TSelf.BitIncrement(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D FusedMultiplyAdd(Vector4D left, Vector4D right, Vector4D addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right.X, addend.X), TSelf.FusedMultiplyAdd(left.Y, right.Y, addend.Y), TSelf.FusedMultiplyAdd(left.Z, right.Z, addend.Z), TSelf.FusedMultiplyAdd(left.W, right.W, addend.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D FusedMultiplyAdd(Vector4D left, Vector4D right, TSelf addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right.X, addend), TSelf.FusedMultiplyAdd(left.Y, right.Y, addend), TSelf.FusedMultiplyAdd(left.Z, right.Z, addend), TSelf.FusedMultiplyAdd(left.W, right.W, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A vector whose members will be provided for . + public static Vector4D FusedMultiplyAdd(Vector4D left, TSelf right, Vector4D addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right, addend.X), TSelf.FusedMultiplyAdd(left.Y, right, addend.Y), TSelf.FusedMultiplyAdd(left.Z, right, addend.Z), TSelf.FusedMultiplyAdd(left.W, right, addend.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + /// A single value provided for . + public static Vector4D FusedMultiplyAdd(Vector4D left, TSelf right, TSelf addend) + where TSelf : IFloatingPointIeee754 => + new(TSelf.FusedMultiplyAdd(left.X, right, addend), TSelf.FusedMultiplyAdd(left.Y, right, addend), TSelf.FusedMultiplyAdd(left.Z, right, addend), TSelf.FusedMultiplyAdd(left.W, right, addend)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Ieee754Remainder(Vector4D left, Vector4D right) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Ieee754Remainder(left.X, right.X), TSelf.Ieee754Remainder(left.Y, right.Y), TSelf.Ieee754Remainder(left.Z, right.Z), TSelf.Ieee754Remainder(left.W, right.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Ieee754Remainder(Vector4D left, TSelf right) + where TSelf : IFloatingPointIeee754 => + new(TSelf.Ieee754Remainder(left.X, right), TSelf.Ieee754Remainder(left.Y, right), TSelf.Ieee754Remainder(left.Z, right), TSelf.Ieee754Remainder(left.W, right)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D ILogB(Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ILogB(x.X), TSelf.ILogB(x.Y), TSelf.ILogB(x.Z), TSelf.ILogB(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D ReciprocalEstimate(Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ReciprocalEstimate(x.X), TSelf.ReciprocalEstimate(x.Y), TSelf.ReciprocalEstimate(x.Z), TSelf.ReciprocalEstimate(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D ReciprocalSqrtEstimate(Vector4D x) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ReciprocalSqrtEstimate(x.X), TSelf.ReciprocalSqrtEstimate(x.Y), TSelf.ReciprocalSqrtEstimate(x.Z), TSelf.ReciprocalSqrtEstimate(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D ScaleB(Vector4D x, Vector4D n) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ScaleB(x.X, n.X), TSelf.ScaleB(x.Y, n.Y), TSelf.ScaleB(x.Z, n.Z), TSelf.ScaleB(x.W, n.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D ScaleB(Vector4D x, int n) + where TSelf : IFloatingPointIeee754 => + new(TSelf.ScaleB(x.X, n), TSelf.ScaleB(x.Y, n), TSelf.ScaleB(x.Z, n), TSelf.ScaleB(x.W, n)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Pow(Vector4D x, Vector4D y) + where TSelf : IPowerFunctions => + new(TSelf.Pow(x.X, y.X), TSelf.Pow(x.Y, y.Y), TSelf.Pow(x.Z, y.Z), TSelf.Pow(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Pow(Vector4D x, TSelf y) + where TSelf : IPowerFunctions => + new(TSelf.Pow(x.X, y), TSelf.Pow(x.Y, y), TSelf.Pow(x.Z, y), TSelf.Pow(x.W, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Cbrt(Vector4D x) + where TSelf : IRootFunctions => + new(TSelf.Cbrt(x.X), TSelf.Cbrt(x.Y), TSelf.Cbrt(x.Z), TSelf.Cbrt(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Sqrt(Vector4D x) + where TSelf : IRootFunctions => + new(TSelf.Sqrt(x.X), TSelf.Sqrt(x.Y), TSelf.Sqrt(x.Z), TSelf.Sqrt(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D RootN(Vector4D x, int n) + where TSelf : IRootFunctions => + new(TSelf.RootN(x.X, n), TSelf.RootN(x.Y, n), TSelf.RootN(x.Z, n), TSelf.RootN(x.W, n)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D RootN(Vector4D x, Vector4D n) + where TSelf : IRootFunctions => + new(TSelf.RootN(x.X, n.X), TSelf.RootN(x.Y, n.Y), TSelf.RootN(x.Z, n.Z), TSelf.RootN(x.W, n.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Hypot(Vector4D x, Vector4D y) + where TSelf : IRootFunctions => + new(TSelf.Hypot(x.X, y.X), TSelf.Hypot(x.Y, y.Y), TSelf.Hypot(x.Z, y.Z), TSelf.Hypot(x.W, y.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Hypot(Vector4D x, TSelf y) + where TSelf : IRootFunctions => + new(TSelf.Hypot(x.X, y), TSelf.Hypot(x.Y, y), TSelf.Hypot(x.Z, y), TSelf.Hypot(x.W, y)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Log(Vector4D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X), TSelf.Log(x.Y), TSelf.Log(x.Z), TSelf.Log(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A vector whose members will be provided for . + public static Vector4D Log(Vector4D x, Vector4D newBase) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X, newBase.X), TSelf.Log(x.Y, newBase.Y), TSelf.Log(x.Z, newBase.Z), TSelf.Log(x.W, newBase.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + /// A single value provided for . + public static Vector4D Log(Vector4D x, TSelf newBase) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log(x.X, newBase), TSelf.Log(x.Y, newBase), TSelf.Log(x.Z, newBase), TSelf.Log(x.W, newBase)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D LogP1(Vector4D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.LogP1(x.X), TSelf.LogP1(x.Y), TSelf.LogP1(x.Z), TSelf.LogP1(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Log2(Vector4D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log2(x.X), TSelf.Log2(x.Y), TSelf.Log2(x.Z), TSelf.Log2(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Log2P1(Vector4D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log2P1(x.X), TSelf.Log2P1(x.Y), TSelf.Log2P1(x.Z), TSelf.Log2P1(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Log10(Vector4D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log10(x.X), TSelf.Log10(x.Y), TSelf.Log10(x.Z), TSelf.Log10(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Log10P1(Vector4D x) + where TSelf : ILogarithmicFunctions => + new(TSelf.Log10P1(x.X), TSelf.Log10P1(x.Y), TSelf.Log10P1(x.Z), TSelf.Log10P1(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Exp(Vector4D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp(x.X), TSelf.Exp(x.Y), TSelf.Exp(x.Z), TSelf.Exp(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D ExpM1(Vector4D x) + where TSelf : IExponentialFunctions => + new(TSelf.ExpM1(x.X), TSelf.ExpM1(x.Y), TSelf.ExpM1(x.Z), TSelf.ExpM1(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Exp2(Vector4D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp2(x.X), TSelf.Exp2(x.Y), TSelf.Exp2(x.Z), TSelf.Exp2(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Exp2M1(Vector4D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp2M1(x.X), TSelf.Exp2M1(x.Y), TSelf.Exp2M1(x.Z), TSelf.Exp2M1(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Exp10(Vector4D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp10(x.X), TSelf.Exp10(x.Y), TSelf.Exp10(x.Z), TSelf.Exp10(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Exp10M1(Vector4D x) + where TSelf : IExponentialFunctions => + new(TSelf.Exp10M1(x.X), TSelf.Exp10M1(x.Y), TSelf.Exp10M1(x.Z), TSelf.Exp10M1(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Acos(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Acos(x.X), TSelf.Acos(x.Y), TSelf.Acos(x.Z), TSelf.Acos(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D AcosPi(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AcosPi(x.X), TSelf.AcosPi(x.Y), TSelf.AcosPi(x.Z), TSelf.AcosPi(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Asin(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Asin(x.X), TSelf.Asin(x.Y), TSelf.Asin(x.Z), TSelf.Asin(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D AsinPi(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AsinPi(x.X), TSelf.AsinPi(x.Y), TSelf.AsinPi(x.Z), TSelf.AsinPi(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Atan(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Atan(x.X), TSelf.Atan(x.Y), TSelf.Atan(x.Z), TSelf.Atan(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D AtanPi(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.AtanPi(x.X), TSelf.AtanPi(x.Y), TSelf.AtanPi(x.Z), TSelf.AtanPi(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Cos(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Cos(x.X), TSelf.Cos(x.Y), TSelf.Cos(x.Z), TSelf.Cos(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D CosPi(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.CosPi(x.X), TSelf.CosPi(x.Y), TSelf.CosPi(x.Z), TSelf.CosPi(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Sin(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Sin(x.X), TSelf.Sin(x.Y), TSelf.Sin(x.Z), TSelf.Sin(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D SinPi(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.SinPi(x.X), TSelf.SinPi(x.Y), TSelf.SinPi(x.Z), TSelf.SinPi(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Tan(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.Tan(x.X), TSelf.Tan(x.Y), TSelf.Tan(x.Z), TSelf.Tan(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D TanPi(Vector4D x) + where TSelf : ITrigonometricFunctions => + new(TSelf.TanPi(x.X), TSelf.TanPi(x.Y), TSelf.TanPi(x.Z), TSelf.TanPi(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D DegreesToRadians(Vector4D degrees) + where TSelf : ITrigonometricFunctions => + new(TSelf.DegreesToRadians(degrees.X), TSelf.DegreesToRadians(degrees.Y), TSelf.DegreesToRadians(degrees.Z), TSelf.DegreesToRadians(degrees.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D RadiansToDegrees(Vector4D radians) + where TSelf : ITrigonometricFunctions => + new(TSelf.RadiansToDegrees(radians.X), TSelf.RadiansToDegrees(radians.Y), TSelf.RadiansToDegrees(radians.Z), TSelf.RadiansToDegrees(radians.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Acosh(Vector4D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Acosh(x.X), TSelf.Acosh(x.Y), TSelf.Acosh(x.Z), TSelf.Acosh(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Asinh(Vector4D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Asinh(x.X), TSelf.Asinh(x.Y), TSelf.Asinh(x.Z), TSelf.Asinh(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Atanh(Vector4D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Atanh(x.X), TSelf.Atanh(x.Y), TSelf.Atanh(x.Z), TSelf.Atanh(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Cosh(Vector4D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Cosh(x.X), TSelf.Cosh(x.Y), TSelf.Cosh(x.Z), TSelf.Cosh(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Sinh(Vector4D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Sinh(x.X), TSelf.Sinh(x.Y), TSelf.Sinh(x.Z), TSelf.Sinh(x.W)); + + /// Applies to the provided arguments. + /// A vector whose members will be provided for . + public static Vector4D Tanh(Vector4D x) + where TSelf : IHyperbolicFunctions => + new(TSelf.Tanh(x.X), TSelf.Tanh(x.Y), TSelf.Tanh(x.Z), TSelf.Tanh(x.W)); + } +} diff --git a/sources/Maths/Maths/Vector4D.cs b/sources/Maths/Maths/Vector4D.cs deleted file mode 100644 index 3722ecde42..0000000000 --- a/sources/Maths/Maths/Vector4D.cs +++ /dev/null @@ -1,417 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Globalization; -using System.Runtime.CompilerServices; -using System.Runtime.Serialization; -using System.Text; - -namespace Silk.NET.Maths -{ - /// A structure encapsulating four single precision floating point values and provides hardware accelerated methods. - [Serializable] - [DataContract] - public struct Vector4D - : IEquatable>, IFormattable - where T : unmanaged, IFormattable, IEquatable, IComparable - { - /// The X component of the vector. - [DataMember] - public T X; - - /// The Y component of the vector. - [DataMember] - public T Y; - - /// The Z component of the vector. - [DataMember] - public T Z; - - /// The W component of the vector. - [DataMember] - public T W; - - /// - /// Indexer for the components of this vector. - /// - /// The component to select. Zero based. - public T this[int i] - { - get - { - static void VerifyBounds(int i) - { - static void ThrowHelper() => throw new IndexOutOfRangeException(); - - if (i > 3 || i < 0) - ThrowHelper(); - } - - VerifyBounds(i); - return Unsafe.Add(ref X, i); - } - } - - /// Constructs a vector whose elements are all the single specified value. - /// The element to fill the vector with. - public Vector4D(T value) => (X, Y, Z, W) = (value, value, value, value); - - /// Constructs a from the given and a Z and W component. - /// The vector to use as the X and Y components. - /// The Z component. - /// The W component. - public Vector4D(Vector2D value, T z, T w) => (X, Y, Z, W) = (value.X, value.Y, z, w); - - /// Constructs a from the given and a W component. - /// The vector to use as the X, Y, and Z components. - /// The W component. - public Vector4D(Vector3D value, T w) => (X, Y, Z, W) = (value.X, value.Y, value.Z, w); - - /// Constructs a vector with the given individual elements. - /// W component. - /// X component. - /// Y component. - /// Z component. - public Vector4D(T x, T y, T z, T w) => (X, Y, Z, W) = (x, y, z, w); - - /// Returns the vector (0,0,0,0). - public static Vector4D Zero => default; - - /// Returns the vector (1,1,1,1). - public static Vector4D One => new(Scalar.One); - - /// Returns the vector (1,0,0,0). - public static Vector4D UnitX => new(Scalar.One, Scalar.Zero, Scalar.Zero, Scalar.Zero); - - /// Returns the vector (0,1,0,0). - public static Vector4D UnitY => new(Scalar.Zero, Scalar.One, Scalar.Zero, Scalar.Zero); - - /// Returns the vector (0,0,1,0). - public static Vector4D UnitZ => new(Scalar.Zero, Scalar.Zero, Scalar.One, Scalar.Zero); - - /// Returns the vector (0,0,0,1). - public static Vector4D UnitW => new(Scalar.Zero, Scalar.Zero, Scalar.Zero, Scalar.One); - - /// Adds two vectors together. - /// The first source vector. - /// The second source vector. - /// The summed vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator +(Vector4D left, Vector4D right) - => new(Scalar.Add(left.X, right.X), Scalar.Add(left.Y, right.Y), Scalar.Add(left.Z, right.Z), - Scalar.Add(left.W, right.W)); - - /// Divides the first vector by the second. - /// The first source vector. - /// The second source vector. - /// The vector resulting from the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator /(Vector4D left, Vector4D right) - => new(Scalar.Divide(left.X, right.X), Scalar.Divide(left.Y, right.Y), Scalar.Divide(left.Z, right.Z), - Scalar.Divide(left.W, right.W)); - - /// Divides the vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The result of the division. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator /(Vector4D value1, T value2) - => new(Scalar.Divide(value1.X, value2), Scalar.Divide(value1.Y, value2), - Scalar.Divide(value1.Z, value2), Scalar.Divide(value1.W, value2)); - - /// Returns a boolean indicating whether the two given vectors are equal. - /// The first vector to compare. - /// The second vector to compare. - /// True if the vectors are equal; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public static bool operator ==(Vector4D left, Vector4D right) - => Scalar.Equal(left.X, right.X) - && Scalar.Equal(left.Y, right.Y) - && Scalar.Equal(left.Z, right.Z) - && Scalar.Equal(left.W, right.W); - - /// Returns a boolean indicating whether the two given vectors are not equal. - /// The first vector to compare. - /// The second vector to compare. - /// True if the vectors are not equal; False if they are equal. - [MethodImpl((MethodImplOptions) 768)] - public static bool operator !=(Vector4D left, Vector4D right) - => !(left == right); - - /// Multiplies two vectors together. - /// The first source vector. - /// The second source vector. - /// The product vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator *(Vector4D left, Vector4D right) - => new(Scalar.Multiply(left.X, right.X), Scalar.Multiply(left.Y, right.Y), - Scalar.Multiply(left.Z, right.Z), Scalar.Multiply(left.W, right.W)); - - /// Multiplies a vector by the given scalar. - /// The source vector. - /// The scalar value. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator *(Vector4D left, T right) - => new(Scalar.Multiply(left.X, right), Scalar.Multiply(left.Y, right), - Scalar.Multiply(left.Z, right), Scalar.Multiply(left.W, right)); - - /// Multiplies a vector by the given scalar. - /// The scalar value. - /// The source vector. - /// The scaled vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator *(T left, Vector4D right) - => right * left; - - /// Subtracts the second vector from the first. - /// The first source vector. - /// The second source vector. - /// The difference vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator -(Vector4D left, Vector4D right) - => new(Scalar.Subtract(left.X, right.X), Scalar.Subtract(left.Y, right.Y), - Scalar.Subtract(left.Z, right.Z), Scalar.Subtract(left.W, right.W)); - - /// Negates a given vector. - /// The source vector. - /// The negated vector. - [MethodImpl((MethodImplOptions) 768)] - public static Vector4D operator -(Vector4D value) => Zero - value; - - /// Copies the contents of the vector into the given array. - [MethodImpl((MethodImplOptions) 768)] - public readonly void CopyTo(T[]? array) - => CopyTo(array, 0); - - /// Copies the contents of the vector into the given array, starting from index. - /// If array is null. - /// If array is multidimensional. - /// If index is greater than end of the array or index is less than zero. - /// If number of elements in source vector is greater than those available in destination array. - [MethodImpl((MethodImplOptions) 768)] - public readonly void CopyTo(T[]? array, int index) - { - if (array is null) - { - throw new NullReferenceException("Object reference not set to an instance of an object."); - } - - if ((index < 0) || (index >= array.Length)) - { - throw new ArgumentOutOfRangeException(nameof(index), "Specified argument was out of the range of valid values."); - } - - if ((array.Length - index) < 4) - { - throw new ArgumentException("Value does not fall within the expected range."); - } - - array[index] = X; - array[index + 1] = Y; - array[index + 2] = Z; - array[index + 3] = W; - } - - /// Returns a boolean indicating whether the given is equal to this instance. - /// The to compare this instance to. - /// True if the other is equal to this instance; False otherwise. - public readonly bool Equals(Vector4D other) - => this == other; - - /// Returns a boolean indicating whether the given Object is equal to this instance. - /// The Object to compare against. - /// True if the Object is equal to this Vector4D; False otherwise. - [MethodImpl((MethodImplOptions) 768)] - public override readonly bool Equals(object? obj) - => (obj is Vector4D other) && Equals(other); - - /// Returns the hash code for this instance. - /// The hash code. - public override readonly int GetHashCode() - => HashCode.Combine(X, Y, Z, W); - - /// Returns the length of the vector. This operation is cheaper than Length(). - /// The vector's length. - public T Length - { - [MethodImpl((MethodImplOptions) 768)] - get => Scalar.Sqrt(LengthSquared); - } - - /// Returns the length of the vector squared. - /// The vector's length squared. - public T LengthSquared - { - [MethodImpl((MethodImplOptions) 768)] - get => Vector4D.Dot(this, this); - } - - /// Returns a String representing this instance. - /// The string representation. - public override readonly string ToString() - { - return ToString("G", CultureInfo.CurrentCulture); - } - - /// Returns a String representing this instance, using the specified format to format individual elements. - /// The format of individual elements. - /// The string representation. - public readonly string ToString(string? format) - { - return ToString(format, CultureInfo.CurrentCulture); - } - - /// Returns a String representing this instance, using the specified format to format individual elements - /// and the given IFormatProvider. - /// The format of individual elements. - /// The format provider to use when formatting elements. - /// The string representation. - public readonly string ToString(string? format, IFormatProvider? formatProvider) - { - StringBuilder sb = new(); - string separator = NumberFormatInfo.GetInstance(formatProvider).NumberGroupSeparator; - sb.Append('<'); - sb.Append(X.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(Y.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(Z.ToString(format, formatProvider)); - sb.Append(separator); - sb.Append(' '); - sb.Append(W.ToString(format, formatProvider)); - sb.Append('>'); - return sb.ToString(); - } - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into - /// - /// The source vector - /// The vector - public static explicit operator System.Numerics.Vector4(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Converts a into one with a of - /// - /// The source matrix - /// The matrix - public static explicit operator Vector4D(Vector4D from) - => new(Scalar.As(from.X), Scalar.As(from.Y), Scalar.As(from.Z), - Scalar.As(from.W)); - - /// - /// Returns this vector casted to - /// - /// The type to cast to - /// The casted vector - public Vector4D As() where TOther : unmanaged, IFormattable, IEquatable, IComparable - { - return new(Scalar.As(X), Scalar.As(Y), Scalar.As(Z), Scalar.As(W)); - } - } -} diff --git a/sources/Maths/Maths/Vector4D.gen.cs b/sources/Maths/Maths/Vector4D.gen.cs new file mode 100644 index 0000000000..e2c1c78e01 --- /dev/null +++ b/sources/Maths/Maths/Vector4D.gen.cs @@ -0,0 +1,732 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +namespace Silk.NET.Maths +{ + using System.Collections; + using System.Diagnostics.CodeAnalysis; + using System.Numerics; + using System.Runtime.CompilerServices; + using System.Runtime.InteropServices; + using System.Text; + + /// A structure encapsulating a 4D vector. + public partial struct Vector4D : + IEquatable>, + IReadOnlyList, + IFormattable, + IParsable>, + ISpanFormattable, + ISpanParsable>, + IUtf8SpanFormattable, + IUtf8SpanParsable> + where T : INumberBase + { + /// Gets a vector whose 4 elements are equal to one. + public static Vector4D One + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.One); + } + + /// Returns a vector whose 4 elements are equal to zero. + public static Vector4D Zero + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero); + } + + /// Gets the vector (1, 0, 0, 0). + public static Vector4D UnitX + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.One, T.Zero, T.Zero, T.Zero); + } + + /// Gets the vector (0, 1, 0, 0). + public static Vector4D UnitY + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero, T.One, T.Zero, T.Zero); + } + + /// Gets the vector (0, 0, 1, 0). + public static Vector4D UnitZ + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero, T.Zero, T.One, T.Zero); + } + + /// Gets the vector (0, 0, 0, 1). + public static Vector4D UnitW + { + [MethodImpl(MethodImplOptions.AggressiveInlining)] + get => new(T.Zero, T.Zero, T.Zero, T.One); + } + + /// The X component of the vector. + public T X; + + /// The Y component of the vector. + public T Y; + + /// The Z component of the vector. + public T Z; + + /// The W component of the vector. + public T W; + + /// The number of elements in the vector. + public int Count => 4; + + /// + T IReadOnlyList.this[int index] => this[index]; + + ///Gets the component at the specified index: 0 = X, 1 = Y, 2 = Z, 3 = W. + [UnscopedRef] + public ref T this[int index] + { + get + { + switch (index) + { + case 0: + return ref X; + case 1: + return ref Y; + case 2: + return ref Z; + case 3: + return ref W; + } + + throw new ArgumentOutOfRangeException(nameof(index)); + } + } + + /// Initializes all components of the vector to the same value. + public Vector4D(T value) => (X, Y, Z, W) = (value, value, value, value); + + /// Initializes the vector with individual component values. + public Vector4D(T x, T y, T z, T w) => (X, Y, Z, W) = (x, y, z, w); + + /// Initializes the vector using a for the initial elements, and the specified components for the remainder. + public Vector4D(Vector2D other, T z, T w) => (X, Y, Z, W) = (other.X, other.Y, z, w); + + /// Initializes the vector using a for the initial elements, and the specified component for the remainder. + public Vector4D(Vector3D other, T w) => (X, Y, Z, W) = (other.X, other.Y, other.Z, w); + + /// Initializes the vector from a span of 4 values. + public Vector4D(ReadOnlySpan values) + { + if (values.Length != 4) + throw new ArgumentException("Input span must contain exactly 4 elements.", nameof(values)); + + X = values[0]; + Y = values[1]; + Z = values[2]; + W = values[3]; + } + + /// + IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); + + /// Returns an enumerator that iterates through the vector components. + public IEnumerator GetEnumerator() + { + yield return X; + yield return Y; + yield return Z; + yield return W; + } + + /// Copies the components of the vector to the specified array starting at index 0. + public void CopyTo(T[] array) => CopyTo(array, 0); + + /// Copies the components of the vector to the specified array starting at the given index. + public void CopyTo(T[] array, int startIndex) + { + if (array == null) + throw new ArgumentNullException(nameof(array)); + if (startIndex < 0 || startIndex + 4 > array.Length) + throw new ArgumentOutOfRangeException(nameof(startIndex)); + + array[startIndex] = X; + array[startIndex + 1] = Y; + array[startIndex + 2] = Z; + array[startIndex + 3] = W; + } + + /// Copies the components of the vector to the specified span starting at index 0. + public void CopyTo(Span span) => CopyTo(span, 0); + + /// Copies the components of the vector to the specified span starting at the given index. + public void CopyTo(Span span, int startIndex) + { + if (startIndex < 0 || startIndex + 4 > span.Length) + throw new ArgumentOutOfRangeException(nameof(startIndex)); + + span[startIndex] = X; + span[startIndex + 1] = Y; + span[startIndex + 2] = Z; + span[startIndex + 3] = W; + } + + /// Returns a span over the vector components. + public Span AsSpan() => MemoryMarshal.CreateSpan(ref X, 4); + + /// Formats the vector as a string. + public override string ToString() => + $"<{X}, {Y}, {Z}, {W}>"; + + /// Formats the vector as a string using the specified format and format provider. + public string ToString(string? format, IFormatProvider? formatProvider) => + $"<{X.ToString(format, formatProvider)}, {Y.ToString(format, formatProvider)}, {Z.ToString(format, formatProvider)}, {W.ToString(format, formatProvider)}>"; + + /// Parses a string to a instance. + public static Vector4D Parse(string s, IFormatProvider? provider) => Parse(s.AsSpan(), provider); + + /// Parses a span to a instance. + public static Vector4D Parse(ReadOnlySpan s, IFormatProvider? provider) + { + if (!TryParse(s, provider, out var result)) + throw new FormatException("Invalid format for Vector4D."); + + return result; + } + + /// Formats the vector as a UTF-8 string using the specified format and format provider. + public bool TryFormat(Span utf8Destination, out int bytesWritten, ReadOnlySpan format, IFormatProvider? provider) + { + Span xBuffer = stackalloc char[64]; + Span yBuffer = stackalloc char[64]; + Span zBuffer = stackalloc char[64]; + Span wBuffer = stackalloc char[64]; + + if (!X.TryFormat(xBuffer, out int xChars, format, provider)|| + !Y.TryFormat(yBuffer, out int yChars, format, provider)|| + !Z.TryFormat(zBuffer, out int zChars, format, provider)|| + !W.TryFormat(wBuffer, out int wChars, format, provider)) + { + bytesWritten = 0; + return false; + } + + int estimatedSize = Encoding.UTF8.GetByteCount(xBuffer[..xChars]) + + Encoding.UTF8.GetByteCount(yBuffer[..yChars]) + + Encoding.UTF8.GetByteCount(zBuffer[..zChars]) + + Encoding.UTF8.GetByteCount(wBuffer[..wChars]) + + Encoding.UTF8.GetByteCount("<, >"); + + if (utf8Destination.Length < estimatedSize) + { + bytesWritten = 0; + return false; + } + + int totalBytes = 0; + + totalBytes += Encoding.UTF8.GetBytes("<", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(xBuffer[..xChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(", ", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(yBuffer[..yChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(", ", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(zBuffer[..zChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(", ", utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(wBuffer[..wChars], utf8Destination[totalBytes..]); + totalBytes += Encoding.UTF8.GetBytes(">", utf8Destination[totalBytes..]); + + bytesWritten = totalBytes; + return true; + } + + /// Formats the vector as a string using the specified format and format provider. + public bool TryFormat(Span destination, out int charsWritten, ReadOnlySpan format, IFormatProvider? provider) + { + Span xBuffer = stackalloc char[64]; + Span yBuffer = stackalloc char[64]; + Span zBuffer = stackalloc char[64]; + Span wBuffer = stackalloc char[64]; + + if (!X.TryFormat(xBuffer, out int xChars, format, provider) || + !Y.TryFormat(yBuffer, out int yChars, format, provider) || + !Z.TryFormat(zBuffer, out int zChars, format, provider) || + !W.TryFormat(wBuffer, out int wChars, format, provider)) + { + charsWritten = 0; + return false; + } + + int requiredLength = 1 + xChars + 2 + yChars + 2 + zChars + 2 + wChars + 1; + + if (destination.Length < requiredLength) + { + charsWritten = 0; + return false; + } + + int pos = 0; + destination[pos++] = '<'; + + xBuffer[..xChars].CopyTo(destination[pos..]); + pos += xChars; + + destination[pos++] = ','; + destination[pos++] = ' '; + + yBuffer[..yChars].CopyTo(destination[pos..]); + pos += yChars; + + destination[pos++] = ','; + destination[pos++] = ' '; + + zBuffer[..zChars].CopyTo(destination[pos..]); + pos += zChars; + + destination[pos++] = ','; + destination[pos++] = ' '; + + wBuffer[..wChars].CopyTo(destination[pos..]); + pos += wChars; + + destination[pos++] = '>'; + + charsWritten = pos; + return true; + } + + /// Tries to parse a span to a instance. + public static bool TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector4D result) + { + result = default; + + s = s.Trim(); + if (s.Length < 8 || s[0] != '<' || s[^1] != '>') + return false; + + s = s[1..^1]; // Remove < and > + + int commaX = s.IndexOf(','); + if (commaX < 0) + return false; + + ReadOnlySpan remainder1 = s.Slice(commaX + 1); + int commaYRelative = remainder1.IndexOf(','); + if (commaYRelative < 0) + return false; + int commaY = commaX + 1 + commaYRelative; + + ReadOnlySpan remainder2 = s.Slice(commaY + 1); + int commaZRelative = remainder2.IndexOf(','); + if (commaZRelative < 0) + return false; + int commaZ = commaY + 1 + commaZRelative; + + ReadOnlySpan xSpan = s[..commaX].Trim(); + ReadOnlySpan ySpan = s[(commaX + 1)..commaY].Trim(); + ReadOnlySpan zSpan = s[(commaY + 1)..commaZ].Trim(); + ReadOnlySpan wSpan = s[(commaZ + 1)..].Trim(); + + if (T.TryParse(xSpan, provider, out var x) && + T.TryParse(ySpan, provider, out var y) && + T.TryParse(zSpan, provider, out var z) && + T.TryParse(wSpan, provider, out var w)) + { + result = new Vector4D(x, y, z, w); + return true; + } + + return false; + } + + /// Parses a UTF-8 span to a instance. + public static Vector4D Parse(ReadOnlySpan utf8Text, IFormatProvider? provider) + { + int charCount = Encoding.UTF8.GetCharCount(utf8Text); + Span charBuffer = charCount <= 128 ? stackalloc char[charCount] : new char[charCount]; + Encoding.UTF8.GetChars(utf8Text, charBuffer); + return Parse(charBuffer, provider); + } + + /// Tries to parse a UTF-8 span to a instance. + public static bool TryParse(ReadOnlySpan utf8Text, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector4D result) + { + int charCount = Encoding.UTF8.GetCharCount(utf8Text); + Span charBuffer = charCount <= 128 ? stackalloc char[charCount] : new char[charCount]; + Encoding.UTF8.GetChars(utf8Text, charBuffer); + return TryParse(charBuffer, provider, out result); + } + + /// Tries to parse a string to a instance. + public static bool TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector4D result) => + TryParse(s.AsSpan(), provider, out result); + + /// Parses a span to a instance. + static Vector4D ISpanParsable>.Parse(ReadOnlySpan s, IFormatProvider? provider) => + Parse(s, provider); + + /// Parses a string to a instance. + static Vector4D IParsable>.Parse(string s, IFormatProvider? provider) => + Parse(s, provider); + + /// Tries to parse a span to a instance. + static bool ISpanParsable>.TryParse(ReadOnlySpan s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector4D result) => + TryParse(s, provider, out result); + + /// Tries to parse a string to a instance. + static bool IParsable>.TryParse([NotNullWhen(true)] string? s, IFormatProvider? provider, [MaybeNullWhen(false)] out Vector4D result) => + TryParse(s, provider, out result); + + /// Returns a boolean indicating whether the given two vectors are equal. + /// The first vector to compare. + /// The second vector to compare. + /// true if the given vectors are equal; false otherwise. + public static bool operator ==(Vector4D left, Vector4D right) => + left.X == right.X && + left.Y == right.Y && + left.Z == right.Z && + left.W == right.W; + + /// Returns a boolean indicating whether the given two vectors are not equal. + /// The first vector to compare. + /// The second vector to compare. + /// true if the given vectors are not equal; false otherwise. + public static bool operator !=(Vector4D left, Vector4D right) => !(left == right); + + /// + public override bool Equals(object? obj) => obj is Vector4D other && Equals(other); + + /// + public bool Equals(Vector4D other) => this == other; + + /// + public override int GetHashCode() => HashCode.Combine(X, Y, Z, W); + + /// Converts the components of this vector to another type. + public static Vector4D CreateChecked(Vector4D source) + where TOther : INumberBase => + new(T.CreateChecked(source.X), T.CreateChecked(source.Y), T.CreateChecked(source.Z), T.CreateChecked(source.W)); + + /// Converts the components of this vector to another type. + public static Vector4D CreateSaturating(Vector4D source) + where TOther : INumberBase => + new(T.CreateSaturating(source.X), T.CreateSaturating(source.Y), T.CreateSaturating(source.Z), T.CreateSaturating(source.W)); + + /// Converts the components of this vector to another type. + public static Vector4D CreateTruncating(Vector4D source) + where TOther : INumberBase => + new(T.CreateTruncating(source.X), T.CreateTruncating(source.Y), T.CreateTruncating(source.Z), T.CreateTruncating(source.W)); + + /// Converts the components of this vector to another type. + [Obsolete("Use AsChecked, AsSaturating, or AsTruncating instead.", error: false)] + public Vector4D As() + where TOther : INumberBase => + Vector4D.CreateTruncating(this); + + /// Converts the components of this vector to another type. + public Vector4D AsChecked() + where TOther : INumberBase => + Vector4D.CreateChecked(this); + + /// Converts the components of this vector to another type. + public Vector4D AsSaturating() + where TOther : INumberBase => + Vector4D.CreateSaturating(this); + + /// Converts the components of this vector to another type. + public Vector4D AsTruncating() + where TOther : INumberBase => + Vector4D.CreateTruncating(this); + + /// Implicitly casts a to a . + public static implicit operator Vector4D((T X, T Y, T Z, T W) v) => + new(v.X, v.Y, v.Z, v.W); + + /// Implicitly casts a to a . + public static implicit operator (T X, T Y, T Z, T W)(Vector4D v) => + (v.X, v.Y, v.Z, v.W); + + /// Returns the given vector. + /// The source vector. + /// The source vector. + public static Vector4D operator +(Vector4D vector) => + vector; + + /// Negates a given vector. + /// The source vector. + /// The negated vector. + public static Vector4D operator -(Vector4D vector) => + new(-vector.X, -vector.Y, -vector.Z, -vector.W); + + /// Adds two vectors together. + /// The first source vector. + /// The second source vector. + /// The summed vector. + public static Vector4D operator +(Vector4D left, Vector4D right) => + new(left.X + right.X, left.Y + right.Y, left.Z + right.Z, left.W + right.W); + + /// Subtracts the second vector from the first. + /// The first source vector. + /// The second source vector. + /// The difference vector. + public static Vector4D operator -(Vector4D left, Vector4D right) => + new(left.X - right.X, left.Y - right.Y, left.Z - right.Z, left.W - right.W); + + /// Multiplies two vectors together. + /// The first source vector. + /// The second source vector. + /// The product vector. + public static Vector4D operator *(Vector4D left, Vector4D right) => + new(left.X * right.X, left.Y * right.Y, left.Z * right.Z, left.W * right.W); + + /// Divides the first vector by the second. + /// The first source vector. + /// The second source vector. + /// The vector resulting from the division. + public static Vector4D operator /(Vector4D left, Vector4D right) => + new(left.X / right.X, left.Y / right.Y, left.Z / right.Z, left.W / right.W); + + /// Adds a scalar to the components of a vector. + /// The source vector. + /// The scalar value. + /// The offset vector. + public static Vector4D operator +(Vector4D vector, T scalar) => + new(vector.X + scalar, vector.Y + scalar, vector.Z + scalar, vector.W + scalar); + + /// Subtracts a scalar from the components of a vector. + /// The source vector. + /// The scalar value. + /// The offset vector. + public static Vector4D operator -(Vector4D vector, T scalar) => + new(vector.X - scalar, vector.Y - scalar, vector.Z - scalar, vector.W - scalar); + + /// Multiplies a vector by the given scalar. + /// The source vector. + /// The scalar value. + /// The scaled vector. + public static Vector4D operator *(Vector4D vector, T scalar) => + new(vector.X * scalar, vector.Y * scalar, vector.Z * scalar, vector.W * scalar); + + /// Multiplies a vector by the given scalar. + /// The scalar value. + /// The source vector. + /// The scaled vector. + public static Vector4D operator *(T scalar, Vector4D vector) => + new(scalar * vector.X, scalar * vector.Y, scalar * vector.Z, scalar * vector.W); + + /// Divides the vector by the given scalar. + /// The source vector. + /// The scalar value. + /// The result of the division. + public static Vector4D operator /(Vector4D vector, T scalar) => + new(vector.X / scalar, vector.Y / scalar, vector.Z / scalar, vector.W / scalar); + + /// Converts a to a . + public static explicit operator Vector4D(Vector4 from) => + new(T.CreateTruncating(from.X), T.CreateTruncating(from.Y), T.CreateTruncating(from.Z), T.CreateTruncating(from.W)); + + /// Converts a to a . + public static explicit operator checked Vector4D(Vector4 from) => + new(T.CreateChecked(from.X), T.CreateChecked(from.Y), T.CreateChecked(from.Z), T.CreateChecked(from.W)); + + /// Converts a to . + public static explicit operator Vector4(Vector4D from) => + new(float.CreateTruncating(from.X), float.CreateTruncating(from.Y), float.CreateTruncating(from.Z), float.CreateTruncating(from.W)); + + /// Converts a to . + public static explicit operator checked Vector4(Vector4D from) => + new(float.CreateChecked(from.X), float.CreateChecked(from.Y), float.CreateChecked(from.Z), float.CreateChecked(from.W)); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator Vector4D(Vector4D from) => + Vector4D.CreateTruncating(from); + + /// + /// Converts a vector of into one with an underlying type of . + /// + /// The source vector. + /// The vector. + public static explicit operator checked Vector4D(Vector4D from) => + Vector4D.CreateChecked(from); + } +} diff --git a/tests/Maths/Maths/ExpTests.cs b/tests/Maths/Maths/ExpTests.cs deleted file mode 100644 index 668a49e77e..0000000000 --- a/tests/Maths/Maths/ExpTests.cs +++ /dev/null @@ -1,75 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using Xunit; - -namespace Silk.NET.Maths.Tests -{ - public class ExpTests - { - [Fact] - public void MaxInf() - { - var value = 3.5990256e+33f + 1; - var expected = float.PositiveInfinity; -#if !NET48 - Assert.StrictEqual(expected, MathF.Exp(value)); -#endif - Assert.StrictEqual(expected, Scalar.Exp(value)); - } - - [Fact] - public void Exp0() - { - var value = 0f; - var expected = 1f; -#if !NET48 - Assert.StrictEqual(expected, MathF.Exp(value)); -#endif - Assert.StrictEqual(expected, Scalar.Exp(value)); - } - - [Fact] - public void Exp1() - { - var value = 1f; - var expected = 2.71828182846f; -#if !NET48 - Assert.StrictEqual(expected, MathF.Exp(value)); -#endif - Assert.StrictEqual(expected, Scalar.Exp(value)); - } - - [Fact] - public void Exp2() - { - var value = 2f; - var expected = 7.38905609893f; -#if !NET48 - Assert.StrictEqual(expected, MathF.Exp(value)); -#endif - Assert.Equal(expected, Scalar.Exp(value)); - } - - [Fact] - public void Exp5() - { - var value = 5f; - var expected = 148.413159103f; -#if !NET48 - Assert.StrictEqual(expected, MathF.Exp(value)); -#endif - Assert.Equal(expected, Scalar.Exp(value)); - } - - // [Fact] - // public void Exp50() - // { - // var value = 50f; - // var expected = 5.1847055e+21f; - // Assert.Equal(expected, MathF.Exp(value)); - // Assert.Equal(expected, Scalar.Exp(value)); - // } - } -} diff --git a/tests/Maths/Maths/LogTests.cs b/tests/Maths/Maths/LogTests.cs deleted file mode 100644 index 3ff2b0bee7..0000000000 --- a/tests/Maths/Maths/LogTests.cs +++ /dev/null @@ -1,56 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Xunit; - -namespace Silk.NET.Maths.Tests -{ - public class LogTests - { - [Fact] - public void Log0() - { - Assert.StrictEqual(float.NegativeInfinity, Scalar.Log(0f)); - } - - [Fact] - public void Log1() - { - Assert.StrictEqual(0f, Scalar.Log(1f)); - } - - [Fact] - public void LogSmall1() - { - Assert.Equal(-2.0955709236097195567919657540932, Scalar.Log(.123f), 6); - // MathF is also inaccurate :) -#if !NET48 - Assert.Equal(-2.0955709236097195567919657540932, System.MathF.Log(.123f), 6); -#endif - } - - [Fact] - public void Log2() - { - Assert.Equal(0.69314718055994530941723212145818f, Scalar.Log(2f)); - } - - [Fact] - public void Log5() - { - Assert.Equal(1.6094379124341003746007593332262f, Scalar.Log(5f)); - } - - [Fact] - public void Log100() - { - Assert.Equal(4.6051701859880913680359829093687f, Scalar.Log(100f)); - } - - [Fact] - public void Log123() - { - Assert.Equal(4.8121843553724174952620086099599f, Scalar.Log(123f)); - } - } -} diff --git a/tests/Maths/Maths/PlaneTests.cs b/tests/Maths/Maths/PlaneTests.cs index 53a869dd4a..ff12a98c3f 100644 --- a/tests/Maths/Maths/PlaneTests.cs +++ b/tests/Maths/Maths/PlaneTests.cs @@ -147,7 +147,7 @@ public void PlaneCreateFromVerticesTest2() Vector3D point3 = new Vector3D(1.0f, 1.0f, 0.0f); Plane target = Plane.CreateFromVertices(point1, point2, point3); - var invRoot2 = 1.0f / Scalar.Sqrt(2); + var invRoot2 = 1.0f / float.Sqrt(2); Plane expected = new Plane(new Vector3D(invRoot2, 0, invRoot2), -invRoot2); Assert.True(MathHelper.Equal(target, expected), "Plane.cstor did not return the expected value."); @@ -217,7 +217,7 @@ public void PlaneNormalizeTest() Plane target = new Plane(1, 2, 3, 4); float f = target.Normal.LengthSquared; - float invF = 1.0f / (float)Scalar.Sqrt(f); + float invF = 1.0f / float.Sqrt(f); Plane expected = new Plane(target.Normal * invF, target.Distance * invF); Plane actual = Plane.Normalize(target); diff --git a/tests/Maths/Maths/PowIntTests.cs b/tests/Maths/Maths/PowIntTests.cs deleted file mode 100644 index c65dfb66d8..0000000000 --- a/tests/Maths/Maths/PowIntTests.cs +++ /dev/null @@ -1,55 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using Xunit; - -namespace Silk.NET.Maths.Tests -{ - public class PowIntTests - { - [Fact] - public void Powx0() - { - var a = 100; - var b = 0; - var expected = 1; - Assert.Equal(expected, Scalar.Pow(a, b)); - } - - [Fact] - public void Pow00() - { - var a = 0; - var b = 0; - var expected = 0; - Assert.Equal(expected, Scalar.Pow(a, b)); - } - - [Fact] - public void Pow12() - { - var a = 1; - var b = 2; - var expected = 1; - Assert.Equal(expected, Scalar.Pow(a, b)); - } - - [Fact] - public void Pow24() - { - var a = 2; - var b = 4; - var expected = 2 << 3; - Assert.Equal(expected, Scalar.Pow(a, b)); - } - - [Fact] - public void Pow2Minus4() - { - var a = 2; - var b = -4; - var expected = Scalar.Reciprocal(2 << 3); - Assert.Equal(expected, Scalar.Pow(a, b)); - } - } -} diff --git a/tests/Maths/Maths/Scalar.Bitwise.cs b/tests/Maths/Maths/Scalar.Bitwise.cs deleted file mode 100644 index a61ac7a8c9..0000000000 --- a/tests/Maths/Maths/Scalar.Bitwise.cs +++ /dev/null @@ -1,111 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System; -using System.Globalization; -using System.Runtime.InteropServices; -using Xunit; - -namespace Silk.NET.Maths.Tests -{ - public class ScalarBitwiseTest - { - [Fact] - public void RotateLeft1() - { - Assert.Equal((byte)0b1110_0001, Scalar.RotateLeft((byte)0b1111_0000, 1)); - } - - [Fact] - public void RotateLeft2() - { - Assert.Equal((ushort)0b1100_1000_0000_0011, Scalar.RotateLeft((ushort)0b1111_0010_0000_0000, 2)); - } - - [Fact] - public void RotateRight1() - { - Assert.Equal((byte)0b1111_0000, Scalar.RotateRight((byte)0b1110_0001, 1)); - } - - [Fact] - public void RotateRight2() - { - Assert.Equal((ushort)0b1111_0010_0000_0000, Scalar.RotateRight((ushort)0b1100_1000_0000_0011, 2)); - } - - [Fact] - public void And1() - { - Assert.Equal(0b1010, Scalar.And(0b1110, 0b1011)); - } - - [Fact] - public void And2() - { - Assert.Equal((byte)0b1010, Scalar.And((byte)0b1110, (byte)0b1011)); - } - - [Fact] - public void And3() - { - Assert.Equal((long)0b1010, Scalar.And((long)0b1110, (long)0b1011)); - } - - [Fact] - public void Or1() - { - Assert.Equal(0b1111, Scalar.Or(0b1110, 0b1011)); - } - - [Fact] - public void Or2() - { - Assert.Equal((byte)0b1111, Scalar.Or((byte)0b1110, (byte)0b1011)); - } - - [Fact] - public void Or3() - { - Assert.Equal((long)0b1111, Scalar.Or((long)0b1110, (long)0b1011)); - } - - [Fact] - public void Xor1() - { - Assert.Equal(0b0101, Scalar.Xor(0b1110, 0b1011)); - } - - [Fact] - public void Xor2() - { - Assert.Equal((byte)0b0101, Scalar.Xor((byte)0b1110, (byte)0b1011)); - } - - [Fact] - public void Xor3() - { - Assert.Equal((long)0b0101, Scalar.Xor((long)0b1110, (long)0b1011)); - } - - [Fact] - public void Not1() - { - Assert.Equal(~0b1110, Scalar.Not(0b1110)); - } - - [Fact] - public void Not2() - { - var b = ~(byte)0b1110; - // ReSharper disable once IntVariableOverflowInUncheckedContext - Assert.Equal((byte)b, Scalar.Not((byte)0b1110)); - } - - [Fact] - public void Not3() - { - Assert.Equal(~(ulong)0b1110, Scalar.Not((ulong)0b1110)); - } - } -} \ No newline at end of file diff --git a/tests/Maths/Maths/ScalarTests.cs b/tests/Maths/Maths/ScalarTests.cs deleted file mode 100644 index 3966c63061..0000000000 --- a/tests/Maths/Maths/ScalarTests.cs +++ /dev/null @@ -1,90 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. - -using System.Numerics; -using Xunit; - -namespace Silk.NET.Maths.Tests -{ - public class ScalarTests - { - [Fact] public void AddBigInteger() - => Assert.Equal(new BigInteger(100), Scalar.Add(BigInteger.One, 99)); - - [Fact] public void SubtractBigInteger() - => Assert.Equal(new BigInteger(-98), Scalar.Subtract(BigInteger.One, 99)); - - [Fact] public void MultiplyBigInteger() - => Assert.Equal(new BigInteger(990), Scalar.Multiply(new BigInteger(10), 99)); - - [Fact] public void DivideBigInteger() - => Assert.Equal(new BigInteger(5), Scalar.Divide(new BigInteger(16), 3)); - - [Fact] public void LessThanBigInteger() - => Assert.True(Scalar.LessThan(new BigInteger(10), 99)); - - [Fact] public void GreaterThanBigInteger() - => Assert.False(Scalar.GreaterThan(new BigInteger(10), 99)); - - [Fact] public void LessThanOrEqualBigInteger() - => Assert.True(Scalar.LessThanOrEqual(new BigInteger(10), 99)); - - [Fact] public void GreaterThanOrEqualBigInteger() - => Assert.False(Scalar.GreaterThanOrEqual(new BigInteger(10), 99)); - - [Fact] public void EqualBigInteger1() - => Assert.False(Scalar.Equal(new BigInteger(10), 99)); - - [Fact] public void EqualBigInteger2() - => Assert.True(Scalar.Equal(new BigInteger(10), 10)); - - // [Fact(Skip = "Abs is unmanaged currently")] public void AbsBigInteger() - // => Assert.Equal(new BigInteger(5), Scalar.Abs(new BigInteger(-5))); - - - [Fact] public void AddComplex() - => Assert.Equal(new Complex(109, 5), Scalar.Add(new Complex(10, 5), 99)); - - [Fact] public void SubtractComplex() - => Assert.Equal(new Complex(-89, 5), Scalar.Subtract(new Complex(10, 5), 99)); - - [Fact] public void MultiplyComplex() - => Assert.Equal(new Complex(990, 495), Scalar.Multiply(new Complex(10, 5), 99)); - - [Fact] public void DivideComplex() - => Assert.Equal(new Complex(10 / 99d, 5 / 99d), Scalar.Divide(new Complex(10, 5), 99)); - - [Fact] public void EqualComplex1() - => Assert.True(Scalar.Equal(new Complex(10, 5), new Complex(10, 5))); - - [Fact] public void EqualComplex2() - => Assert.False(Scalar.Equal(new Complex(10, 5), new Complex(10, 6))); - - [Fact] public void IsFiniteComplex1() - => Assert.True(Scalar.IsFinite(new Complex(10, 5))); - - [Fact] public void IsFiniteComplex2() - => Assert.False(Scalar.IsFinite(new Complex(double.NaN, 5))); - - [Fact] public void IsFiniteComplex3() - => Assert.False(Scalar.IsFinite(new Complex(10, double.NaN))); - - [Fact] public void IsFiniteComplex4() - => Assert.False(Scalar.IsFinite(new Complex(10, double.NegativeInfinity))); - - [Fact] public void IsInfinityComplex1() - => Assert.True(Scalar.IsInfinity(new Complex(double.NegativeInfinity, 5))); - - [Fact] public void IsInfinityComplex2() - => Assert.True(Scalar.IsInfinity(new Complex(5, double.NegativeInfinity))); - - [Fact] public void IsInfinityComplex3() - => Assert.True(Scalar.IsInfinity(new Complex(double.PositiveInfinity, 5))); - - [Fact] public void IsInfinityComplex4() - => Assert.True(Scalar.IsInfinity(new Complex(5, double.PositiveInfinity))); - - [Fact] public void AbsComplex() - => Assert.Equal(new Complex(5, 0), Scalar.Abs(new Complex(3, 4))); - } -} \ No newline at end of file