AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
axom::numerics::transforms Namespace Reference

Functions

template<typename T = double>
Matrix< T > xRotation (double angleRad, int ndims=3)
 Return rotation matrix about X axis. More...
 
template<typename T = double>
Matrix< T > yRotation (double angleRad, int ndims=3)
 Return rotation matrix about Y axis. More...
 
template<typename T = double>
Matrix< T > zRotation (double angleRad, int ndims=3)
 Return rotation matrix about Z axis. More...
 
template<typename T = double>
Matrix< T > axisRotation (double angleRad, double x, double y, double z)
 Return 3D rotation matrix about specified axis. More...
 
template<typename T = double>
Matrix< T > translate (T tx, T ty)
 Return translation matrix. More...
 
template<typename T = double>
Matrix< T > translate (T tx, T ty, T tz)
 
template<typename T = double>
Matrix< T > scale (T s, int ndims=3)
 Return scaling matrix. More...
 
template<typename T = double>
Matrix< T > scale (T sx, T sy, T sz, int ndims=3)
 Return scaling matrix. More...
 
template<typename T = double>
Matrix< T > scale (T sx, T sy, int ndims=3)
 Return scaling matrix. More...
 
template<typename T = double>
Matrix< T > scale (T sx, T sy, const axom::ArrayView< T > &center)
 Return scaling matrix relative to a center point. More...
 
template<typename T = double>
Matrix< T > scale (T sx, T sy, T sz, const axom::ArrayView< T > &center)
 Return scaling matrix relative to a center point. More...
 

Function Documentation

◆ xRotation()

template<typename T = double>
Matrix<T> axom::numerics::transforms::xRotation ( double  angleRad,
int  ndims = 3 
)

Return rotation matrix about X axis.

Parameters
angleRadThe angle to rotate in radians.
ndimsThe number of dimension to make for the Matrix. It needs to be 3 or 4.
Returns
A Matrix containing the rotation transform.

References axom::numerics::Matrix< T >::identity().

◆ yRotation()

template<typename T = double>
Matrix<T> axom::numerics::transforms::yRotation ( double  angleRad,
int  ndims = 3 
)

Return rotation matrix about Y axis.

Parameters
angleRadThe angle to rotate in radians.
ndimsThe number of dimension to make for the Matrix. It needs to be 3 or 4.
Returns
A Matrix containing the rotation transform.

References axom::numerics::Matrix< T >::identity().

◆ zRotation()

template<typename T = double>
Matrix<T> axom::numerics::transforms::zRotation ( double  angleRad,
int  ndims = 3 
)

Return rotation matrix about Z axis.

Parameters
angleRadThe angle to rotate in radians.
ndimsThe number of dimension to make for the Matrix. It needs to be 2, 3, or 4.
Returns
A Matrix containing the rotation transform.

References axom::numerics::Matrix< T >::identity().

◆ axisRotation()

template<typename T = double>
Matrix<T> axom::numerics::transforms::axisRotation ( double  angleRad,
double  x,
double  y,
double  z 
)

Return 3D rotation matrix about specified axis.

Parameters
angleRadThe angle to rotate in radians.
x,y,zThe components of the axis of rotation

Formulation from https://en.wikipedia.org/wiki/Rotation_matrix#Axis_and_angle

Returns
A Matrix containing the rotation transform.

References axom::numerics::Matrix< T >::identity(), and axom::utilities::isNearlyEqual().

◆ translate() [1/2]

template<typename T = double>
Matrix<T> axom::numerics::transforms::translate ( tx,
ty 
)

Return translation matrix.

Parameters
txThe translation in x.
tyThe translation in y.
Returns
A Matrix containing the translation transform.

References axom::numerics::Matrix< T >::identity().

◆ translate() [2/2]

template<typename T = double>
Matrix<T> axom::numerics::transforms::translate ( tx,
ty,
tz 
)

◆ scale() [1/5]

template<typename T = double>
Matrix<T> axom::numerics::transforms::scale ( s,
int  ndims = 3 
)

Return scaling matrix.

Parameters
sThe scaling value.
ndimsThe number of dimension to make for the Matrix. It needs to be 2, 3, or 4.
Returns
A Matrix containing the scaling transform.

References axom::numerics::Matrix< T >::identity(), and axom::utilities::min().

◆ scale() [2/5]

template<typename T = double>
Matrix<T> axom::numerics::transforms::scale ( sx,
sy,
sz,
int  ndims = 3 
)

Return scaling matrix.

Parameters
sxThe scaling value in x.
syThe scaling value in y.
szThe scaling value in z.
ndimsThe number of dimension to make for the Matrix. It needs to be 2, 3, or 4.
Returns
A Matrix containing the scaling transform.

References axom::numerics::Matrix< T >::identity().

◆ scale() [3/5]

template<typename T = double>
Matrix<T> axom::numerics::transforms::scale ( sx,
sy,
int  ndims = 3 
)

Return scaling matrix.

Parameters
sxThe scaling value in x.
syThe scaling value in y.
ndimsThe number of dimension to make for the Matrix. It needs to be 2, 3, or 4.
Returns
A Matrix containing the scaling transform.

References scale().

◆ scale() [4/5]

template<typename T = double>
Matrix<T> axom::numerics::transforms::scale ( sx,
sy,
const axom::ArrayView< T > &  center 
)

Return scaling matrix relative to a center point.

Parameters
sxThe scaling value in x.
syThe scaling value in y.
centerThe center point.
Returns
A 3x3 Matrix containing the scaling transform.

References axom::utilities::isNearlyEqual(), axom::numerics::matrix_multiply(), scale(), axom::ArrayView< T, DIM, SPACE >::size(), and translate().

◆ scale() [5/5]

template<typename T = double>
Matrix<T> axom::numerics::transforms::scale ( sx,
sy,
sz,
const axom::ArrayView< T > &  center 
)

Return scaling matrix relative to a center point.

Parameters
sxThe scaling value in x.
syThe scaling value in y.
centerThe center point.
Returns
A 4x4 Matrix containing the scaling transform.

References axom::utilities::isNearlyEqual(), axom::numerics::matrix_multiply(), scale(), axom::ArrayView< T, DIM, SPACE >::size(), and translate().