Programming Reference for VirtualLab™  5.4
Classes | Public Member Functions | Static Public Member Functions | Properties | Events | List of all members
CartesianCoordinateSystem Class Reference

Classes

class  SystemBaseVectors
 Class for base vectors. More...
 

Public Member Functions

PositionedLine AxisAsPositionedLine (AxisDirection chosenAxis)
 
 CartesianCoordinateSystem ()
 
 CartesianCoordinateSystem (IProvidesPositioningReferences positioningReferenceProvider, string positioningReferenceKey)
 
 CartesianCoordinateSystem (Position origin)
 
 CartesianCoordinateSystem (CartesianCoordinateSystem cs)
 
 CartesianCoordinateSystem (Position origin, Vector3D xAxis, Vector3D yAxis, Vector3D zAxis)
 
 CartesianCoordinateSystem (Position origin, double eulerPsi, double eulerTheta, double eulerPhi)
 
 CartesianCoordinateSystem (Position origin, EulerAnglesSet eulerAngles)
 
 CartesianCoordinateSystem (Position origin, SystemBaseVectors axes)
 
 CartesianCoordinateSystem (SerializationInfo info, StreamingContext context)
 
object Clone ()
 
void GetGlobalTransformationParameters (out Matrix3x3D globalRotationMatrix, out Vector3D globalOriginPos)
 
CartesianCoordinateSystem GetRotatedAndTranslatedCoordinateSystem (Vector3D offset, Matrix3x3D rotation)
 
void GetRotationAsSphericalAnglesOfZAxis (out double theta, out double phi)
 
void OnCoordinateSystemChanged ()
 
void SetPositioningReference (IProvidesPositioningReferences referenceProvider, string key)
 
override string ToString ()
 
Vector3D TransformInternalPosition2PositionInReferenceCS (Vector3D internalPos)
 
Vector3D TransformPositionInReferenceCS2InternalPosition (Vector3D externalPos)
 

Static Public Member Functions

static CartesianCoordinateSystem GetCSForReflection (CartesianCoordinateSystem coordinateSystemInput)
 
static CartesianCoordinateSystem GetCSFromAxisRotationsSequence (Position origin, AxisRotationSequence sequence)
 
static CartesianCoordinateSystem GetCSFromCartesianAnglesOfZAxis (Position origin, double zeta, double alpha, double beta, bool inclinationFirst, bool zAxisDefinedInRotatedSystem)
 
static CartesianCoordinateSystem GetCSFromDirectionAnglesOfZAxis (Position origin, double zeta, double alpha, double beta, double gamma, bool inclinationFirst, bool zAxisDefinedInRotatedSystem)
 
static CartesianCoordinateSystem GetCSFromDirectionOfZAxis (Position origin, double zeta, Vector3D directionOfZAxis, bool inclinationFirst, bool zAxisDefinedInRotatedSystem)
 
static CartesianCoordinateSystem GetCSFromIOrientationDefinition (Position origin, IOrientationDefinition orientationDefinition)
 
static CartesianCoordinateSystem GetCSFromSphericalAnglesOfZAxis (Position origin, double zeta, double zPhi, double zTheta, bool inclinationFirst, bool zAxisInclinatedInRotatedSystem)
 
static bool operator!= (CartesianCoordinateSystem cs1, CartesianCoordinateSystem cs2)
 
static bool operator== (CartesianCoordinateSystem cs1, CartesianCoordinateSystem cs2)
 
static Matrix3x3D RotationMatrixForArbitraryAxis (Vector3D rotationAxis, double angle)
 
static Matrix3x3D RotationMatrixForRotationAngle (PhysicalValue rotAngle)
 
static Matrix3x3D RotationMatrixForXAxis (double angle)
 
static Matrix3x3D RotationMatrixForYAxis (double angle)
 
static Matrix3x3D RotationMatrixForZAxis (double angle)
 

Properties

SystemBaseVectors Axes [get, set]
 
CartesianCoordinateSystem GetPositioningReference [get]
 
bool IsDefinedAbsolutely [get]
 
Position Origin [get, set]
 
string PositioningReferenceKey [get]
 
IProvidesPositioningReferences PositioningReferenceProvider [get]
 

Events

EventHandler CoordinateSystemChanged
 

Detailed Description

Constructor & Destructor Documentation

Default constructor, creating a new CartesianCoordinateSystem that is defined absolutely, and identical to the global coordinate system.

CartesianCoordinateSystem ( IProvidesPositioningReferences  positioningReferenceProvider,
string  positioningReferenceKey 
)

Constructor, creating a new CartesianCoordinateSystem that is defined in reference to a given reference cs, it lies at (0,0,0) and is not rotated to this reference.

CartesianCoordinateSystem ( Position  origin)

Constructor for a Cartesian coordinate system that is translated but not rotated with respect to the reference coordinate system. The pointer to the reference coordinate system is stored in variable origin.

Parameters
originPosition of the origin with respect to the reference coordinate system, that is set via origin.ReferenceCoordinateSystem.

Copy constructor.

Parameters
cssystem to be copied.
CartesianCoordinateSystem ( Position  origin,
Vector3D  xAxis,
Vector3D  yAxis,
Vector3D  zAxis 
)

Constructor that uses a position for the origin and the new axes, which must be orthogonal and should be normalized (constructor will normalize them anyway)

Parameters
originPosition of the origin.
xAxisDirection cosine of the x-axis.
yAxisDirection cosine of the y-axis.
zAxisDirection cosine of the z-axis.
CartesianCoordinateSystem ( Position  origin,
double  eulerPsi,
double  eulerTheta,
double  eulerPhi 
)

Constructor that uses a position and euler angles

Parameters
originPosition of the origin.
eulerPsiEuler angle Psi for rotation.
eulerThetaEuler angle Theta for rotation.
eulerPhiEuler angle Phi for rotation.
CartesianCoordinateSystem ( Position  origin,
EulerAnglesSet  eulerAngles 
)

Constructor that uses a position and euler angles

Parameters
originPosition of the origin.
eulerAnglesSet of Euler angles that describes orientation
CartesianCoordinateSystem ( Position  origin,
SystemBaseVectors  axes 
)

Constructor that uses a Position and a SystemBaseVectors

Parameters
originPosition of origin
axesDirections of the axes
CartesianCoordinateSystem ( SerializationInfo  info,
StreamingContext  context 
)

Deserialization constructor used for manual serialization

Parameters
infothe info object used for deserialization
contextthe streaming context

Member Function Documentation

PositionedLine AxisAsPositionedLine ( AxisDirection  chosenAxis)

Extracts one axis as positioned line

Parameters
chosenAxisAxis to extract
Returns
Positioned line with the direction of the given axis and the position of this coordinate system.
object Clone ( )

Deep copy

Returns
Copy of this
static CartesianCoordinateSystem GetCSForReflection ( CartesianCoordinateSystem  coordinateSystemInput)
static

Gets a coordinate system which can be used for reflection

Parameters
coordinateSystemInputThe coordinate system from the coordinate system for reflection is being generated.
Returns
The given coordinate system, simply rotated by 180° (Pi) about the y-axis.
static CartesianCoordinateSystem GetCSFromAxisRotationsSequence ( Position  origin,
AxisRotationSequence  sequence 
)
static

Constructs a new cartesian coordinate system via axis rotation sequence

Parameters
originOrigin of coordinate system in reference coordinates.
sequenceAxisRotationSequence that determines how to get the new coordinate system starting from its reference system.
Returns
New Cartesian coordinate system.
static CartesianCoordinateSystem GetCSFromCartesianAnglesOfZAxis ( Position  origin,
double  zeta,
double  alpha,
double  beta,
bool  inclinationFirst,
bool  zAxisDefinedInRotatedSystem 
)
static

Constructs a new cartesian coordinate system with respect to the reference cs (stored in origin) via z-rotation and cartesian angles for the z-axis: The orientation of the coordinate system results from the reference cs in 2 steps and this order (if inclinationFirst=false): (i) Rotation about z-axis with angle zeta - using the right-hand-rule (ii) Inclination of z-axis specified by cartesian angles or vice versa, if inclinationFirst=true: (i) Inclination of z-axis specified by cartesian angles (ii) Rotation about inclined z-axis by angle zeta - using the right-hand-rule

Parameters
originOrigin of coordinate system in reference coordinates.
zetaAngle (radian) of rotation about z-axis by using the right-hand-rule.
alphaAngle between the z-axis and the projection of the z-axis onto the x-z-plane
betaAngle between the z-axis and the projection of the z-axis onto the y-z-plane
inclinationFirstFlag to signal if z-axis is inclined first (true) or after rotation of z-axis (false). If true, parameter zAxisDefinedInRotatedSystem is ignored, as the z-axis must always be defined in the reference system, of course.
zAxisDefinedInRotatedSystemIf false, directionOfZAxis defines the direction of the z-axis in the reference coordinate system. If true, directionOfZAxis defines the direction of the z-axis in the rotated coordinate system (rotation about z-axis by zeta).
Returns
New Cartesian coordinate system.
static CartesianCoordinateSystem GetCSFromDirectionAnglesOfZAxis ( Position  origin,
double  zeta,
double  alpha,
double  beta,
double  gamma,
bool  inclinationFirst,
bool  zAxisDefinedInRotatedSystem 
)
static

Constructs a new cartesian coordinate system with respect to the reference cs (stored in origin) via z-rotation and direction angles: The orientation of the coordinate system results from the reference cs in 2 steps and this order (if inclinationFirst=false): (i) Rotation about z-axis with angle zeta - using the right-hand-rule (ii) Inclination of z-axis specified by direction angles alpha, beta, gamma with the positive x-, y- and z-axis of either the reference cs (zAxisDefinedInRotatedSystem==false) or the rotated cs (zAxisDefinedInRotatedSystem==true). or vice versa, if inclinationFirst=true: (i) Inclination of z-axis (ii) Rotation about inclined z-axis by angle zeta - using the right-hand-rule

Parameters
originOrigin of coordinate system in reference coordinates.
zetaAngle (in radian) of rotation about z-axis by using the right-hand-rule.
alphaDirection cosine angle alpha in radian: angle of new z-axis with positive x-axis.
betaDirection cosine beta in radian: angle of new z-axis with positive y-axis.
gammaDirection cosine beta in radian: angle of new z-axis with positive z-axis.
inclinationFirstFlag to signal if z-axis is inclined first (true) or after rotation of z-axis (false). If true, parameter zAxisDefinedInRotatedSystem is ignored, as it must always be defined in the reference system, of course.
zAxisDefinedInRotatedSystemIf false, directionOfZAxis defines the direction of the z-axis in the reference coordinate system. If true, directionOfZAxis defines the direction of the z-axis in the rotated coordinate system (rotation about z-axis by zeta).
Returns
New Cartesian coordinate system.
static CartesianCoordinateSystem GetCSFromDirectionOfZAxis ( Position  origin,
double  zeta,
Vector3D  directionOfZAxis,
bool  inclinationFirst,
bool  zAxisDefinedInRotatedSystem 
)
static

Constructs a new cartesian coordinate system with respect to the reference cs (stored in origin) via z-rotation and the direction vector of the z-axis: The orientation of the coordinate system results from the reference cs in 2 steps and this order (if 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 or vice versa, if 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
originOrigin of coordinate system in reference coordinates.
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). If true, parameter zAxisDefinedInRotatedSystem is ignored, as the z-axis must always be defined in the reference system, of course.
zAxisDefinedInRotatedSystemIf false, directionOfZAxis defines the direction of the z-axis in the reference coordinate system. If true, directionOfZAxis defines the direction of the z-axis in the rotated coordinate system (rotation about z-axis by zeta).
Returns
New Cartesian coordinate system.
static CartesianCoordinateSystem GetCSFromIOrientationDefinition ( Position  origin,
IOrientationDefinition  orientationDefinition 
)
static

Constructs a new cartesian coordinate system via any IOrientationDefinition

Parameters
originOrigin of coordinate system in reference coordinates.
orientationDefinitionIOrientationDefinition that determines how to get the new coordinate system starting from its reference system.
Returns
New Cartesian coordinate system.
static CartesianCoordinateSystem GetCSFromSphericalAnglesOfZAxis ( Position  origin,
double  zeta,
double  zPhi,
double  zTheta,
bool  inclinationFirst,
bool  zAxisInclinatedInRotatedSystem 
)
static

Constructs a new cartesian coordinate system with respect to the reference cs (stored in origin) via z-rotation and spherical angles: The orientation of the coordinate system results from the reference cs in 2 steps and this order (if inclinationFirst=false): (i) Rotation about z-axis with angle zeta - using the right-hand-rule (ii) Inclination of z-axis by spherical angles phi and theta or vice versa, if inclinationFirst=true: (i) Inclination of z-axis by spherical angles phi and theta (ii) Rotation about inclined z-axis by angle zeta - using the right-hand-rule

Parameters
originOrigin of coordinate system in reference coordinates.
zetaAngle (radian) of rotation about z-axis by using the right-hand-rule.
zPhiSpherical angle phi in radian for inclination of z-axis. This angle starts at the x-axis (zPhi = 0), while the y-axis corresponds to zPhi = 90°
zThetaSpherical angle theta in radian for inclination of z-axis.
inclinationFirstFlag to signal if z-axis is inclined first (true) or after rotation of z-axis (false). If true, parameter zAxisDefinedInRotatedSystem is ignored, as the z-axis must always be defined in the reference system, of course.
zAxisInclinatedInRotatedSystemIf false, the spherical angles describe the inclination of the z-axis in the reference coordinate system. If true, the spherical angles describe the inclination of the z-axis in the rotated coordinate system (rotation about z-axis by zeta).
Returns
New Cartesian coordinate system.
void GetGlobalTransformationParameters ( out Matrix3x3D  globalRotationMatrix,
out Vector3D  globalOriginPos 
)

Get the coordinate transformation parameters (rotation matrix and the origin position) with respect to the global coordinate system. A coordinate transformation from this cs (x') to the global cs (x) can be done by x = Rx' + o and vice versa: x' = R^T(x - o)

Parameters
globalRotationMatrixGlobal rotation matrix R.
globalOriginOrigin o of this coordinate system in global (absolute) coordinates.
CartesianCoordinateSystem GetRotatedAndTranslatedCoordinateSystem ( Vector3D  offset,
Matrix3x3D  rotation 
)

Returns a new coordinate system that is rotated and translated by given values in reference to this and defined in reference to this.

Parameters
offsetTranslation distance, defined in the external CS
rotationRotation matrix, defined in the external CS
Returns
The transformed coordinate system.
void GetRotationAsSphericalAnglesOfZAxis ( out double  theta,
out double  phi 
)

Gets the orientation of this by calculating the spere angles theta and phi for the z axis

Parameters
thetaSphere angle theta, i.e. the inclination of the z axis to the z axis of the reference CS.
phiSphere angle phi, i.e. the azimuth angle of the z axis to the x axis of the reference CS
void OnCoordinateSystemChanged ( )

Event throwing method

static bool operator!= ( CartesianCoordinateSystem  cs1,
CartesianCoordinateSystem  cs2 
)
static

Overloaded unequality operator

Parameters
pos1First CartesianCoordinateSystem to compare
pos2Second CartesianCoordinateSystem to compare
Returns
Are both CartesianCoordinateSystem unequal?
static bool operator== ( CartesianCoordinateSystem  cs1,
CartesianCoordinateSystem  cs2 
)
static

Overloaded equality operator

Parameters
pos1First CartesianCoordinateSystem to compare
pos2Second CartesianCoordinateSystem to compare
Returns
Are both CartesianCoordinateSystem equal?
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.

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).
static Matrix3x3D RotationMatrixForRotationAngle ( PhysicalValue  rotAngle)
static

Calculates the rotation matrix for a rotation about the x-, y-, or z-axis

Parameters
rotAngleA physical value that contains the rotation angle and the information (in the Comment), about what axis the rotation shall be done
Returns
The rotation matrix for the rotation about the desired axis.
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.
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.
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
void SetPositioningReference ( IProvidesPositioningReferences  referenceProvider,
string  key 
)

Method to set the PositioningReferenceProvider and the key for the coordinate system that serves as positioning reference

Parameters
referenceProviderObject which provides the coordinate system that serves as reference for this position.
keyKey for the coordinate system (contained by PositioningReferenceProvider) which shall serve as reference for this position
override string ToString ( )

method to generate a string description of the object

Returns
the string description
Vector3D TransformInternalPosition2PositionInReferenceCS ( Vector3D  internalPos)

Transforms a given position in this CS to the reference CS.

Parameters
internalPosPosition to transform
Returns
Transformed position in reference CS
Vector3D TransformPositionInReferenceCS2InternalPosition ( Vector3D  externalPos)

Transforms a given position from the reference coordinate system to this CS.

Parameters
externalPosPosition in the reference CS to transform
Returns
Transformed internal position

Property Documentation

SystemBaseVectors Axes
getset

Gets or sets the axes or base vectors of the coordinate system

CartesianCoordinateSystem GetPositioningReference
get

Property to get the coordinate system that serves as reference for this object

bool IsDefinedAbsolutely
get

Are the origin's position and the axes directions defined absolutely?

Position Origin
getset

Gets or sets the origin of the coordinate system

string PositioningReferenceKey
get

Get the key of the reference coordinate system for this

IProvidesPositioningReferences PositioningReferenceProvider
get

Get the object that provides the reference coordinate system for this

Event Documentation

EventHandler CoordinateSystemChanged

Event that is thrown if the Coordinate System is changed