diff --git a/src/NetFabric.Numerics.Angle/AngleAverage.cs b/src/NetFabric.Numerics.Angle/AngleAverage.cs index 1077fba..b08214d 100644 --- a/src/NetFabric.Numerics.Angle/AngleAverage.cs +++ b/src/NetFabric.Numerics.Angle/AngleAverage.cs @@ -3,7 +3,7 @@ public static partial class Angle { /// - /// Calculates the average of an collection of angles. + /// Calculates the average of a collection of angles. /// /// The enumerable of angles. /// The average angle in the collection, or null if the collection is empty. @@ -32,7 +32,7 @@ public static partial class Angle } /// - /// Calculates the average of an collection of angles. + /// Calculates the average of an array of angles. /// /// The array of angles. /// The average angle in the collection, or null if the collection is empty. @@ -47,37 +47,7 @@ public static partial class Angle => source.AsSpan().Average(); /// - /// Calculates the average of an collection of angles. - /// - /// The of angles. - /// The average angle in the collection, or null if the collection is empty. - /// - /// The average angle is computed by summing all the angles in the given collection and dividing the sum by the count of angles. - /// If the array is empty, the method returns null to indicate that there are no angles to compute the average from. - /// The resulting angle represents the average value of all the angles. - /// - public static Angle? Average(this Memory> source) - where TUnits : IAngleUnits - where T : struct, IFloatingPoint, IMinMaxValue - => source.Span.Average(); - - /// - /// Calculates the average of an collection of angles. - /// - /// The of angles. - /// The average angle in the collection, or null if the collection is empty. - /// - /// The average angle is computed by summing all the angles in the given collection and dividing the sum by the count of angles. - /// If the array is empty, the method returns null to indicate that there are no angles to compute the average from. - /// The resulting angle represents the average value of all the angles. - /// - public static Angle? Average(this ReadOnlyMemory> source) - where TUnits : IAngleUnits - where T : struct, IFloatingPoint, IMinMaxValue - => source.Span.Average(); - - /// - /// Calculates the average of an collection of angles. + /// Calculates the average of a span of angles. /// /// The of angles. /// The average angle in the collection, or null if the collection is empty. @@ -92,7 +62,7 @@ public static partial class Angle => ((ReadOnlySpan>)source).Average(); /// - /// Calculates the average of an collection of angles. + /// Calculates the average of a read-only span of angles. /// /// The of angles. /// The average angle in the collection, or null if the collection is empty. diff --git a/src/NetFabric.Numerics.Angle/AngleSum.cs b/src/NetFabric.Numerics.Angle/AngleSum.cs index 1a4bd43..6d9c754 100644 --- a/src/NetFabric.Numerics.Angle/AngleSum.cs +++ b/src/NetFabric.Numerics.Angle/AngleSum.cs @@ -28,7 +28,7 @@ public static Angle Sum(this IEnumerable> } /// - /// Calculates the sum of a collection of angles. + /// Calculates the sum of an array of angles. /// /// The array collection of angles. /// The sum of the angles in the collection. @@ -41,7 +41,7 @@ public static Angle Sum(this Angle[] source) => source.AsSpan().Sum(); /// - /// Calculates the sum of a collection of angles. + /// Calculates the sum of a span of angles. /// /// The collection of angles. /// The sum of the angles in the collection. @@ -54,7 +54,7 @@ public static Angle Sum(this Span> source => ((ReadOnlySpan>)source).Sum(); /// - /// Calculates the sum of a collection of angles. + /// Calculates the sum of a read-only span of angles. /// /// The collection of angles. /// The sum of the angles in the collection. diff --git a/src/NetFabric.Numerics.Angle/AngleTrigonometry.cs b/src/NetFabric.Numerics.Angle/AngleTrigonometry.cs index dc5225d..e4305c4 100644 --- a/src/NetFabric.Numerics.Angle/AngleTrigonometry.cs +++ b/src/NetFabric.Numerics.Angle/AngleTrigonometry.cs @@ -95,9 +95,9 @@ public static Angle Atan(T tan) /// /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Angle Atan2(T x, T y) + public static Angle Atan2(T y, T x) where T : struct, IFloatingPointIeee754, IMinMaxValue - => new(T.Atan2(x, y)); + => new(T.Atan2(y, x)); /// /// Calculates the arc cotangent of a value. diff --git a/src/NetFabric.Numerics.Angle/Quadrant.cs b/src/NetFabric.Numerics.Angle/Quadrant.cs index 21a42bd..e440c7e 100644 --- a/src/NetFabric.Numerics.Angle/Quadrant.cs +++ b/src/NetFabric.Numerics.Angle/Quadrant.cs @@ -1,40 +1,47 @@ namespace NetFabric.Numerics; /// -/// The four regions divided by the x and y axis. +/// An enumeration representing the quadrants and axes in a two-dimensional Cartesian coordinate system. /// public enum Quadrant { /// - /// Lies on the positive x axis. + /// Represents the positive x-axis. /// PositiveX, + /// - /// The region where x and y are positive. + /// Represents the first quadrant, where both x and y values are positive. /// First, + /// - /// Lies on the positive y axis. + /// Represents the positive y-axis. /// PositiveY, + /// - /// The region where x is negative and y is positive. + /// Represents the second quadrant, where x is negative, and y is positive. /// Second, + /// - /// Lies on the negative x axis. + /// Represents the negative x-axis. /// NegativeX, + /// - /// The region where x and y are negative. + /// Represents the third quadrant, where both x and y values are negative. /// Third, + /// - /// Lies on the negative y axis. + /// Represents the negative y-axis. /// NegativeY, + /// - /// The region where x is positive and y is negative. + /// Represents the fourth quadrant, where x is positive, and y is negative. /// Fourth -} \ No newline at end of file +}