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

Extension methods for vectors. TODO: reconsider distribution of methods between this class and PointMath in Loyc.Utilities. More...


Source file:

Remarks

Extension methods for vectors. TODO: reconsider distribution of methods between this class and PointMath in Loyc.Utilities.

Static Public Member Functions

static Vector3< T > Cross< T > (this Vector3< T > a, Vector3< T > b)
 Computes the "cross product" of a pair of vectors. More...
 
static T Quadrance< T > (this Vector3< T > self)
 Gets the square of the length of the vector. More...
 
static T Length< T > (this Vector3< T > self)
 Gets the length of the vector. More...
 
static bool Normalize< T > (this Vector3< T > self)
 
static Vector3< T > Normalized< T > (this Vector3< T > self)
 
static Vector3< T > MulDiv< T > (this Vector3< T > self, T mul, T div)
 

Member Function Documentation

static Vector3<T> Loyc.Geometry.VectorExt.Cross< T > ( this Vector3< T >  a,
Vector3< 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.VectorExt.Length< T > ( this Vector3< T >  self)
inlinestatic

Gets the length of the vector.

Type Constraints
T :IConvertible 
T :IEquatable<T> 
static T Loyc.Geometry.VectorExt.Quadrance< T > ( this Vector3< T >  self)
inlinestatic

Gets the square of the length of the vector.

Type Constraints
T :IConvertible 
T :IEquatable<T>