pynbody.analysis.angmom.calc_sideon_matrix

pynbody.analysis.angmom.calc_sideon_matrix#

pynbody.analysis.angmom.calc_sideon_matrix(angmom_vec, along=[1.0, 0.0, 0.0])[source]#

Calculate the rotation matrix to put the specified angular momentum vector side-on.

The rotation matrix is calculated such that the angular momentum vector will be placed in the y direction post-transformation.

Parameters:
  • angmom_vec (array_like) – The angular momentum vector that will be placed in the y-direction post-transformation.

  • along (array_like) – An additional orientation vector. The components of this vector perpendicular to angmom_vec defines the direction to transform to ‘along’, i.e. to the positive x-axis post-transformation.

Returns:

The rotation matrix

Return type:

array_like