Programming Reference for VirtualLab Fusion
2025.1
|
This struct defines a three dimensional vector of double numbers. Operators \(a+b\), \(a-b\) and \(a|b\) (Scalar product) can be used. Second operand on \(a*b\), \(a/b\) and \(a^b\) (applied separate on components) can be a double too. More...
Public Member Functions | |
double | Abs () |
Calculates the absolute value of this Vector3D object. The absolute value corresponds to the length of the vector. | |
DirectionDefinitionBase | GetDirection (DirectionDefinitionType type) |
Get the direction of this, described by a DirectionDefinition of a given type. | |
bool | IsZeroVector () |
Checks if the vector is the zero vector within a certain epsilon. | |
double | Norm () |
Calculates the squared absolute value of this Vector3D object. | |
void | Normalize () |
Normalizes the present Vector3D object. | |
Vector3D | Rotate (Vector3D axis, double angle) |
rotate function for the vector 3D | |
override string | ToString () |
Converts a Vector3D into a string of format (X; Y ;Z). For the creation of the string the default number of digits specified in Globals.DefaultDigitPrecision will be used. | |
string | ToString (int digitPrecision) |
Converts a Vector3D into a string of format (X, Y, Z). | |
Vector3D (double alpha, double beta, double length, bool useDirectionAngles) | |
Creates a Vector3D using given angles and length. | |
Vector3D (double x, double y, double z) | |
Creates a Vector3D from three double values. | |
Vector3D (Vector3D toCopy) | |
Creates a copy of the referenced Vector3D. | |
Static Public Member Functions | |
static double | AngleBetweenVectors (Vector3D vector1, Vector3D vector2) |
Calculates the angle between two between vectors. | |
static bool | ArePointsCollinear (Vector3D p1, Vector3D p2, Vector3D p3) |
Static method to check if three 3D-points lie on a line (i. e. being collinear). | |
static bool | AreVectorsCollinear (Vector3D v1, Vector3D v2) |
Static method to check (with numerical tolerance) whether two vectors are parallel or anti-parallel. | |
static Vector3D | CrossProduct (Vector3D a, Vector3D b) |
Calculates the cross product of two Vector3D objects. | |
static | operator devDept.Geometry.Vector3D (Vector3D vector) |
Converts a Vector3D object to a Vector3D object (from eyeshot). | |
static | operator Point3D (Vector3D point) |
Converts a Vector3D object to a Point3D object (from eyeshot). | |
static | operator Vector3D (Color color) |
Explicit conversion of a System.Drawing.Color object into a Vector3D object. | |
static | operator Vector3D (Point3D point) |
Converts a Point3D object (from eyeshot) to a Vector3D object. | |
static bool | operator!= (Vector3D vector1, Vector3D vector2) |
Compares two Vector3D for inequality. The comparison will be done by comparing the values of the x-, y- and z- components respectively. | |
static Vector3D | operator* (double factor, Vector3D vector) |
Multiplies a Vector3D objects by a double value. | |
static Vector3D | operator* (Vector3D a, Vector3D b) |
Multiplies two Vector3D objects. | |
static Vector3C | operator* (Vector3D vector, Complex factor) |
Multiplies a Vector3C objects by a Complex value. | |
static Vector3D | operator* (Vector3D vector, double factor) |
Multiplies a Vector3D objects by a double value. | |
static Vector3D | operator+ (Vector3D a, Vector3D b) |
Adds two Vector3D objects. | |
static Vector3D | operator- (Vector3D a, Vector3D b) |
Subtracts two Vector3D objects. | |
static Vector3D | operator- (Vector3D v) |
Inverts a Vector3D object. | |
static Vector3D | operator/ (double number, Vector3D vector) |
Performs a component wise division of a double value and a Vector3D object. The result is defined as new VectorD(number / vector.X, number / vector.Y). | |
static Vector3D | operator/ (Vector3D a, Vector3D b) |
Performs a component wise division of two Vector3D objects. | |
static Vector3D | operator/ (Vector3D vector, double divisor) |
Performs a component wise division of a Vector3D object and a double value. | |
static bool | operator== (Vector3D vector1, Vector3D vector2) |
Compares two Vector3D for equality. The comparison will be done by comparing the values of the x-, y- and z- components respectively. | |
static double | operator| (Vector3D a, Vector3D b) |
Calculates the scalar product of two Vector3D objects. | |
static Vector3D | Parse (string vector3DAsString) |
public support function to parse a vector 3D from given string | |
Public Attributes | |
double | X |
X-value of the Vector3D object. | |
double | Y |
Y-value of the Vector3D object. | |
double | Z |
Z-value of the Vector3D object. | |
Static Public Attributes | |
static readonly Vector3D | NegUnitVectorZ |
A constant containing the unit vector in negative z-direction. | |
static readonly Vector3D | UndefinedVector |
A constant vector containing 3 Double.NaNs. Property IsUndefined can be used to check for being undefined. | |
static readonly Vector3D | UndeterminedVector |
A constant containing an undetermined vector. | |
static readonly Vector3D | UnitVectorX |
A constant containing the unit vector in x-direction. | |
static readonly Vector3D | UnitVectorY |
A constant containing the unit vector in y-direction. | |
static readonly Vector3D | UnitVectorZ |
A constant containing the unit vector in z-direction. | |
static readonly Vector3D | ZeroVector |
A constant containing the zero vector (0, 0, 0). | |
Properties | |
bool | IsUndefined [get] |
Gets whether a least one component of the vector is undefined. | |
This struct defines a three dimensional vector of double numbers. Operators \(a+b\), \(a-b\) and \(a|b\) (Scalar product) can be used. Second operand on \(a*b\), \(a/b\) and \(a^b\) (applied separate on components) can be a double too.
Vector3D | ( | double | x, |
double | y, | ||
double | z | ||
) |
Creates a Vector3D from three double values.
x | X value of new Vector3D object. |
y | Y value of new Vector3D object. |
z | Z value of new Vector3D object. |
Creates a copy of the referenced Vector3D.
toCopy | Vector3D to be copied. |
Vector3D | ( | double | alpha, |
double | beta, | ||
double | length, | ||
bool | useDirectionAngles | ||
) |
Creates a Vector3D using given angles and length.
alpha | First angle; interpretation depends on useDirectionAngles. |
beta | Second angle; interpretation depends on useDirectionAngles. |
length | Length of new Vector3D. |
useDirectionAngles | Parameters can be interpreted in two different ways: true \(\rightarrow\) Cartesian angles; false \(\rightarrow\) Sphere Angles. |
double Abs | ( | ) |
Calculates the absolute value of this Vector3D object. The absolute value corresponds to the length of the vector.
Calculates the angle between two between vectors.
vector1 | The first vector. |
vector2 | The second vector. |
Static method to check if three 3D-points lie on a line (i. e. being collinear).
p1 | 3D point 1. |
p2 | 3D point 2. |
p3 | 3D point 3. |
Static method to check (with numerical tolerance) whether two vectors are parallel or anti-parallel.
v1 | First vector |
v2 | Second vector |
Calculates the cross product of two Vector3D objects.
a | First operand used for cross product calculation. |
b | Second operand used for cross product calculation. |
DirectionDefinitionBase GetDirection | ( | DirectionDefinitionType | type | ) |
Get the direction of this, described by a DirectionDefinition of a given type.
type | Type of the DirectionDefinition. |
bool IsZeroVector | ( | ) |
Checks if the vector is the zero vector within a certain epsilon.
double Norm | ( | ) |
Calculates the squared absolute value of this Vector3D object.
void Normalize | ( | ) |
Normalizes the present Vector3D object.
ArgumentException | Vector to normalize has a length of zero. |
|
explicitstatic |
Converts a Vector3D object to a Vector3D object (from eyeshot).
vector | The Vector3D object to convert. |
|
explicitstatic |
Converts a Vector3D object to a Point3D object (from eyeshot).
point | The Vector3D object to convert into a Point3D object. |
|
explicitstatic |
Explicit conversion of a System.Drawing.Color object into a Vector3D object.
color | System.Drawing.Color object to convert into a Vector3D object. |
|
explicitstatic |
Converts a Point3D object (from eyeshot) to a Vector3D object.
point | The Point3D object to convert into a Vector3D object. |
Compares two Vector3D for inequality. The comparison will be done by comparing the values of the x-, y- and z- components respectively.
vector1 | First Vector3D object to compare. |
vector2 | Second Vector3D object to compare. |
Multiplies a Vector3D objects by a double value.
factor | The double value to multiply. |
vector | The Vector3D object to multiply. |
Multiplies two Vector3D objects.
a | The first Vector3D object to multiply. |
b | The second Vector3D object to multiply. |
Multiplies a Vector3C objects by a Complex value.
vector | The Vector3C object to multiply. |
factor | The Complex value to multiply. |
Multiplies a Vector3D objects by a double value.
vector | The Vector3D object to multiply. |
factor | The double value to multiply. |
Adds two Vector3D objects.
a | The first Vector3D object to add. |
b | The second Vector3D object to add. |
Subtracts two Vector3D objects.
a | The first Vector3D object to subtract from. |
b | The second Vector3D object to subtract. |
Inverts a Vector3D object.
v | Vector to invert. |
Performs a component wise division of a double value and a Vector3D object. The result is defined as new VectorD(number / vector.X, number / vector.Y).
number | The double value to divide by the components of the Vector3D object. |
vector | The Vector3D object used as divisor. |
Performs a component wise division of two Vector3D objects.
a | The first Vector3D object to divide by parameter b. |
b | The second Vector3D object used as divisor. |
Performs a component wise division of a Vector3D object and a double value.
vector | The Vector3D object to divide by the double value. |
divisor | The double value used as divisor. |
Compares two Vector3D for equality. The comparison will be done by comparing the values of the x-, y- and z- components respectively.
vector1 | First Vector3D object to compare. |
vector2 | Second Vector3D object to compare. |
Calculates the scalar product of two Vector3D objects.
a | First Vector3D object. |
b | Second Vector3D object. |
|
static |
public support function to parse a vector 3D from given string
vector3DAsString | the string that should be parsed |
rotate function for the vector 3D
axis | the axis that shall be used for rotation |
angle | the angle used for rotation |
override string ToString | ( | ) |
Converts a Vector3D into a string of format (X; Y ;Z). For the creation of the string the default number of digits specified in Globals.DefaultDigitPrecision will be used.
string ToString | ( | int | digitPrecision | ) |
Converts a Vector3D into a string of format (X, Y, Z).
digitPrecision | Number of digits the values are rounded to. |
|
get |
Gets whether a least one component of the vector is undefined.
true
iff at least one component of the vector is NaN
.