|
Code Packages
1
Add-on code processing modules
|
Vector immutable structure provides a 3-dimensional vector in Cartesian coordinates More...
Public Member Functions | |
| Vector (double x, double y, double z) | |
| Initialize a new instance of the Vector type using the specified coordianates. More... | |
| int | CompareTo (Vector v) |
| Compares current Vector with another vector More... | |
| override bool | Equals (object obj) |
| override int | GetHashCode () |
| override string | ToString () |
| Converts Vector to its string representation More... | |
Static Public Member Functions | |
| static double | Abs (Vector v) |
| Absolute value of a vector More... | |
| static double | Abs (params double[] args) |
| Absolute value of a vector (arbitrary length) More... | |
| static double | Angle (Vector v1, Vector v2) |
| Calculate the angle between two vectors More... | |
| static Vector | CrossProduct (Vector v1, Vector v2) |
| Cross product of two vectors More... | |
| static double | Distance (Vector v1, Vector v2) |
| Calculates the Euclidean distance between two vectors More... | |
| static double | DotProduct (Vector v1, Vector v2) |
| Dot product of two vectors More... | |
| static bool | IsInfinity (Vector v) |
| Checks if a vector contains a component that is infinity. More... | |
| static bool | IsNaN (Vector v) |
| Checks if a vector contains a component that is not a number. More... | |
| static bool | IsPerpendicular (Vector v1, Vector v2) |
| Checks if a vector is perpendicular to another vector. More... | |
| static bool | IsUnitVector (Vector v) |
| Checks if a vector is a Unit vector More... | |
| static bool | IsZeroVector (Vector v) |
| Checks if a vector is a Zero vector More... | |
| static Vector | Normalize (Vector v) |
| Vector normalization More... | |
| static implicit | operator double[] (Vector v) |
| Converts (implicitly) a vector into an array More... | |
| static implicit | operator Matrix< double > (Vector v) |
| Converts (implicitly) a vector into a single dimension matrix More... | |
| static implicit | operator Vector (double[] array) |
| Converts (implicitly) an array into a vector More... | |
| static implicit | operator Vector (Matrix< double > m) |
| Converts (implicitly) a matrix into a vector More... | |
| static bool | operator!= (Vector v1, Vector v2) |
| Vector comaprison - Unequal More... | |
| static Vector | operator* (Vector v1, Vector v2) |
| Peforms vector multiplication (cross product) More... | |
| static Vector | operator* (Vector v, double value) |
| Performs scalar multiplication More... | |
| static Vector | operator+ (Vector v1, Vector v2) |
| Performs vector addition More... | |
| static Vector | operator+ (Vector v, double value) |
| Performs scalar addition More... | |
| static Vector | operator- (Vector v1, Vector v2) |
| Performs vector subtraction More... | |
| static Vector | operator- (Vector v, double value) |
| Performs scalar subtraction More... | |
| static Vector | operator- (Vector v) |
| Negates (opposite) a vector More... | |
| static Vector | operator/ (Vector v, double value) |
| Performs scalar division More... | |
| static bool | operator< (Vector v1, Vector v2) |
| Vector comaprison - Less than More... | |
| static bool | operator<= (Vector v1, Vector v2) |
| Vector comaprison - Less than or equal More... | |
| static bool | operator== (Vector v1, Vector v2) |
| Vector comaprison - Equal More... | |
| static bool | operator> (Vector v1, Vector v2) |
| Vector comaprison - Greater than More... | |
| static bool | operator>= (Vector v1, Vector v2) |
| Vector comaprison - Greater than or equal More... | |
| static Vector | Pitch (Vector v, double angle) |
| Rotation around the Y axis (Pitch) More... | |
| static Vector | Projection (Vector v1, Vector v2) |
| Performs vector projection More... | |
| static Vector | Reflection (Vector v1, Vector v2) |
| Performs vector reflection More... | |
| static Vector | Rejection (Vector v1, Vector v2) |
| Performs vector rejection More... | |
| static Vector | Roll (Vector v, double angle) |
| Rotation around the X axis (Roll) More... | |
| static Vector | RotateX (Vector v, double angle) |
| Rotation around the X axis More... | |
| static Vector | RotateY (Vector v, double angle) |
| Rotation around the Y axis More... | |
| static Vector | RotateZ (Vector v, double angle) |
| Rotation around the Z axis More... | |
| static Vector | Round (Vector v, int decimals) |
| Rounds a vector to the specified number of fractional digits More... | |
| static Vector | Scale (Vector v, double value) |
| Scale the magnitude of a vector to a specified value More... | |
| static Vector | Yaw (Vector v, double angle) |
| Rotation around the Z axis (Yaw) More... | |
Static Public Attributes | |
| static readonly Vector | Epsilon = new Vector(Double.Epsilon, Double.Epsilon, Double.Epsilon) |
| Returns a vector representing the smallest positive value that is greater than zero More... | |
| static readonly Vector | MaxValue = new Vector(Double.MaxValue, Double.MaxValue, Double.MaxValue) |
| Returns a vector representing the largest possible value More... | |
| static readonly Vector | MinValue = new Vector(Double.MinValue, Double.MinValue, Double.MinValue) |
| Returns a vector representing the smallest possible value More... | |
| static readonly Vector | Origin = Zero |
| Returns the origin of axes More... | |
| static readonly Vector | XAxis = new Vector(1, 0, 0) |
| Returns a vector representing X axis More... | |
| static readonly Vector | YAxis = new Vector(0, 1, 0) |
| Returns a vector representing Y axis More... | |
| static readonly Vector | ZAxis = new Vector(0, 0, 1) |
| Returns a vector representing Z axis More... | |
| static readonly Vector | Zero = new Vector(0, 0, 0) |
| Returns a zero vector More... | |
Properties | |
| double | X [get] |
| Gets the X coordinate of the vector More... | |
| double | Y [get] |
| Gets the Y coordinate of the vector More... | |
| double | Z [get] |
| Gets the Z coordinate of the vector More... | |
Vector immutable structure provides a 3-dimensional vector in Cartesian coordinates
If a generic vector is needed, use single dimensional Matrix (ex. column vector)
| dsp.Vector.Vector | ( | double | x, |
| double | y, | ||
| double | z | ||
| ) |
|
static |
|
static |
Absolute value of a vector (arbitrary length)
| args | real values |

Example
Calculate the angle between two vectors
The calculated angle is in radians. To convert radians into degrees, use MathE.RadToDeg function.
| v1 | first input vector |
| v2 | second input vector |

Example
| int dsp.Vector.CompareTo | ( | Vector | v | ) |
Compares current Vector with another vector
CompareTo function returns:
-1 if the current vector's magnitude is less than the other one.
0 if the current vector's magnitude equals the magnitude of the other one.
1 if the current vector's magnitude is greater than the magnitude of the othe one.
Example
Cross product of two vectors
AxB is always perpendicular to both A and B, with the orientation determined by the right-hand rule.
Same as Vector.operator*()
| v1 | first input vector |
| v2 | second imput vector |

Example
Dot product of two vectors
A·B=0 if A is perpendicular to B
See also Vector.Angle
| v1 | first input vector |
| v2 | second input vector |

Example
| override bool dsp.Vector.Equals | ( | object | obj | ) |
| override int dsp.Vector.GetHashCode | ( | ) |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Converts (implicitly) an array into a vector
Array length must contain exactly 3 values representing x,y,z
| array | real array containing z,y,z values |
Example
Converts (implicitly) a matrix into a vector
Input matrix must be a single column matrix with three elements, representing a column vector of x,y,z values
| m | column vector containing z,y,z values |
Example
Peforms vector multiplication (cross product)
Same as Vector.CrossProduct
| v1 | first input vector |
| v2 | second input vector |
Example
Vector comaprison - Less than or equal
| v1 | first input vector |
| v2 | second input vector |

Vector comaprison - Greater than
| v1 | first input vector |
| v2 | second input vector |
A > BVector comaprison - Greater than or equal
| v1 | first input vector |
| v2 | second input vector |

Rotation around the Y axis (Pitch)
Convention used in avionics. This function calls Vector.RotateY
| v | input vector |
| angle | angle in radians |
Performs vector projection
The vector projection of a vector A on a nonzero vector B is the orthogonal projection of A onto a straight line parallel to B.
| v1 | first input vector |
| v2 | second input vector |

Example
Rotation around the X axis (Roll)
Convention used in avionics. This function calls Vector.RotateX
| v | input vector |
| angle | angle in radians |
Rotation around the X axis
Rotation (counterclockwise) around the X axis by angle (γ) in radians.
The function MathE.DegToRad can be used to convert degrees into radians
| v | input vector |
| angle | angle in radians |

Example
Rotation around the Y axis
Rotation (counterclockwise) around the Y axis by angle (β) in radians.
The function MathE.DegToRad can be used to convert degrees into radians
| v | input vector |
| angle | angle in radians |

Example
Rotation around the Z axis
Rotation (counterclockwise) around the Z axis by angle (α) in radians.
The function MathE.DegToRad can be used to convert degrees into radians
| v | input vector |
| angle | angle in radians |

Example
Rounds a vector to the specified number of fractional digits
Rounding applies on all vector components using an away from zero mode.
| v | input vector |
| decimals | number of fractional digits |
Example
| override string dsp.Vector.ToString | ( | ) |
Rotation around the Z axis (Yaw)
Convention used in avionics. This function calls Vector.RotateZ
| v | input vector |
| angle | angle in radians |
|
static |
Returns a vector representing the smallest positive value that is greater than zero
|
static |
Returns a vector representing the largest possible value
|
static |
Returns a vector representing the smallest possible value
Returns the origin of axes
Same as Vector.Zero
Returns a vector representing X axis
Axis X vector has the first component equal to one, and all the rest equal to zero
Returns a vector representing Y axis
Axis Y vector has the second (middle) component equal to one, and all the rest equal to zero
Returns a vector representing Z axis
Axis Z vector has the third (last) component equal to one, and all the rest equal to zero
Returns a zero vector
A zero vector has all components equal to zero.
|
get |
|
get |