diff --git a/src/code/SMath/Geometry2D/GeometricVector2.cs b/src/code/SMath/Geometry2D/GeometricVector2.cs index dc9d52e..3b02b5e 100644 --- a/src/code/SMath/Geometry2D/GeometricVector2.cs +++ b/src/code/SMath/Geometry2D/GeometricVector2.cs @@ -11,34 +11,40 @@ namespace SMath.Geometry2D public static class GeometricVector2 { /// - /// Vector magnitude/length/size/scalar. + /// Magnitude/length/size/scalar of vector. /// public static class Magnitude { /// - /// Get magnitude of a vector determined by cartesian coordinate system. + /// Calculate magnitude of a vector determined in cartesian coordinate system. /// public static N FromCartesian(N x, N y) where N : IRootFunctions => PT.Hypotenuse(x, y); /// - /// Get magnitude of a vector determined by cartesian coordinate system. + /// Calculate magnitude of a vector determined in cartesian coordinate system. /// public static N FromCartesian((N X, N Y) vector) where N : IRootFunctions => PT.Hypotenuse(vector.X, vector.Y); + /// + /// Calculate magnitude of vectors determined in cartesian coordinate system. + /// public static N FromCartesianVectors(params (N X, N Y)[] vectors) where N : IRootFunctions => FromCartesian(Cartesian.FromCartesianVectors(vectors)); + /// + /// Calculate magnitude of two vectors determined in polar coordinate system. + /// public static N FromTwoPolarVectors(N magnitude1, N magnitude2, N angle) where N : ITrigonometricFunctions, IRootFunctions => PT.Cosine(magnitude1, magnitude2, -angle); /// - /// Magnitude of sum of two polar vectors. + /// Calculate magnitude of sum of two vectors determined in polar coordinate system. /// public static N FromPolarVectors((N Magnitude, N Angle) vector1, (N Magnitude, N Angle) vector2) where N : ITrigonometricFunctions, IRootFunctions @@ -61,7 +67,7 @@ public static N FromPolar(N magnitude, N φ1) public static class Y { /// - /// Get y-component of vector determined by polar coordinate system. + /// Calculate y-component of vector determined in polar coordinate system. /// public static N FromPolar(N magnitude, N φ1) where N : ITrigonometricFunctions @@ -82,6 +88,9 @@ public static N FromCartesian((N X, N Y) vector) => N.Atan(vector.Y / vector.X); } + /// + /// Vector in cartesian coordinate system. + /// public static class Cartesian { public static (N X, N Y) FromPolar(N magnitude, N φ1) @@ -118,6 +127,9 @@ public static (N X, N Y) Kvadrantized((N X, N Y) vector) => (vector.X / N.Abs(vector.X), vector.Y / N.Abs(vector.Y)); } + /// + /// Vector in polar coordinate system. + /// public static class Polar { public static (N Magnitude, N Φ1) FromCartesian(N x, N y) @@ -185,7 +197,7 @@ public static N FromPolar((N Radius, N Angle) vector1, (N Radius, N Angle) ve } /// - /// Direction from one to the other vector. + /// Direction from one to the other vector. It is not normalized. /// public static class Direction {