MoorDyn
Macros | Functions
3D transformations

Macros

#define MAKE_EULER_ROT(a, b, c)
 Create the Euler rotations, like RotXYZ, RotXZX, RotZYX... More...
 

Functions

moordyn::real moordyn::unitvector (vec &u, const vec &r1, const vec &r2)
 Normalized direction vector. More...
 
template<typename T >
void moordyn::scalevector (const vec &u, T newlength, vec &y)
 Compute a vector with the same direction but different length. More...
 
mat moordyn::getH (vec r)
 Produce alternator matrix. More...
 
mat6 moordyn::translateMass (vec r, mat M)
 Compute the mass matrix on an offset point. More...
 
mat6 moordyn::translateMass6 (vec r, mat6 M)
 Compute the mass matrix on an offset point. More...
 
mat moordyn::rotateMass (mat R, mat M)
 rotation to a 3x3 mass matrix or any other second order tensor More...
 
mat6 moordyn::rotateMass6 (mat R, mat6 M)
 rotation to a 6x6 mass/inertia tensor More...
 
void moordyn::transformKinematics (const vec &rRelBody, const mat &M, const vec &r, const vec6 &rd, vec &rOut, vec &rdOut)
 calculate position and velocity of point based on its position relative to moving 6DOF body More...
 
mat moordyn::RotX (real rads)
 Rotation matrix around x axis. More...
 
mat moordyn::RotY (real rads)
 Rotation matrix around y axis. More...
 
mat moordyn::RotZ (real rads)
 Rotation matrix around z axis. More...
 
std::pair< real, realmoordyn::orientationAngles (vec q)
 Get the spherical angles for a vector. More...
 
moordyn::real moordyn::GetCurvature (moordyn::real length, const vec &q1, const vec &q2)
 Convenience function to calculate curvature based on adjacent segments' direction vectors and their combined length. More...
 

Detailed Description

Macro Definition Documentation

◆ MAKE_EULER_ROT

#define MAKE_EULER_ROT (   a,
  b,
 
)
Value:
inline mat Rot ## a ## b ## c(real a1, real a2, real a3) \
{ \
return Rot ## a (a1) * Rot ## b (a2) * Rot ## c (a3); \
} \
inline mat Rot ## a ## b ## c(vec rads) \
{ \
return Rot ## a ## b ## c (rads[0], rads[1], rads[2]); \
}
mat3 mat
mat3 renaming
Definition: Misc.hpp:142

Create the Euler rotations, like RotXYZ, RotXZX, RotZYX...

Function Documentation

◆ GetCurvature()

moordyn::real moordyn::GetCurvature ( moordyn::real  length,
const vec q1,
const vec q2 
)

Convenience function to calculate curvature based on adjacent segments' direction vectors and their combined length.

Parameters
lengthThe length of the 2 segments
q1First direction vector
q2Second direction vector
Returns
The curvature
Here is the caller graph for this function:

◆ getH()

mat moordyn::getH ( vec  r)
inline

Produce alternator matrix.

This is the cross product represented as a matrix r x a = getH(r) * a

See "anti-symmetric tensor components" from Sadeghi and Incecik

Parameters
rOffset vector
Returns
Alternator matrix
Here is the caller graph for this function:

◆ orientationAngles()

std::pair< real, real > moordyn::orientationAngles ( vec  q)

Get the spherical angles for a vector.

Parameters
qThe vector
Returns
The orientation angles, i.e. inclination (from the horizontal plane) and heading (in radians)
Exceptions
nan_errorIf the provided vector is too small or null
Here is the caller graph for this function:

◆ rotateMass()

mat moordyn::rotateMass ( mat  R,
mat  M 
)
inline

rotation to a 3x3 mass matrix or any other second order tensor

$ M^{*} = R \cdot M \cdot R^T $

Parameters
RRotation matrix
MMass matrix
Returns
Rotated mass
Here is the caller graph for this function:

◆ rotateMass6()

mat6 DECLDIR moordyn::rotateMass6 ( mat  R,
mat6  M 
)

rotation to a 6x6 mass/inertia tensor

see Sadeghi and Incecik 2005 for theory

Parameters
RRotation matrix
MMass & Inertia matrix
Returns
Rotated mass
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RotX()

mat moordyn::RotX ( real  rads)
inline

Rotation matrix around x axis.

Parameters
radsThe angle in radians
Returns
The rotation matrix

◆ RotY()

mat moordyn::RotY ( real  rads)
inline

Rotation matrix around y axis.

Parameters
radsThe angle in radians
Returns
The rotation matrix
Here is the caller graph for this function:

◆ RotZ()

mat moordyn::RotZ ( real  rads)
inline

Rotation matrix around z axis.

Parameters
radsThe angle in radians
Returns
The rotation matrix
Here is the caller graph for this function:

◆ scalevector()

template<typename T >
void moordyn::scalevector ( const vec u,
newlength,
vec y 
)
inline

Compute a vector with the same direction but different length.

Parameters
uThe input vector
newlengthThe new length of the output vector
yThe output vector
Note
If the input vector has null length, the output vector will as well, no matter newlength is provided
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transformKinematics()

void moordyn::transformKinematics ( const vec rRelBody,
const mat M,
const vec r,
const vec6 rd,
vec rOut,
vec rdOut 
)

calculate position and velocity of point based on its position relative to moving 6DOF body

Parameters
rRelBodyThe point in the body local system of reference
MThe rotation matrix
rThe position of the local system origin
rdThe velocity of the local system origin
rOutThe output position with respect the global system of reference
rdOutThe output velocity with respect the global system of reference
Here is the caller graph for this function:

◆ translateMass()

mat6 DECLDIR moordyn::translateMass ( vec  r,
mat  M 
)

Compute the mass matrix on an offset point.

Parameters
rOffset
MMass matrix
Returns
Translated Mass & Inertia matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ translateMass6()

mat6 DECLDIR moordyn::translateMass6 ( vec  r,
mat6  M 
)

Compute the mass matrix on an offset point.

Parameters
rOffset
MMass & Inertia matrix
Returns
Translated Mass & Inertia matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ unitvector()

moordyn::real moordyn::unitvector ( vec u,
const vec r1,
const vec r2 
)
inline

Normalized direction vector.

Parameters
uThe output normalized direction vector
r1The orig point
r2The dest point
Returns
The distance between the points
Here is the call graph for this function:
Here is the caller graph for this function: