A method of rotation.

construct right-handed rotations about given axes.

Syntax

rot = rotation.byAxisAngle(v, omega)
rot = rotation.byAxisAngle(vector3d.Z, 30*degree)
rot = rotation.byAxisAngle(axis, angles)

Description

Angles are in radians and broadcast with the axes. Each nonzero axis is normalised internally, so its length does not change the rotation angle.

Input

v vector3d or Cartesian coordinates of shape (…, 3)
omega rotation angles in radians

Output

rot rotation container with the broadcast shape

Example

Rotate the x direction by 90 degrees about z, then apply the inverse rotation. The axis sets the direction of rotation; its length is immaterial.

import numpy as np
from mtex import rotation, vector3d, degree, inv

rot = rotation.byAxisAngle(vector3d.Z, 90*degree)
v = vector3d.X
turned = rot * v
recovered = inv(rot) * turned
print('Rotated x:', np.round(turned.data, 6))
print('Recovered x:', np.round(recovered.data, 6))

This is an active, right-handed rotation: positive x moves toward positive y.

Rotated x: [0. 1. 0.]
Recovered x: [1. 0. 0.]

See also

rotation.axis, rotation.angle, rotation.byEuler

Signature

rotation.byAxisAngle(v, omega)

MATLAB’s rotation.byAxisAngle

source

Citing this page. This page is part of the documentation of MTEX, a free and open source MATLAB toolbox for analyzing and modeling crystallographic textures. It was written by The MTEX Developers and is published at https://mtex-toolbox.github.io/rotation.byAxisAngle_py.html. If you use MTEX, or reuse text or figures from this page, in your research, please cite

F. Bachmann, R. Hielscher, H. Schaeben: Texture Analysis with MTEX - Free and Open Source Software Toolbox, Solid State Phenomena 160 (2010), 63-68. 10.4028/www.scientific.net/SSP.160.63

BibTeX
@article{bachmann2010mtex,
  author  = {F. Bachmann and R. Hielscher and H. Schaeben},
  title   = {Texture Analysis with MTEX - Free and Open Source Software Toolbox},
  journal = {Solid State Phenomena},
  volume  = {160},
  pages   = {63-68},
  year    = {2010},
  doi     = {10.4028/www.scientific.net/SSP.160.63},
  url     = {https://doi.org/10.4028/www.scientific.net/SSP.160.63}
}

Other papers describing specific MTEX methods are listed under Publications — please cite the one that best fits your application. The MTEX source code is licensed under the GNU General Public License v2.0; the text and figures of this documentation are licensed under CC BY 4.0, which permits reuse — including by automated systems — provided The MTEX Developers and this page are credited.