nyx_space::utils

Function r2

source
pub fn r2(angle_rad: f64) -> Matrix3<f64>
Expand description

Returns a rotation matrix for a rotation about the Y axis.

§Arguments

  • angle - The angle of rotation in radians.

§Warning

This function returns a matrix for a COORDINATE SYSTEM rotation by angle_rad radians. When this matrix is applied to a vector, it rotates the vector by -angle_rad radians, not angle_rad radians. Applying the matrix to a vector yields the vector’s representation relative to the rotated coordinate system.

§Example

use nyx_space::utils::r2;

let angle_rad = std::f64::consts::PI / 2.0;
let rotation_matrix = r2(angle_rad);

§Source

NAIF SPICE Toolkit