Enhanced C#
Language of your choice: library documentation
Static Public Member Functions | List of all members
Loyc.Geometry.PointMath Class Reference

Math and extension methods for Point<T>. More...


Source files:

Remarks

Math and extension methods for Point<T>.

This contains many methods that should be considered "core" functionality, including many methods such as Add(), Sub() and Mul() that would ordinarily be implemented as operators (+ - *) if it weren't for limitations of C#. These operations are implemented as extension methods for performance reasons, because as a generic class, Point<T> cannot do arithmetic quickly. The extension methods provide operations that are optimized for specific data types (currently int, float and double).

Static Public Member Functions

static T Cross< T > (this Vector< T > a, Vector< T > b)
 Computes the "cross product" of a pair of vectors. More...
 
static Vector< T > Rot90< T > (this Vector< T > self)
 Rotates a vector 90 degrees. More...
 
static T Quadrance< T > (this Vector< T > self)
 Gets the square of the length of the vector. More...
 
static T Length< T > (this Vector< T > self)
 Gets the length of the vector. More...
 
static double Angle< T > (this Vector< T > self)
 Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2. More...
 
static bool Normalize< T > (this Vector< T > self)
 
static Vector< T > Normalized< T > (this Vector< T > self)
 
static Vector< T > MulDiv< T > (this Vector< T > self, T mul, T div)
 
static Vector< T > Vector< T > (this LineSegment< T > seg)
 Returns the vector from A to B (seg.B - seg.A) More...
 
static Point< T > HalfwayTo< T > (this Point< T > a, Point< T > b)
 Returns the midpoint between A and B ((a + b) / 2) More...
 
static System.Drawing.Point AsBCL (this Point< int > p)
 Converts a Loyc point to BCL type. More...
 
static System.Drawing.Point AsBCL (this Vector< int > p)
 Converts a Loyc vector to BCL type. More...
 
static System.Drawing.PointF AsBCL (this Point< float > p)
 Converts a Loyc point to BCL type. More...
 
static System.Drawing.PointF AsBCL (this Vector< float > p)
 Converts a Loyc vector to BCL type. More...
 
static System.Windows.Point AsBCL (this Point< double > p)
 Converts a Loyc point to BCL type. More...
 
static System.Windows.Vector AsBCL (this Vector< double > p)
 Converts a Loyc vector to BCL type. More...
 
static Point< int > AsLoyc (this System.Drawing.Point p)
 Converts a BCL point to a Loyc point. More...
 
static Point< float > AsLoyc (this System.Drawing.PointF p)
 Converts a BCL point to a Loyc point. More...
 
static Point< double > AsLoyc (this System.Windows.Point p)
 Converts a BCL point to a Loyc point. More...
 
static Vector< double > AsLoyc (this System.Windows.Vector p)
 Converts a BCL Vector to a Loyc point. More...
 
static Vector< int > AsLoycVector (this System.Drawing.Point p)
 Converts a BCL point to a Loyc vector. More...
 
static Vector< float > AsLoycVector (this System.Drawing.PointF p)
 Converts a BCL point to a Loyc vector. More...
 
static Vector< double > AsLoycVector (this System.Windows.Point p)
 Converts a BCL point to a Loyc vector. More...
 
static LineSegment< T > To< T > (this Point< T > a, Point< T > b)
 Constructs a LineSegment<T> from two points. More...
 
static Vector< T > Abs< T > (this Vector< T > v)
 Gets the absolute value of vector's individual components. More...
 
static Vector3< T > Abs< T > (this Vector3< T > v)
 Gets the absolute value of vector's individual components. More...
 
static PointF Transform (this System.Drawing.Drawing2D.Matrix matrix, PointF point)
 
static Point< float > Transform (this System.Drawing.Drawing2D.Matrix matrix, Point< float > point)
 
static Vector< float > Transform (this System.Drawing.Drawing2D.Matrix matrix, Vector< float > vec)
 
static Point< T > Add< T > (this Point< T > a, Vector< T > b)
 
static Point< T > Add< T > (this Vector< T > a, Point< T > b)
 
static Vector< T > Add< T > (this Vector< T > a, Vector< T > b)
 
static Vector< T > Sub< T > (this Point< T > a, Point< T > b)
 
static Vector< T > Sub< T > (this Vector< T > a, Vector< T > b)
 
static Point< T > Sub< T > (this Point< T > a, Vector< T > b)
 
static Vector< T > Mul< T > (this Vector< T > p, T factor)
 
static Point< T > Mul< T > (this Point< T > p, T factor)
 
static Vector< T > Div< T > (this Vector< T > p, T factor)
 
static Point< T > Div< T > (this Point< T > p, T factor)
 
static Vector< T > Shl< T > (this Vector< T > p, int amt)
 
static Vector< T > Shr< T > (this Vector< T > p, int amt)
 
static Point< T > Shl< T > (this Point< T > p, int amt)
 
static Point< T > Shr< T > (this Point< T > p, int amt)
 
static Vector3< T > Add< T > (this Vector3< T > a, Vector3< T > b)
 
static Point3< T > Add< T > (this Point3< T > a, Vector3< T > b)
 
static Point3< T > Add< T > (this Vector3< T > a, Point3< T > b)
 
static Vector3< T > Sub< T > (this Vector3< T > a, Vector3< T > b)
 
static Vector3< T > Sub< T > (this Point3< T > a, Point3< T > b)
 
static Point3< T > Sub< T > (this Point3< T > a, Vector3< T > b)
 
static Vector3< T > Mul< T > (this Vector3< T > p, T factor)
 
static Point3< T > Mul< T > (this Point3< T > p, T factor)
 
static Vector3< T > Div< T > (this Vector3< T > p, T factor)
 
static Point3< T > Div< T > (this Point3< T > p, T factor)
 
static Vector3< T > Shl< T > (this Vector3< T > p, int amt)
 
static Vector3< T > Shr< T > (this Vector3< T > p, int amt)
 
static Point3< T > Shl< T > (this Point3< T > p, int amt)
 
static Point3< T > Shr< T > (this Point3< T > p, int amt)
 
static Vector Add (this Vector a, Vector b)
 
static Point Add (this Point a, Vector b)
 
static Point Add (this Vector a, Point b)
 
static Vector Sub (this Vector a, Vector b)
 
static Vector Sub (this Point a, Point b)
 
static Point Sub (this Point a, Vector b)
 
static Vector Mul (this Vector p, T factor)
 
static Point Mul (this Point p, T factor)
 
static Vector Div (this Vector p, T factor)
 
static Point Div (this Point p, T factor)
 
static Vector Shl (this Vector p, int amt)
 
static Vector Shr (this Vector p, int amt)
 
static Point Shl (this Point p, int amt)
 
static Point Shr (this Point p, int amt)
 
static Vector3 Add (this Vector3 a, Vector3 b)
 
static Point3 Add (this Point3 a, Vector3 b)
 
static Point3 Add (this Vector3 a, Point3 b)
 
static Vector3 Sub (this Vector3 a, Vector3 b)
 
static Vector3 Sub (this Point3 a, Point3 b)
 
static Vector3 Mul (this Vector3 p, T factor)
 
static Point3 Mul (this Point3 p, T factor)
 
static Vector3 Div (this Vector3 p, T factor)
 
static Point3 Div (this Point3 p, T factor)
 
static Vector3 Shl (this Vector3 p, int amt)
 
static Vector3 Shr (this Vector3 p, int amt)
 
static Point3 Shl (this Point3 p, int amt)
 
static Point3 Shr (this Point3 p, int amt)
 
static T Dot (this Vector a, Vector b)
 Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors. More...
 
static T Dot (this Vector3 a, Vector3 b)
 
static T Cross (this Vector a, Vector b)
 Computes the "cross product" of a pair of 2D vectors. More...
 
static Vector3 Cross (this Vector3 a, Vector3 b)
 Computes the cross product of a pair of 3D vectors. More...
 
static Vector Rot90 (this Vector a)
 Rotates a vector 90 degrees. More...
 
static Vector Neg (this Vector a)
 Reverses a vector. More...
 
static Vector3 Neg (this Vector3 a)
 Reverses a vector. More...
 
static T Quadrance (this Vector v)
 Gets the square of the length of the vector. More...
 
static T Quadrance (this Vector3 v)
 
static T Length (this Vector v)
 Gets the length of the vector. More...
 
static T Length (this Vector3 v)
 
static double Angle (this Vector v)
 Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2. More...
 
static double AngleDeg (this Vector v)
 Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90. More...
 
static Vector MulDiv (this Vector v, T mul, T div)
 
static Vector3 MulDiv (this Vector3 v, T mul, T div)
 
static Vector Vector (this LineSegment seg)
 Returns seg.B - seg.A. More...
 
static Vector Abs (this Vector v)
 Gets the absolute value of the vector's individual components. More...
 
static Vector3 Abs (this Vector3 v)
 Gets the absolute value of the vector's individual components. More...
 
static Vector< T > PolarToVector (T magnitude, double radians)
 
static Point< T > PolarToPoint (T magnitude, double radians)
 
static IListSource< PointComputeConvexHull (IEnumerable< Point > points)
 Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system). More...
 
static IListSource< PointComputeConvexHull (List< Point > points, bool sortInPlace)
 
static Vector Add (this Vector a, Vector b)
 
static Point Add (this Point a, Vector b)
 
static Point Add (this Vector a, Point b)
 
static Vector Sub (this Vector a, Vector b)
 
static Vector Sub (this Point a, Point b)
 
static Point Sub (this Point a, Vector b)
 
static Vector Mul (this Vector p, T factor)
 
static Point Mul (this Point p, T factor)
 
static Vector Div (this Vector p, T factor)
 
static Point Div (this Point p, T factor)
 
static Vector Shl (this Vector p, int amt)
 
static Vector Shr (this Vector p, int amt)
 
static Point Shl (this Point p, int amt)
 
static Point Shr (this Point p, int amt)
 
static Vector3 Add (this Vector3 a, Vector3 b)
 
static Point3 Add (this Point3 a, Vector3 b)
 
static Point3 Add (this Vector3 a, Point3 b)
 
static Vector3 Sub (this Vector3 a, Vector3 b)
 
static Vector3 Sub (this Point3 a, Point3 b)
 
static Vector3 Mul (this Vector3 p, T factor)
 
static Point3 Mul (this Point3 p, T factor)
 
static Vector3 Div (this Vector3 p, T factor)
 
static Point3 Div (this Point3 p, T factor)
 
static Vector3 Shl (this Vector3 p, int amt)
 
static Vector3 Shr (this Vector3 p, int amt)
 
static Point3 Shl (this Point3 p, int amt)
 
static Point3 Shr (this Point3 p, int amt)
 
static T Dot (this Vector a, Vector b)
 Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors. More...
 
static T Dot (this Vector3 a, Vector3 b)
 
static T Cross (this Vector a, Vector b)
 Computes the "cross product" of a pair of 2D vectors. More...
 
static Vector3 Cross (this Vector3 a, Vector3 b)
 Computes the cross product of a pair of 3D vectors. More...
 
static Vector Rot90 (this Vector a)
 Rotates a vector 90 degrees. More...
 
static Vector Neg (this Vector a)
 Reverses a vector. More...
 
static Vector3 Neg (this Vector3 a)
 Reverses a vector. More...
 
static T Quadrance (this Vector v)
 Gets the square of the length of the vector. More...
 
static T Quadrance (this Vector3 v)
 
static T Length (this Vector v)
 Gets the length of the vector. More...
 
static T Length (this Vector3 v)
 
static double Angle (this Vector v)
 Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2. More...
 
static double AngleDeg (this Vector v)
 Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90. More...
 
static Vector Normalized (this Vector v)
 
static Vector3 Normalized (this Vector3 v)
 
static Vector MulDiv (this Vector v, T mul, T div)
 
static Vector3 MulDiv (this Vector3 v, T mul, T div)
 
static Vector Vector (this LineSegment seg)
 Returns seg.B - seg.A. More...
 
static Vector Abs (this Vector v)
 Gets the absolute value of the vector's individual components. More...
 
static Vector3 Abs (this Vector3 v)
 Gets the absolute value of the vector's individual components. More...
 
static Vector< T > PolarToVector (T magnitude, double radians)
 
static Point< T > PolarToPoint (T magnitude, double radians)
 
static IListSource< PointComputeConvexHull (IEnumerable< Point > points)
 Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system). More...
 
static IListSource< PointComputeConvexHull (List< Point > points, bool sortInPlace)
 
static Vector Add (this Vector a, Vector b)
 
static Point Add (this Point a, Vector b)
 
static Point Add (this Vector a, Point b)
 
static Vector Sub (this Vector a, Vector b)
 
static Vector Sub (this Point a, Point b)
 
static Point Sub (this Point a, Vector b)
 
static Vector Mul (this Vector p, T factor)
 
static Point Mul (this Point p, T factor)
 
static Vector Div (this Vector p, T factor)
 
static Point Div (this Point p, T factor)
 
static Vector Shl (this Vector p, int amt)
 
static Vector Shr (this Vector p, int amt)
 
static Point Shl (this Point p, int amt)
 
static Point Shr (this Point p, int amt)
 
static Vector3 Add (this Vector3 a, Vector3 b)
 
static Point3 Add (this Point3 a, Vector3 b)
 
static Point3 Add (this Vector3 a, Point3 b)
 
static Vector3 Sub (this Vector3 a, Vector3 b)
 
static Vector3 Sub (this Point3 a, Point3 b)
 
static Vector3 Mul (this Vector3 p, T factor)
 
static Point3 Mul (this Point3 p, T factor)
 
static Vector3 Div (this Vector3 p, T factor)
 
static Point3 Div (this Point3 p, T factor)
 
static Vector3 Shl (this Vector3 p, int amt)
 
static Vector3 Shr (this Vector3 p, int amt)
 
static Point3 Shl (this Point3 p, int amt)
 
static Point3 Shr (this Point3 p, int amt)
 
static T Dot (this Vector a, Vector b)
 Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors. More...
 
static T Dot (this Vector3 a, Vector3 b)
 
static T Cross (this Vector a, Vector b)
 Computes the "cross product" of a pair of 2D vectors. More...
 
static Vector3 Cross (this Vector3 a, Vector3 b)
 Computes the cross product of a pair of 3D vectors. More...
 
static Vector Rot90 (this Vector a)
 Rotates a vector 90 degrees. More...
 
static Vector Neg (this Vector a)
 Reverses a vector. More...
 
static Vector3 Neg (this Vector3 a)
 Reverses a vector. More...
 
static T Quadrance (this Vector v)
 Gets the square of the length of the vector. More...
 
static T Quadrance (this Vector3 v)
 
static T Length (this Vector v)
 Gets the length of the vector. More...
 
static T Length (this Vector3 v)
 
static double Angle (this Vector v)
 Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2. More...
 
static double AngleDeg (this Vector v)
 Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90. More...
 
static Vector Normalized (this Vector v)
 
static Vector3 Normalized (this Vector3 v)
 
static Vector MulDiv (this Vector v, T mul, T div)
 
static Vector3 MulDiv (this Vector3 v, T mul, T div)
 
static Vector Vector (this LineSegment seg)
 Returns seg.B - seg.A. More...
 
static Vector Abs (this Vector v)
 Gets the absolute value of the vector's individual components. More...
 
static Vector3 Abs (this Vector3 v)
 Gets the absolute value of the vector's individual components. More...
 
static Vector< T > PolarToVector (T magnitude, double radians)
 
static Point< T > PolarToPoint (T magnitude, double radians)
 
static IListSource< PointComputeConvexHull (IEnumerable< Point > points)
 Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system). More...
 
static IListSource< PointComputeConvexHull (List< Point > points, bool sortInPlace)
 

Member Function Documentation

static Vector Loyc.Geometry.PointMath.Abs ( this Vector  v)
inlinestatic

Gets the absolute value of the vector's individual components.

static Vector3 Loyc.Geometry.PointMath.Abs ( this Vector3  v)
inlinestatic

Gets the absolute value of the vector's individual components.

static Vector Loyc.Geometry.PointMath.Abs ( this Vector  v)
inlinestatic

Gets the absolute value of the vector's individual components.

static Vector3 Loyc.Geometry.PointMath.Abs ( this Vector3  v)
inlinestatic

Gets the absolute value of the vector's individual components.

static Vector Loyc.Geometry.PointMath.Abs ( this Vector  v)
inlinestatic

Gets the absolute value of the vector's individual components.

static Vector3 Loyc.Geometry.PointMath.Abs ( this Vector3  v)
inlinestatic

Gets the absolute value of the vector's individual components.

static Vector<T> Loyc.Geometry.PointMath.Abs< T > ( this Vector< T >  v)
inlinestatic

Gets the absolute value of vector's individual components.

Type Constraints
T :IComparable<T> 
T :IConvertible 
T :IEquatable<T> 
static Vector3<T> Loyc.Geometry.PointMath.Abs< T > ( this Vector3< T >  v)
inlinestatic

Gets the absolute value of vector's individual components.

Type Constraints
T :IComparable<T> 
T :IConvertible 
T :IEquatable<T> 
static double Loyc.Geometry.PointMath.Angle ( this Vector  v)
inlinestatic

Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2.

static double Loyc.Geometry.PointMath.Angle ( this Vector  v)
inlinestatic

Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2.

static double Loyc.Geometry.PointMath.Angle ( this Vector  v)
inlinestatic

Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2.

static double Loyc.Geometry.PointMath.Angle< T > ( this Vector< T >  self)
inlinestatic

Gets the angle from 0 to 2*PI of the vector, where (1,0) has angle 0 and (0,1) has angle PI/2.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static double Loyc.Geometry.PointMath.AngleDeg ( this Vector  v)
inlinestatic

Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90.

References Loyc.Math.MathEx.MulDiv().

static double Loyc.Geometry.PointMath.AngleDeg ( this Vector  v)
inlinestatic

Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90.

static double Loyc.Geometry.PointMath.AngleDeg ( this Vector  v)
inlinestatic

Gets the angle from 0 to 360 of the vector, where (1,0) has angle 0 and (0,1) has angle 90.

static System.Drawing.Point Loyc.Geometry.PointMath.AsBCL ( this Point< int >  p)
inlinestatic

Converts a Loyc point to BCL type.

static System.Drawing.Point Loyc.Geometry.PointMath.AsBCL ( this Vector< int >  p)
inlinestatic

Converts a Loyc vector to BCL type.

static System.Drawing.PointF Loyc.Geometry.PointMath.AsBCL ( this Point< float >  p)
inlinestatic

Converts a Loyc point to BCL type.

static System.Drawing.PointF Loyc.Geometry.PointMath.AsBCL ( this Vector< float >  p)
inlinestatic

Converts a Loyc vector to BCL type.

static System.Windows.Point Loyc.Geometry.PointMath.AsBCL ( this Point< double >  p)
inlinestatic

Converts a Loyc point to BCL type.

static System.Windows.Vector Loyc.Geometry.PointMath.AsBCL ( this Vector< double >  p)
inlinestatic

Converts a Loyc vector to BCL type.

static Point<int> Loyc.Geometry.PointMath.AsLoyc ( this System.Drawing.Point  p)
inlinestatic

Converts a BCL point to a Loyc point.

static Point<float> Loyc.Geometry.PointMath.AsLoyc ( this System.Drawing.PointF  p)
inlinestatic

Converts a BCL point to a Loyc point.

static Point<double> Loyc.Geometry.PointMath.AsLoyc ( this System.Windows.Point  p)
inlinestatic

Converts a BCL point to a Loyc point.

static Vector<double> Loyc.Geometry.PointMath.AsLoyc ( this System.Windows.Vector  p)
inlinestatic

Converts a BCL Vector to a Loyc point.

static Vector<int> Loyc.Geometry.PointMath.AsLoycVector ( this System.Drawing.Point  p)
inlinestatic

Converts a BCL point to a Loyc vector.

static Vector<float> Loyc.Geometry.PointMath.AsLoycVector ( this System.Drawing.PointF  p)
inlinestatic

Converts a BCL point to a Loyc vector.

static Vector<double> Loyc.Geometry.PointMath.AsLoycVector ( this System.Windows.Point  p)
inlinestatic

Converts a BCL point to a Loyc vector.

static IListSource<Point> Loyc.Geometry.PointMath.ComputeConvexHull ( IEnumerable< Point points)
inlinestatic

Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system).

Uses the Monotone Chain algorithm, a.k.a. Andrew's Algorithm.

References Loyc.Collections.Add.

static IListSource<Point> Loyc.Geometry.PointMath.ComputeConvexHull ( IEnumerable< Point points)
inlinestatic

Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system).

Uses the Monotone Chain algorithm, a.k.a. Andrew's Algorithm.

References Loyc.Collections.Add.

static IListSource<Point> Loyc.Geometry.PointMath.ComputeConvexHull ( IEnumerable< Point points)
inlinestatic

Computes the convex hull of a polygon, in clockwise order in a Y-up coordinate system (counterclockwise in a Y-down coordinate system).

Uses the Monotone Chain algorithm, a.k.a. Andrew's Algorithm.

static T Loyc.Geometry.PointMath.Cross ( this Vector  a,
Vector  b 
)
inlinestatic

Computes the "cross product" of a pair of 2D vectors.

This is not a general cross product, as cross product is only a 3D concept, but this operator acts as though the two points were in the Z=0 plane and returns the Z coordinate of the cross product: b.X * a.Y - b.Y * a.X. This value is zero if the vectors are parallel; it is a.Length * b.Length or -a.Length * b.Length if the vectors are perpendicular. One use of cross product is to determine whether the angle between two lines is greater or less than 180 degrees, corresponding to return values less or greater than zero.

static Vector3 Loyc.Geometry.PointMath.Cross ( this Vector3  a,
Vector3  b 
)
inlinestatic

Computes the cross product of a pair of 3D vectors.

static T Loyc.Geometry.PointMath.Cross ( this Vector  a,
Vector  b 
)
inlinestatic

Computes the "cross product" of a pair of 2D vectors.

This is not a general cross product, as cross product is only a 3D concept, but this operator acts as though the two points were in the Z=0 plane and returns the Z coordinate of the cross product: b.X * a.Y - b.Y * a.X. This value is zero if the vectors are parallel; it is a.Length * b.Length or -a.Length * b.Length if the vectors are perpendicular. One use of cross product is to determine whether the angle between two lines is greater or less than 180 degrees, corresponding to return values less or greater than zero.

static Vector3 Loyc.Geometry.PointMath.Cross ( this Vector3  a,
Vector3  b 
)
inlinestatic

Computes the cross product of a pair of 3D vectors.

static T Loyc.Geometry.PointMath.Cross ( this Vector  a,
Vector  b 
)
inlinestatic

Computes the "cross product" of a pair of 2D vectors.

This is not a general cross product, as cross product is only a 3D concept, but this operator acts as though the two points were in the Z=0 plane and returns the Z coordinate of the cross product: b.X * a.Y - b.Y * a.X. This value is zero if the vectors are parallel; it is a.Length * b.Length or -a.Length * b.Length if the vectors are perpendicular. One use of cross product is to determine whether the angle between two lines is greater or less than 180 degrees, corresponding to return values less or greater than zero.

static Vector3 Loyc.Geometry.PointMath.Cross ( this Vector3  a,
Vector3  b 
)
inlinestatic

Computes the cross product of a pair of 3D vectors.

static T Loyc.Geometry.PointMath.Cross< T > ( this Vector< T >  a,
Vector< T >  b 
)
inlinestatic

Computes the "cross product" of a pair of vectors.

This is not a general cross product, as cross product is only a 3D concept, but this operator acts as though the two points were in the Z=0 plane and returns the Z coordinate of the cross product: b.X * a.Y - b.Y * a.X. This value is zero if the vectors are parallel; it is a.Length * b.Length or -a.Length * b.Length if the vectors are perpendicular. One use of cross product is to determine whether the angle between two lines is greater or less than 180 degrees, corresponding to return values less or greater than zero.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static T Loyc.Geometry.PointMath.Dot ( this Vector  a,
Vector  b 
)
inlinestatic

Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors.

static T Loyc.Geometry.PointMath.Dot ( this Vector  a,
Vector  b 
)
inlinestatic

Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors.

static T Loyc.Geometry.PointMath.Dot ( this Vector  a,
Vector  b 
)
inlinestatic

Dot product. a*b equals lhs.Length*rhs.Length*Cos(theta) if theta is the angle between two vectors.

static Point<T> Loyc.Geometry.PointMath.HalfwayTo< T > ( this Point< T >  a,
Point< T >  b 
)
inlinestatic

Returns the midpoint between A and B ((a + b) / 2)

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static T Loyc.Geometry.PointMath.Length ( this Vector  v)
inlinestatic

Gets the length of the vector.

References Loyc.Math.MathEx.Sqrt().

static T Loyc.Geometry.PointMath.Length ( this Vector  v)
inlinestatic

Gets the length of the vector.

static T Loyc.Geometry.PointMath.Length ( this Vector  v)
inlinestatic

Gets the length of the vector.

static T Loyc.Geometry.PointMath.Length< T > ( this Vector< T >  self)
inlinestatic

Gets the length of the vector.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static Vector Loyc.Geometry.PointMath.Neg ( this Vector  a)
inlinestatic

Reverses a vector.

static Vector3 Loyc.Geometry.PointMath.Neg ( this Vector3  a)
inlinestatic

Reverses a vector.

static Vector Loyc.Geometry.PointMath.Neg ( this Vector  a)
inlinestatic

Reverses a vector.

static Vector3 Loyc.Geometry.PointMath.Neg ( this Vector3  a)
inlinestatic

Reverses a vector.

static Vector Loyc.Geometry.PointMath.Neg ( this Vector  a)
inlinestatic

Reverses a vector.

static Vector3 Loyc.Geometry.PointMath.Neg ( this Vector3  a)
inlinestatic

Reverses a vector.

static T Loyc.Geometry.PointMath.Quadrance ( this Vector  v)
inlinestatic

Gets the square of the length of the vector.

static T Loyc.Geometry.PointMath.Quadrance ( this Vector  v)
inlinestatic

Gets the square of the length of the vector.

static T Loyc.Geometry.PointMath.Quadrance ( this Vector  v)
inlinestatic

Gets the square of the length of the vector.

static T Loyc.Geometry.PointMath.Quadrance< T > ( this Vector< T >  self)
inlinestatic

Gets the square of the length of the vector.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static Vector Loyc.Geometry.PointMath.Rot90 ( this Vector  a)
inlinestatic

Rotates a vector 90 degrees.

Rotatation is clockwise if increasing Y goes downward, counter- clockwise if increasing Y goes upward. If the vector represents the direction of a line, the result also represents the coefficients (a,b) of the implicit line equation aX + bY + c = 0.

static Vector Loyc.Geometry.PointMath.Rot90 ( this Vector  a)
inlinestatic

Rotates a vector 90 degrees.

Rotatation is clockwise if increasing Y goes downward, counter- clockwise if increasing Y goes upward. If the vector represents the direction of a line, the result also represents the coefficients (a,b) of the implicit line equation aX + bY + c = 0.

static Vector Loyc.Geometry.PointMath.Rot90 ( this Vector  a)
inlinestatic

Rotates a vector 90 degrees.

Rotatation is clockwise if increasing Y goes downward, counter- clockwise if increasing Y goes upward. If the vector represents the direction of a line, the result also represents the coefficients (a,b) of the implicit line equation aX + bY + c = 0.

static Vector<T> Loyc.Geometry.PointMath.Rot90< T > ( this Vector< T >  self)
inlinestatic

Rotates a vector 90 degrees.

Rotatation is clockwise if increasing Y goes downward, counter- clockwise if increasing Y goes upward. If the vector represents the direction of a line, the result also represents the coefficients (a,b) of the implicit line equation aX + bY + c = 0.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static LineSegment<T> Loyc.Geometry.PointMath.To< T > ( this Point< T >  a,
Point< T >  b 
)
inlinestatic

Constructs a LineSegment<T> from two points.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static Vector Loyc.Geometry.PointMath.Vector ( this LineSegment  seg)
inlinestatic

Returns seg.B - seg.A.

static Vector Loyc.Geometry.PointMath.Vector ( this LineSegment  seg)
inlinestatic

Returns seg.B - seg.A.

static Vector Loyc.Geometry.PointMath.Vector ( this LineSegment  seg)
inlinestatic

Returns seg.B - seg.A.

static Vector<T> Loyc.Geometry.PointMath.Vector< T > ( this LineSegment< T >  seg)
inlinestatic

Returns the vector from A to B (seg.B - seg.A)

Type Constraints
T :IConvertible 
T :IEquatable<T>