Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
CoordinateSystemBaseVectors Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class for the base vectors of a Cartesian coordinate system. This kind of triple vector is also called "trihedron". More...

Inheritance diagram for CoordinateSystemBaseVectors:

Public Member Functions

override object Clone ()
 Deep copy.
 
 CoordinateSystemBaseVectors ()
 Constructor that creates a system base object with the axes ((1,0,0), (0,1,0), (0,0,1))
 
 CoordinateSystemBaseVectors (CoordinateSystemBaseVectors sBaseVectors)
 Copy constructor.
 
 CoordinateSystemBaseVectors (double eulerPsi, double eulerTheta, double eulerPhi)
 Constructor that uses Euler angles. See Bronstein et.al. "Taschenbuch der Mathematik" 2., überarb. und erw. Aufl.; Deutsch-Verlag, 1995; p.179-180.
 
 CoordinateSystemBaseVectors (Matrix3x3D rotationMatrix)
 Constructor that uses a rotation matrix for initializing the direction cosines.
 
 CoordinateSystemBaseVectors (OrientationDefinitionBase orientationDefinition)
 Constructor which gets an orientation definition.
 
 CoordinateSystemBaseVectors (Quaternion quaternion)
 Constructor which gets a quaternion.
 
 CoordinateSystemBaseVectors (SerializationInfo info, StreamingContext context)
 Deserialization constructor used for manual serialization.
 
 CoordinateSystemBaseVectors (Vector3D axis1, Vector3D axis2, CoordinatePlane plane)
 Constructor which gets only two base vectors. This may be helpful if one of the base vectors has already been created from a cross product, so creating the third base vector also by a cross product may produce large numerical problems.
 
 CoordinateSystemBaseVectors (Vector3D directionOfZAxis, double zeta, bool inclinationFirst)
 Constructs a new coordinate system base vectors object via z-rotation and the direction vector of the z-axis: The orientation of the system's axes result from 2 steps and a certain order . A) inclinationFirst = false: (i) Rotation about z-axis with angle zeta - using the right-hand-rule, (ii) Inclination of z-axis specified by new direction axis. B) inclinationFirst = true: (i) Inclination of z-axis specified by direction vector, (ii) Rotation about inclined z-axis by angle zeta - using the right-hand-rule.
 
 CoordinateSystemBaseVectors (Vector3D xAxis, Vector3D yAxis, Vector3D zAxis)
 Constructor that uses direction cosines. This constructor is not recommended, because there's a significant probability for numerical inaccuracies which cause orthogonality problems. Better options may be the constructors getting a OrientationDefinitionBase or getting two axes and a plane index.
 
bool Equals (CoordinateSystemBaseVectors baseVectors, bool indulgentCheck)
 Method that checks whether another CoordinateSystemBaseVectors object is equivalent to this.
 
override bool Equals (object obj, EqualityIntent equalityIntent)
 Method which checks for equal objects.
 
Matrix3x3D GetInverseRotationMatrix ()
 Get the corresponding rotation matrix build up from the direction cosines, i.e. the coordinates of the unit vectors of the three axes. If local and reference coordinate system have the same origin, a multiplication with this matrix would perform a coordinate transformation from the reference (external) cs to the local (internal) coordinate system.
 
OrientationDefinitionBase GetOrientation (OrientationDefinitionType type)
 Get the orientation of this, described by an IOrientationDefinition object of a given type. As this method doesn't know whether the z-axis rotation shall be done first or last, it assumes the z-axis rotation has to be done at last.
 
AxisRotationSequence GetOrientationByAxisRotationSequence ()
 Get the orientation of this, described by a sequence of axis rotations.
 
OrientationByCartesianAngles GetOrientationByCartesianAngles (bool cartesianAnglesApplicationBeforeZetaRotation)
 Get the orientation of this, described by the Cartesian angles of the z-axis and an additional rotation about the z-axis. As this method doesn't know whether the z-axis rotation shall be done first or last, it assumes the z-axis rotation has to be done at last.
 
OrientationByDirectionAngles GetOrientationByDirectionAngles (bool directionAnglesApplicationBeforeZetaRotation)
 Get the orientation of this, described by the direction angles of the z-axis and an additional rotation about the z-axis.
 
OrientationByEulerAngles GetOrientationByEulerAngles ()
 Get the orientation of this coordinate system base expressed in Euler angles (Psi, Theta, Phi). For the definition of the Euler angles see Bronstein et.al. "Taschenbuch der Mathematik" 2., überarb. und erw. Aufl.; Deutsch-Verlag, 1995; p.179-180.
 
OrientationBySphereAngles GetOrientationBySphereAngles (bool sphereAnglesApplicationBeforeZetaRotation)
 Get the orientation of this, described by the sphere angles of the z-axis and an additional rotation about the z-axis.
 
Matrix3x3D GetRotationMatrix ()
 Get the corresponding rotation matrix build up from the direction cosines, i.e. the coordinates of the unit vectors of the three axes. If local and reference coordinate system have the same origin, a multiplication with this matrix would perform a coordinate transformation from the local (internal) coordinate system to the reference (external) cs.
 
override string ToString ()
 Gives the axes of this base vectors object as one string.
 

Static Public Member Functions

static CoordinateSystemBaseVectors GetDefinedSystemBaseForZVector (Vector3D zVector)
 Constructs a new system of base vectors from one vector serving as z-axis. The x-axis is defined as being the orthogonal projection of the reference system's x-axis onto the plane on which the given (z-)vector is orthogonal.
 
static bool operator!= (CoordinateSystemBaseVectors bv1, CoordinateSystemBaseVectors bv2)
 Overloaded inequality operator.
 
static bool operator== (CoordinateSystemBaseVectors bv1, CoordinateSystemBaseVectors bv2)
 Overloaded equality operator.
 
static Matrix3x3D RotationMatrixForArbitraryAxis (Vector3D rotationAxis, double angle)
 Calculates the rotation matrix for a arbitrary rotation axis and a rotation angle (by using the right-hand-rule). If a coordinate system shall be rotated, the transposed matrix has to be used. Please note: Using the constructor of Quaternion with the same parameters could be a better choice regarding performance.
 
static Matrix3x3D RotationMatrixForXAxis (double angle)
 Calculates the rotation matrix for a rotation about the x-axis.
 
static Matrix3x3D RotationMatrixForYAxis (double angle)
 Calculates the rotation matrix for a rotation about the y-axis.
 
static Matrix3x3D RotationMatrixForZAxis (double angle)
 Calculates the rotation matrix for a rotation about the z-axis.
 

Properties

Quaternion Quaternion [get, set]
 Quaternion which represents the orientation of the base vectors in the reference coordinate system.
 
Vector3D XAxis [get]
 Direction cosines of the x-Axis.
 
Vector3D YAxis [get]
 Direction cosines of the y-Axis.
 
Vector3D ZAxis [get]
 Direction cosines of the z-Axis.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
Class for the base vectors of a Cartesian coordinate system. This kind of triple vector is also called "trihedron".

Constructor & Destructor Documentation

◆ CoordinateSystemBaseVectors() [1/9]

Constructor which gets a quaternion.

Parameters
quaternion

◆ CoordinateSystemBaseVectors() [2/9]

CoordinateSystemBaseVectors ( Vector3D  xAxis,
Vector3D  yAxis,
Vector3D  zAxis 
)

Constructor that uses direction cosines. This constructor is not recommended, because there's a significant probability for numerical inaccuracies which cause orthogonality problems. Better options may be the constructors getting a OrientationDefinitionBase or getting two axes and a plane index.

Parameters
xAxisDirection cosine of the x-axis.
yAxisDirection cosine of the y-axis.
zAxisDirection cosine of the z-axis.

◆ CoordinateSystemBaseVectors() [3/9]

CoordinateSystemBaseVectors ( Vector3D  axis1,
Vector3D  axis2,
CoordinatePlane  plane 
)

Constructor which gets only two base vectors. This may be helpful if one of the base vectors has already been created from a cross product, so creating the third base vector also by a cross product may produce large numerical problems.

Parameters
axis1First base vector (meaning is set by planeIndex).
axis2Second base vector (meaning is set by planeIndex).
planeSets the meaning of axis1 and axis2 by defining which plane is spanned by the given axes.

◆ CoordinateSystemBaseVectors() [4/9]

Constructor which gets an orientation definition.

Parameters
orientationDefinitionOrientation definition to create a new CoordinateSystemBaseVectors object from.

◆ CoordinateSystemBaseVectors() [5/9]

Constructor that uses a rotation matrix for initializing the direction cosines.

Parameters
rotationMatrixRotation matrix R (i.e. R orthogonal and det(R)=1) that describes the rotation of the axes of the reference coordinate system to this Also (another interpretation of R): R defines a coordinate transformation from the coordinate system spanned by this base vectors (coordinates x') to the reference coordinate system (coordinates x) by x = Rx' (and therefore x' = R^Tx) - where both systems have the same origin.

◆ CoordinateSystemBaseVectors() [6/9]

CoordinateSystemBaseVectors ( double  eulerPsi,
double  eulerTheta,
double  eulerPhi 
)

Constructor that uses Euler angles. See Bronstein et.al. "Taschenbuch der Mathematik" 2., überarb. und erw. Aufl.; Deutsch-Verlag, 1995; p.179-180.

Parameters
eulerPsiAngle Psi
eulerThetaAngle Theta
eulerPhiAngle Phi

◆ CoordinateSystemBaseVectors() [7/9]

CoordinateSystemBaseVectors ( Vector3D  directionOfZAxis,
double  zeta,
bool  inclinationFirst 
)

Constructs a new coordinate system base vectors object via z-rotation and the direction vector of the z-axis: The orientation of the system's axes result from 2 steps and a certain order . A) inclinationFirst = false: (i) Rotation about z-axis with angle zeta - using the right-hand-rule, (ii) Inclination of z-axis specified by new direction axis. B) inclinationFirst = true: (i) Inclination of z-axis specified by direction vector, (ii) Rotation about inclined z-axis by angle zeta - using the right-hand-rule.

Parameters
zetaAngle (radian) of rotation about z-axis by using the right-hand-rule.
directionOfZAxisDirection vector of new z-axis
inclinationFirstFlag to signal if z-axis is inclined first (true) or after rotation of z-axis (false).

◆ CoordinateSystemBaseVectors() [8/9]

Copy constructor.

Parameters
sBaseVectorsSystemBaseVectors to copy

◆ CoordinateSystemBaseVectors() [9/9]

CoordinateSystemBaseVectors ( SerializationInfo  info,
StreamingContext  context 
)

Deserialization constructor used for manual serialization.

Parameters
infothe info object used for deserialization
contextthe streaming context

Member Function Documentation

◆ Clone()

override object Clone ( )

Deep copy.

Returns
Copy of this

◆ Equals() [1/2]

bool Equals ( CoordinateSystemBaseVectors  baseVectors,
bool  indulgentCheck 
)

Method that checks whether another CoordinateSystemBaseVectors object is equivalent to this.

Parameters
baseVectorsCoordinateSystemBaseVectors object to check
indulgentCheckFlag that indicates whether an indulgent check is to be done (like in NumericalChecks) or if an exact check has to be done.
Returns
Is CoordinateSystemBaseVectors object equivalent?

◆ Equals() [2/2]

override bool Equals ( object  obj,
EqualityIntent  equalityIntent 
)

Method which checks for equal objects.

Parameters
objThe System.Object to compare with this instance.
equalityIntentThe equality intent.
Returns
true if the specified System.Object is equal to this instance; otherwise, false.

◆ GetDefinedSystemBaseForZVector()

static CoordinateSystemBaseVectors GetDefinedSystemBaseForZVector ( Vector3D  zVector)
static

Constructs a new system of base vectors from one vector serving as z-axis. The x-axis is defined as being the orthogonal projection of the reference system's x-axis onto the plane on which the given (z-)vector is orthogonal.

Parameters
zVectorVector to create a system of base vectors from.
Returns
A new system of base vectors, created from the given vector serving as z-axis.

◆ GetInverseRotationMatrix()

Matrix3x3D GetInverseRotationMatrix ( )

Get the corresponding rotation matrix build up from the direction cosines, i.e. the coordinates of the unit vectors of the three axes. If local and reference coordinate system have the same origin, a multiplication with this matrix would perform a coordinate transformation from the reference (external) cs to the local (internal) coordinate system.

Returns
The inverse rotation matrix.

◆ GetOrientation()

Get the orientation of this, described by an IOrientationDefinition object of a given type. As this method doesn't know whether the z-axis rotation shall be done first or last, it assumes the z-axis rotation has to be done at last.

Parameters
typeType of the IOrientationDefinition object to give.
Returns
Orientation of this as IOrientationDefinition

◆ GetOrientationByAxisRotationSequence()

AxisRotationSequence GetOrientationByAxisRotationSequence ( )

Get the orientation of this, described by a sequence of axis rotations.

Returns
Orientation of this as AxisRotationSequence

◆ GetOrientationByCartesianAngles()

OrientationByCartesianAngles GetOrientationByCartesianAngles ( bool  cartesianAnglesApplicationBeforeZetaRotation)

Get the orientation of this, described by the Cartesian angles of the z-axis and an additional rotation about the z-axis. As this method doesn't know whether the z-axis rotation shall be done first or last, it assumes the z-axis rotation has to be done at last.

Parameters
cartesianAnglesApplicationBeforeZetaRotationIf set to true the Cartesian angles are applied before an eventual zeta rotation.
Returns
Orientation of this as OrientationByCartesianAngles

◆ GetOrientationByDirectionAngles()

OrientationByDirectionAngles GetOrientationByDirectionAngles ( bool  directionAnglesApplicationBeforeZetaRotation)

Get the orientation of this, described by the direction angles of the z-axis and an additional rotation about the z-axis.

Parameters
directionAnglesApplicationBeforeZetaRotationif set to true the direction angles are applied before an eventual zeta rotation.
Returns
Orientation of this as OrientationByDirectionAngles

◆ GetOrientationByEulerAngles()

OrientationByEulerAngles GetOrientationByEulerAngles ( )

Get the orientation of this coordinate system base expressed in Euler angles (Psi, Theta, Phi). For the definition of the Euler angles see Bronstein et.al. "Taschenbuch der Mathematik" 2., überarb. und erw. Aufl.; Deutsch-Verlag, 1995; p.179-180.

Returns
Orientation of this as OrientationByEulerAngles

◆ GetOrientationBySphereAngles()

OrientationBySphereAngles GetOrientationBySphereAngles ( bool  sphereAnglesApplicationBeforeZetaRotation)

Get the orientation of this, described by the sphere angles of the z-axis and an additional rotation about the z-axis.

Parameters
sphereAnglesApplicationBeforeZetaRotationIf set to true the sphere angles are applied before an eventual zeta rotation.
Returns
Orientation of this as OrientationBySphereAngles

◆ GetRotationMatrix()

Matrix3x3D GetRotationMatrix ( )

Get the corresponding rotation matrix build up from the direction cosines, i.e. the coordinates of the unit vectors of the three axes. If local and reference coordinate system have the same origin, a multiplication with this matrix would perform a coordinate transformation from the local (internal) coordinate system to the reference (external) cs.

Returns
The rotation matrix.

◆ operator!=()

static bool operator!= ( CoordinateSystemBaseVectors  bv1,
CoordinateSystemBaseVectors  bv2 
)
static

Overloaded inequality operator.

Parameters
bv1First SystemBaseVectors object to compare
bv2Second SystemBaseVectors object to compare
Returns
Are both SystemBaseVectors objects unequal?

◆ operator==()

static bool operator== ( CoordinateSystemBaseVectors  bv1,
CoordinateSystemBaseVectors  bv2 
)
static

Overloaded equality operator.

Parameters
bv1First SystemBaseVectors object to compare
bv2Second SystemBaseVectors object to compare
Returns
Are both SystemBaseVectors objects equal?

◆ RotationMatrixForArbitraryAxis()

static Matrix3x3D RotationMatrixForArbitraryAxis ( Vector3D  rotationAxis,
double  angle 
)
static

Calculates the rotation matrix for a arbitrary rotation axis and a rotation angle (by using the right-hand-rule). If a coordinate system shall be rotated, the transposed matrix has to be used. Please note: Using the constructor of Quaternion with the same parameters could be a better choice regarding performance.

See also
VirtualLabAPI.Core.Numerics.Quaternion
Parameters
rotationAxisRotation axis (unit vector)
angleRotation angle.
Returns
The rotation matrix for the rotation about the given axis with the given angle (right-hand-rule).

◆ RotationMatrixForXAxis()

static Matrix3x3D RotationMatrixForXAxis ( double  angle)
static

Calculates the rotation matrix for a rotation about the x-axis.

Parameters
angleRotation angle
Returns
The rotation matrix for the rotation of a coordinate system about the x-axis.

◆ RotationMatrixForYAxis()

static Matrix3x3D RotationMatrixForYAxis ( double  angle)
static

Calculates the rotation matrix for a rotation about the y-axis.

Parameters
angleRotation angle
Returns
The rotation matrix for the rotation of a coordinate system about the y-axis.

◆ RotationMatrixForZAxis()

static Matrix3x3D RotationMatrixForZAxis ( double  angle)
static

Calculates the rotation matrix for a rotation about the z-axis.

Parameters
angleRotation angle
Returns
The rotation matrix for the rotation of a coordinate system about the z-axis

◆ ToString()

override string ToString ( )

Gives the axes of this base vectors object as one string.

Returns