pynbody.analysis.angmom.calc_faceon_matrix#
- pynbody.analysis.angmom.calc_faceon_matrix(angmom_vec, up=[0.0, 1.0, 0.0])[source]#
Calculate the rotation matrix to put the specified angular momentum vector face-on.
The rotation matrix is calculated such that the angular momentum vector will be placed in the z direction post-transformation.
- Parameters:
angmom_vec (array_like) – The angular momentum vector that will be placed in the z-direction post-transformation.
up (array_like) – An additional orientation vector. The components of this vector perpendicular to angmom_vec defines the direction to transform to ‘up’, i.e. to the positive y-axis post-transformation.
- Returns:
The rotation matrix
- Return type:
array_like