Function qsym2::angmom::sh_rotation_3d::rmat

source ·
pub fn rmat(angle: f64, axis: Vector3<f64>) -> Array2<f64>
Expand description

Returns the representation matrix $\mathbf{R}$ for a rotation in the basis of the coordinate functions $(y, z, x)$.

Let $\hat{R}(\phi, \hat{\mathbf{n}})$ be a rotation parametrised by the angle $\phi$ and axis $\hat{\mathbf{n}}$. The corresponding representation matrix $\mathbf{R}(\phi, \hat{\mathbf{n}})$ is defined as

\hat{R}(\phi, \hat{\mathbf{n}})\ (y, z, x)
= (y, z, x) \mathbf{R}(\phi, \hat{\mathbf{n}})

See Section 2-4 of Altmann, S. L. Rotations, Quaternions, and Double Groups. (Dover Publications, Inc., 2005) for a detailed discussion on how $(y, z, x)$ should be considered as coordinate functions.

§Arguments

  • angle - The angle $\phi$ of the rotation in radians. A positive rotation is an anticlockwise rotation when looking down axis.
  • axis - A space-fixed vector defining the axis of rotation. The supplied vector will be normalised.

§Returns

The representation matrix $\mathbf{R}(\phi, \hat{\mathbf{n}})$.

§Panics

Panics when a three-dimensional rotation matrix cannot be constructed for angle and axis.