I'm interested in using a pow/exponent function on the Quaternion type to concisely represent repeated rotations. For quaternions specifically, I found an algorithm for this on the Mathematics StackExchange. However, this concept also applies to other representations of rotations, so it may be more appropriate to add it to the Rotation trait with an implementation for each implementing type. I'd be willing to help implement this functionality for an eventual PR, but wanted feedback on its design before starting.
Example public api:
pub trait Rotation: Sized + Copy + One
//where ...
{
// Other functions...
/// Create a new rotation representing `exponent` copies of the original rotation
fn pow(&self, exponent: <Self::Space as EuclideanSpace>::Scalar) -> Self;
/// Modifies this rotation to represent `exponent` copies of the original rotation
fn pow_assign(&mut self, exponent: <Self::Space as EuclideanSpace>::Scalar);
}
I'm interested in using a pow/exponent function on the Quaternion type to concisely represent repeated rotations. For quaternions specifically, I found an algorithm for this on the Mathematics StackExchange. However, this concept also applies to other representations of rotations, so it may be more appropriate to add it to the Rotation trait with an implementation for each implementing type. I'd be willing to help implement this functionality for an eventual PR, but wanted feedback on its design before starting.
Example public api: