Skip to content

Commit

Permalink
add Rotation::from_sin_cos constructor (#130)
Browse files Browse the repository at this point in the history
Co-authored-by: Joona Aalto <[email protected]>
  • Loading branch information
RJ and Jondolf authored Aug 21, 2023
1 parent ac7f693 commit 884055a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/rotation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ impl Rotation {
}
}

/// Creates a [`Rotation`] from the sine and cosine of an angle in radians.
pub fn from_sin_cos(sin: Scalar, cos: Scalar) -> Self {
Self { sin, cos }
}

/// Creates a [`Rotation`] from degrees.
pub fn from_degrees(degrees: Scalar) -> Self {
Self::from_radians(degrees.to_radians())
Expand Down

0 comments on commit 884055a

Please sign in to comment.