The Vector4D type exposes the following members.
Constructors
Name | Description | |
---|---|---|
Vector4D(Double) |
Makes a 4d-vector from 1 value, all vector components are set to the input value
| |
Vector4D(Vector2D) |
Makes a 4d-vector copy from a 2d-vector, z is set to 0 and w to 1
| |
Vector4D(Vector3D) |
Makes a 4d-vector copy from a 3d-vector, w is set to 1
| |
Vector4D(Vector4D) |
Copies a 4d-vecor
| |
Vector4D(Vector2D, Vector2D) |
Makes a 4d-vector copy from a two 2d-vectors
| |
Vector4D(Vector3D, Double) |
Makes a 4d-vector copy from a 3d-vector and w component
| |
Vector4D(Vector2D, Double, Double) |
Makes a 4d-vector copy from a 2d-vector and z and w component
| |
Vector4D(Double, Double, Double, Double) |
Makes a 4d-vector from 4 values
|
Methods
Name | Description | |
---|---|---|
Equals(Object) | (Overrides ValueType..::..Equals(Object).) | |
Equals(Vector4D) | ||
Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | (Overrides ValueType..::..GetHashCode()()()().) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.) |
Operators
Name | Description | |
---|---|---|
Addition(Double, Vector4D) |
value + vector, adds a value to all vector components
| |
Addition(Vector4D, Double) |
vector + value, adds a value to all vector components
| |
Addition(Vector4D, Vector4D) |
vector + vector, adds the values of two vectors component wise
| |
BitwiseAnd |
4d-vector & 4d-vector, performs a quaternion multiplication
defined as:
w = v1.w * v2.w - (v1.xyz | v2.xyz)
xyz = v1.xyz * v2.w + v2.xyz * v1.w + (v1.xyz & v2.xyz)
code is:
x = v1.w*v2.x + v1.x*v2.w + v1.y*v2.z - v1.z*v2.y
y = v1.w*v2.y + v1.y*v2.w + v1.z*v2.x - v1.x*v2.z
z = v1.w*v2.z + v1.z*v2.w + v1.x*v2.y - v1.y*v2.x
w = v1.w*v2.w - v1.x*v2.x - v1.y*v2.y - v1.z*v2.z
| |
BitwiseOr |
vector | vector, dot product for vectors, that is the sum of all component wise products
| |
Division(Double, Vector4D) |
value / vector, divides a value by all vector components
| |
Division(Vector4D, Double) |
vector / value, divides all vector components by a value
| |
Division(Vector4D, Vector4D) |
vector / vector, divides the values of two vectors component wise
| |
Equality |
vector == vector, checks if the two vectors are equal
| |
GreaterThan |
vector > value, compares all vector components to a value
| |
GreaterThanOrEqual |
vector >= value, compares all vector components to a value
| |
Inequality |
vector != vector, checks if the two vectors are not equal
| |
LessThan |
vector < value, compares all vector components to a value
| |
LessThanOrEqual |
vector <= value, compares all vector components to a value
| |
LogicalNot |
! vector, calculates the length of the vector
| |
Modulus(Double, Vector4D) |
value % vector, a value modulo all vector components
| |
Modulus(Vector4D, Double) |
vector % value, all vector components modulo a value
| |
Modulus(Vector4D, Vector4D) |
vector % vector, component wise modulo for vectors
| |
Multiply(Double, Vector4D) |
value * vector, multiplies a value by all vector components
| |
Multiply(Vector4D, Double) |
vector * value, multiplies a value by all vector components
| |
Multiply(Vector4D, Vector4D) |
vector * vector, multiplies the values of two vectors component wise
| |
OnesComplement |
~ vector, normalizes a vector
| |
Subtraction(Double, Vector4D) |
value - vector, subtracts all vector components from a value
| |
Subtraction(Vector4D, Double) |
vector - value, subtracts a value from all vector components
| |
Subtraction(Vector4D, Vector4D) |
vector - vector, subtracts the components of v2 from the components of v1
| |
UnaryNegation |
- vector, flips the sign off all vector components
| |
UnaryPlus |
+ vector, makes no changes to a vector
|
Extension Methods
Name | Description | |
---|---|---|
ToSlimDXVector |
Converts a Vector4D to a Vector4.
(Defined by VectorExtensions.) |
Fields
Name | Description | |
---|---|---|
w |
Data component for the w dimension
| |
x |
Data component for the x dimension
| |
y |
Data component for the y dimension
| |
z |
Data component for the z dimension
|
Properties
Name | Description | |
---|---|---|
Item |
Unsafe but very fast indexer for 4d-vector, [0..3]
| |
Length |
Get or Set the Length of this vector
| |
xy |
Get/set x and y components as 2d-vector
| |
xyz |
Get/set x, y and z components as 3d-vector
|