Code Packages  1
Add-on code processing modules
Public Member Functions | Static Public Member Functions | Static Public Attributes | Properties | List of all members
dsp.Vector Struct Reference

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...
 

Detailed Description

Vector immutable structure provides a 3-dimensional vector in Cartesian coordinates

If a generic vector is needed, use single dimensional Matrix (ex. column vector)

Constructor & Destructor Documentation

◆ Vector()

dsp.Vector.Vector ( double  x,
double  y,
double  z 
)

Initialize a new instance of the Vector type using the specified coordianates.

If no parameters given, returns a zero vector


Parameters
xx-axis coordinate
yy-axis coordinate
zz-axis coordinate
Returns
$v=(x,y,z)$


Example

Vector v = new Vector(1,2,3);
Console.WriteLine(v);
1 2 3

Member Function Documentation

◆ Abs() [1/2]

static double dsp.Vector.Abs ( Vector  v)
static

Absolute value of a vector

Parameters
vvector
Returns
$\displaystyle |V|=\sqrt{{v_x}^2+{v_y}^2+{v_z}^2}$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(Vector.Abs(v));
3.74165738677394

◆ Abs() [2/2]

static double dsp.Vector.Abs ( params double []  args)
static

Absolute value of a vector (arbitrary length)

Parameters
argsreal values
Returns
$\displaystyle |V|=\sqrt{\sum\limits_{i=1}^{N}{v_i}^2}$

Example

double res = Vector.Abs(1,2,3);
Console.WriteLine(res);
3.74165738677394

◆ Angle()

static double dsp.Vector.Angle ( Vector  v1,
Vector  v2 
)
static

Calculate the angle between two vectors

The calculated angle is in radians. To convert radians into degrees, use MathE.RadToDeg function.

Parameters
v1first input vector
v2second input vector
Returns
$\displaystyle A \bullet B = |A| |B| \cos(\theta) \\\\ \cos(\theta) = \frac{A}{|A|} \bullet \frac{B}{|B|} \\\\ \theta = \cos^{-1} (\hat{A} \bullet \hat{B})$

Example

Vector v1 = new Vector(3,4,0);
Vector v2 = new Vector(4,4,2);
Console.WriteLine(Vector.Angle(v1,v2));
0.367208020557837

◆ CompareTo()

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

Vector v1 = new Vector(1,2,3);
Vector v2 = new Vector(3,2,1);
Console.WriteLine(v1.CompareTo(v2));
0

◆ CrossProduct()

static Vector dsp.Vector.CrossProduct ( Vector  v1,
Vector  v2 
)
static

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*()

Parameters
v1first input vector
v2second imput vector
Returns
$ C = A \times B $

$ c_x = a_y b_z-a_z b_y \\ c_y = a_z b_x-a_x b_z \\ c_z = a_x b_y-a_y b_x $

Example

Vector v1 = new Vector(1,0,0);
Vector v2 = new Vector(0,0,1);
Console.WriteLine(Vector.CrossProduct(v1,v2));
0 -1 0

◆ Distance()

static double dsp.Vector.Distance ( Vector  v1,
Vector  v2 
)
static

Calculates the Euclidean distance between two vectors

Parameters
v1first input vector
v2second input vector
Returns
$\displaystyle d(A,B)=\sqrt{(a_x - b_x)^2 + (a_y - b_y)^2 + (a_z - b_z)^2}$

Example

Vector v1 = new Vector(1,1,1);
Vector v2 = new Vector(0,0,0);
Console.WriteLine(Vector.Distance(v1, v2));
1.73205080756888

◆ DotProduct()

static double dsp.Vector.DotProduct ( Vector  v1,
Vector  v2 
)
static

Dot product of two vectors

A·B=0 if A is perpendicular to B
See also Vector.Angle


Parameters
v1first input vector
v2second input vector
Returns
$ A \bullet B = |A| |B| \cos(\theta) $

$ \displaystyle A \bullet B = a_x b_x + a_y b_y + a_z b_z $

Example

Vector v = new Vector(1,0,0);
Console.WriteLine(Vector.DotProduct(v,v));
1

◆ Equals()

override bool dsp.Vector.Equals ( object  obj)

◆ GetHashCode()

override int dsp.Vector.GetHashCode ( )

◆ IsInfinity()

static bool dsp.Vector.IsInfinity ( Vector  v)
static

Checks if a vector contains a component that is infinity.

This function checks for both positive or negative infinity

Parameters
vinput vector

Example

Vector v = new Vector(0,0,Double.PositiveInfinity);
Console.WriteLine(Vector.IsInfinity(v));
True

◆ IsNaN()

static bool dsp.Vector.IsNaN ( Vector  v)
static

Checks if a vector contains a component that is not a number.

Parameters
vinput vector

Example

Vector v = new Vector(0,Double.NaN,0);
Console.WriteLine(Vector.IsNaN(v));
True

◆ IsPerpendicular()

static bool dsp.Vector.IsPerpendicular ( Vector  v1,
Vector  v2 
)
static

Checks if a vector is perpendicular to another vector.

Returns
$\displaystyle true \iff A \bullet B = 0$
Parameters
v1first input vector
v2second input vector

Example

Vector v1 = new Vector(1,0,0);
Vector v2 = new Vector(0,1,0);
Console.WriteLine(Vector.IsPerpendicular(v1,v2));
True

◆ IsUnitVector()

static bool dsp.Vector.IsUnitVector ( Vector  v)
static

Checks if a vector is a Unit vector

A unit vector is a vector of length equal to 1.

Returns
$\displaystyle true \iff |V|=1$
Parameters
vinput vector


Example

Vector v = new Vector(1,2,3);
v = Vector.Normalize(v);
Console.WriteLine(v);
Console.WriteLine(Vector.IsUnitVector(v));
0.267261241912424 0.534522483824849 0.8017837257372731
True

◆ IsZeroVector()

static bool dsp.Vector.IsZeroVector ( Vector  v)
static

Checks if a vector is a Zero vector

A zero vector is a vector of length equal to 0, thus has all components equal to zero.

Returns
$\displaystyle true \iff |V|=0$
Parameters
vinput vector


Example

Vector v = new Vector(0,0,0);
Console.WriteLine(Vector.IsZeroVector(v));
True

◆ Normalize()

static Vector dsp.Vector.Normalize ( Vector  v)
static

Vector normalization

This function converts a specified vector into a unit vector.

Parameters
vinput vector


Returns
$\displaystyle \hat{v} = \frac{v}{|v|}$

Example

Vector v = new Vector(1,2,3);
v = Vector.Normalize(v);
Console.WriteLine(v);
Console.WriteLine(Vector.Abs(v));
0.267261241912424 0.534522483824849 0.8017837257372731
1

◆ operator double[]()

static implicit dsp.Vector.operator double[] ( Vector  v)
static

Converts (implicitly) a vector into an array

Parameters
vvector

Example

Vector v = new Vector(1,2,3);
double[] d = v;
Console.WriteLine(NArray.ToString(d));
1 2 3

◆ operator Matrix< double >()

static implicit dsp.Vector.operator Matrix< double > ( Vector  v)
static

Converts (implicitly) a vector into a single dimension matrix

The returned matrix actually is a column vector

Parameters
vvector

Example

Vector v = new Vector(1,2,3);
Matrix<double> m = v;
Console.WriteLine(m);
1
2
3

◆ operator Vector() [1/2]

static implicit dsp.Vector.operator Vector ( double []  array)
static

Converts (implicitly) an array into a vector

Array length must contain exactly 3 values representing x,y,z

Parameters
arrayreal array containing z,y,z values

Example

double[] d = new double[3]{1,2,3};
Vector v = d;
Console.WriteLine(v);
1 2 3

◆ operator Vector() [2/2]

static implicit dsp.Vector.operator Vector ( Matrix< double >  m)
static

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

Parameters
mcolumn vector containing z,y,z values

Example

Matrix<double> m = new Matrix<double>(3,1){1,2,3};
Vector v = m;
Console.WriteLine(v);
1 2 3

◆ operator!=()

static bool dsp.Vector.operator!= ( Vector  v1,
Vector  v2 
)
static

Vector comaprison - Unequal

Parameters
v1first input vector
v2second input vector
Returns
$ true \iff A \ne B $

◆ operator*() [1/2]

static Vector dsp.Vector.operator* ( Vector  v1,
Vector  v2 
)
static

Peforms vector multiplication (cross product)

Same as Vector.CrossProduct

Parameters
v1first input vector
v2second input vector


Example

Vector v1 = new Vector(1,0,0);
Vector v2 = new Vector(0,0,1);
Console.WriteLine(v1*v2);
0 -1 0

◆ operator*() [2/2]

static Vector dsp.Vector.operator* ( Vector  v,
double  value 
)
static

Performs scalar multiplication

Parameters
vvector
valuescalar value
Returns
$ A \times c = (a_x c, a_y c, a_z c)$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(r*2);
2 4 6

◆ operator+() [1/2]

static Vector dsp.Vector.operator+ ( Vector  v1,
Vector  v2 
)
static

Performs vector addition

Parameters
v1first input vector
v2second input vector
Returns
$ A+B = (a_x + b_x, a_y + b_y, a_z + b_z)$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(r+r);
2 4 6

◆ operator+() [2/2]

static Vector dsp.Vector.operator+ ( Vector  v,
double  value 
)
static

Performs scalar addition

Parameters
vvector
valuescalar value
Returns
$ A+c = (a_x + c, a_y + c, a_z + c)$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(r+1);
2 3 4

◆ operator-() [1/3]

static Vector dsp.Vector.operator- ( Vector  v1,
Vector  v2 
)
static

Performs vector subtraction

Parameters
v1first input vector
v2second input vector
Returns
$ A-B = (a_x - b_x, a_y - b_y, a_z - b_z)$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(r-r);
0 0 0

◆ operator-() [2/3]

static Vector dsp.Vector.operator- ( Vector  v,
double  value 
)
static

Performs scalar subtraction

Parameters
vvector
valuescalar value
Returns
$ A-c = (a_x - c, a_y - c, a_z - c)$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(r-1);
0 1 2

◆ operator-() [3/3]

static Vector dsp.Vector.operator- ( Vector  v)
static

Negates (opposite) a vector

Parameters
vinput vector
Returns
$ -A = (-a_x, -a_y, -a_z)$

Example

Vector v = new Vector(-1,2,3);
Console.WriteLine(-r);
1 -2 -3

◆ operator/()

static Vector dsp.Vector.operator/ ( Vector  v,
double  value 
)
static

Performs scalar division

Parameters
vvector
valuescalar value (divisor)
Returns
$ \displaystyle A \div c = \left(\frac{a_x}{c},\frac{a_y}{c},\frac{a_z}{c}\right)$

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(r/2);
0.5 1 1.5

◆ operator<()

static bool dsp.Vector.operator< ( Vector  v1,
Vector  v2 
)
static

Vector comaprison - Less than

Parameters
v1first input vector
v2second input vector
Returns
$ true \iff $ A < B

◆ operator<=()

static bool dsp.Vector.operator<= ( Vector  v1,
Vector  v2 
)
static

Vector comaprison - Less than or equal

Parameters
v1first input vector
v2second input vector
Returns
$ true \iff A \leq B $

◆ operator==()

static bool dsp.Vector.operator== ( Vector  v1,
Vector  v2 
)
static

Vector comaprison - Equal

Parameters
v1first input vector
v2second input vector
Returns
$ true \iff A = B $

◆ operator>()

static bool dsp.Vector.operator> ( Vector  v1,
Vector  v2 
)
static

Vector comaprison - Greater than

Parameters
v1first input vector
v2second input vector
Returns
$ true \iff $ A > B

◆ operator>=()

static bool dsp.Vector.operator>= ( Vector  v1,
Vector  v2 
)
static

Vector comaprison - Greater than or equal

Parameters
v1first input vector
v2second input vector
Returns
$ true \iff A \geq B $

◆ Pitch()

static Vector dsp.Vector.Pitch ( Vector  v,
double  angle 
)
static

Rotation around the Y axis (Pitch)

Convention used in avionics. This function calls Vector.RotateY

Parameters
vinput vector
angleangle in radians

◆ Projection()

static Vector dsp.Vector.Projection ( Vector  v1,
Vector  v2 
)
static

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.

Parameters
v1first input vector
v2second input vector
Returns
$\displaystyle {proj}_{b}(a) =\frac{a \bullet b}{{|b|}^{2}}b$

Example

Vector v1 = new Vector(1,1,1);
Vector v2 = new Vector(1,2,3);
Console.WriteLine(Vector.Projection(v1,v2));
0.428571428571429 0.857142857142857 1.28571428571429

◆ Reflection()

static Vector dsp.Vector.Reflection ( Vector  v1,
Vector  v2 
)
static

Performs vector reflection

Vector reflection provide a mirror image of the original vector about another vector.

Parameters
v1first input vector
v2second input vector
Returns
$\displaystyle {ref}_{b}(a) = 2 \ {proj}_{b}(a) - a$

Example

Vector v1 = new Vector(1,1,0);
Vector v2 = new Vector(0,1,0);
Console.WriteLine(Vector.Reflection(v1,v2));
-1 1 0

◆ Rejection()

static Vector dsp.Vector.Rejection ( Vector  v1,
Vector  v2 
)
static

Performs vector rejection

Vector rejection of A from B, is the orthogonal projection of A onto the plane orthogonal to B.

Parameters
v1first input vector
v2second input vector
Returns
$\displaystyle {rej}_{b}(a) = a - {proj}_{b}(a)$

Example

Vector v1 = new Vector(1,1,1);
Vector v2 = new Vector(1,2,3);
Console.WriteLine(Vector.Rejection(v1,v2));
0.571428571428571 0.142857142857143 -0.285714285714286

◆ Roll()

static Vector dsp.Vector.Roll ( Vector  v,
double  angle 
)
static

Rotation around the X axis (Roll)

Convention used in avionics. This function calls Vector.RotateX

Parameters
vinput vector
angleangle in radians

◆ RotateX()

static Vector dsp.Vector.RotateX ( Vector  v,
double  angle 
)
static

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

Parameters
vinput vector
angleangle in radians
Returns
$\displaystyle \begin{bmatrix}x'\\y'\\z'\end{bmatrix} = R_{x}(\gamma)\begin{bmatrix}x\\y\\z\end{bmatrix} \hspace{0.5cm} where \hspace{0.5cm} R_{x}(\gamma) = \begin{bmatrix} 1&0&0 \\ 0&\cos(\gamma)&-\sin(\gamma) \\ 0&\sin(\gamma)&\cos(\gamma) \end{bmatrix} $

Example

Vector v = new Vector(1,1,1);
v = Vector.RotateX(v, Math.PI/2);
Console.WriteLine(v);
1 -1 1

◆ RotateY()

static Vector dsp.Vector.RotateY ( Vector  v,
double  angle 
)
static

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

Parameters
vinput vector
angleangle in radians
Returns
$\displaystyle \begin{bmatrix}x'\\y'\\z'\end{bmatrix} = R_{y}(\beta)\begin{bmatrix}x\\y\\z\end{bmatrix} \hspace{0.5cm} where \hspace{0.5cm} R_{y}(\beta) = \begin{bmatrix} \cos(\beta)&0&\sin(\beta) \\ 0&1&0 \\ -\sin(\beta)&0&\cos(\beta) \end{bmatrix} $

Example

Vector v = new Vector(1,1,1);
v = Vector.RotateY(v, Math.PI/2);
Console.WriteLine(v);
1 1 -1

◆ RotateZ()

static Vector dsp.Vector.RotateZ ( Vector  v,
double  angle 
)
static

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

Parameters
vinput vector
angleangle in radians
Returns
$\displaystyle \begin{bmatrix}x'\\y'\\z'\end{bmatrix} = R_{z}(\alpha)\begin{bmatrix}x\\y\\z\end{bmatrix} \hspace{0.5cm} where \hspace{0.5cm} R_{z}(\beta) = \begin{bmatrix} \cos(\alpha)&-\sin(\alpha)&0 \\ \sin(\alpha)&\cos(\alpha)&0 \\ 0&0&1 \end{bmatrix} $

Example

Vector v = new Vector(1,1,1);
v = Vector.RotateZ(v, Math.PI/2);
Console.WriteLine(v);
-1 1 1

◆ Round()

static Vector dsp.Vector.Round ( Vector  v,
int  decimals 
)
static

Rounds a vector to the specified number of fractional digits

Rounding applies on all vector components using an away from zero mode.

Parameters
vinput vector
decimalsnumber of fractional digits


Example

Vector v = new Vector(1,2,3);
v = Vector.Normalize(v);
Console.WriteLine(v);
v = Vector.Round(v,3);
Console.WriteLine(v);
0.267261241912424 0.534522483824849 0.8017837257372731
0.267 0.535 0.802

◆ Scale()

static Vector dsp.Vector.Scale ( Vector  v,
double  value 
)
static

Scale the magnitude of a vector to a specified value

Parameters
vinput vector
valuevector magnitude
Returns
$\displaystyle v \left(\frac{value}{|v|}\right)$

Example

Vector v = new Vector(1,1,1);
v = Vector.Scale(v,2);
Console.WriteLine(v);
Console.WriteLine(Vector.Abs(v));
1.15470053837925 1.15470053837925 1.15470053837925
2

◆ ToString()

override string dsp.Vector.ToString ( )

Converts Vector to its string representation

The function Vecrtor3.Round can be used to aid clarity

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(v);
1 2 3

◆ Yaw()

static Vector dsp.Vector.Yaw ( Vector  v,
double  angle 
)
static

Rotation around the Z axis (Yaw)

Convention used in avionics. This function calls Vector.RotateZ

Parameters
vinput vector
angleangle in radians

Member Data Documentation

◆ Epsilon

readonly Vector dsp.Vector.Epsilon = new Vector(Double.Epsilon, Double.Epsilon, Double.Epsilon)
static

Returns a vector representing the smallest positive value that is greater than zero

◆ MaxValue

readonly Vector dsp.Vector.MaxValue = new Vector(Double.MaxValue, Double.MaxValue, Double.MaxValue)
static

Returns a vector representing the largest possible value

◆ MinValue

readonly Vector dsp.Vector.MinValue = new Vector(Double.MinValue, Double.MinValue, Double.MinValue)
static

Returns a vector representing the smallest possible value

◆ Origin

readonly Vector dsp.Vector.Origin = Zero
static

Returns the origin of axes

Same as Vector.Zero

◆ XAxis

readonly Vector dsp.Vector.XAxis = new Vector(1, 0, 0)
static

Returns a vector representing X axis

Axis X vector has the first component equal to one, and all the rest equal to zero

◆ YAxis

readonly Vector dsp.Vector.YAxis = new Vector(0, 1, 0)
static

Returns a vector representing Y axis

Axis Y vector has the second (middle) component equal to one, and all the rest equal to zero

◆ ZAxis

readonly Vector dsp.Vector.ZAxis = new Vector(0, 0, 1)
static

Returns a vector representing Z axis

Axis Z vector has the third (last) component equal to one, and all the rest equal to zero

◆ Zero

readonly Vector dsp.Vector.Zero = new Vector(0, 0, 0)
static

Returns a zero vector

A zero vector has all components equal to zero.

Property Documentation

◆ X

double dsp.Vector.X
get

Gets the X coordinate of the vector

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(v.X);
1

◆ Y

double dsp.Vector.Y
get

Gets the Y coordinate of the vector

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(v.Y);
2

◆ Z

double dsp.Vector.Z
get

Gets the Z coordinate of the vector

Example

Vector v = new Vector(1,2,3);
Console.WriteLine(v.Z);
3