Classes (extension) | Libraries > Ambisonic Toolkit > Coefficients & Theory

HoaMatrixRotation : Object

Matrix transformer from the Ambisonic Toolkit (ATK)


A class to generate a matrix representing a rotation of real or complex spherical harmonics, around three axes, in a specified order of rotations.

Use of HoaMatrixXformer's various rotation methods, which use this class internally, is more convenient for most rotation operations and is advised. See HoaMatrixXformer: *newRotate, *newRTT, *newYPR, *newRotateAxis.

Class Methods

HoaMatrixRotation.new(r1: 0, r2: 0, r3: 0, axes: 'xyz', order)

Generate an HoaMatrixRotation



The first rotation angle, in radians.


The second rotation angle, in radians.


The third rotation angle, in radians.


A Symbol defining the order of rotations, by axis. E.g. 'zyz'.


Ambisonic order. Defaults to AtkHoa.defaultOrder.

Inherited class methods

Instance Methods


Return the Matrix object representing the rotation.


Return the Matrix representing the original 3x3 rotation of degree l = 1, which is then used to recursively build the full rotation matrix of higher order. The user will not typically need this rotation kernel, but is provided for introspection.


Return the ambisonic order of the rotation matrix.


Return a rotation Matrix of complex spherical harmonics.

Inherited instance methods


Test axial rotations via HoaMatrixXformer: -newRotateAxis(which uses HoaMatrixRotation internally).


The underlying utilities used here are largely a port of spherical harmonic rotations from Archontis Politis's Spherical-Harmonic-Transform Library for Matlab/Octave. 1 2

The technique was originally authored by Ivanic and Ruedenberg. 3 4

Politis's code for real SH rotations is itself a port of Bing Jian's implementations of the above technique. 5

[2] - Specifically: euler2rotationMatrix.m, getSHrotMtx.m, complex2realSHMtx.m
[3] - Ivanic, J., Ruedenberg, K. (1996). Rotation Matrices for Real Spherical Harmonics. Direct Determination by Recursion. The Journal of Physical Chemistry, 100(15), 6342-6347.
[4] - With corrections: Ivanic, J., Ruedenberg, K. (1998). Rotation Matrices for Real Spherical Harmonics. Direct Determination by Recursion Page: Additions and Corrections. Journal of Physical Chemistry A, 102(45), 9099-9100.