From 884055a181d2d52ac3f15887e4162657ff572c2d Mon Sep 17 00:00:00 2001 From: Richard Jones Date: Mon, 21 Aug 2023 20:11:19 +0100 Subject: [PATCH] add Rotation::from_sin_cos constructor (#130) Co-authored-by: Joona Aalto --- src/components/rotation.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/rotation.rs b/src/components/rotation.rs index b7911963..0743c754 100644 --- a/src/components/rotation.rs +++ b/src/components/rotation.rs @@ -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())