diff --git a/experiments/2024-12-09/src/math/vector.rs b/experiments/2024-12-09/src/math/vector.rs index 4687721ea..e141e5960 100644 --- a/experiments/2024-12-09/src/math/vector.rs +++ b/experiments/2024-12-09/src/math/vector.rs @@ -39,3 +39,22 @@ where Self { components } } } + +impl ops::Mul for Vector +where + S: Into, +{ + type Output = Self; + + fn mul(self, scalar: S) -> Self::Output { + let scalar = scalar.into(); + + let components = self + .components + .into_iter_fixed() + .map(|v| v * scalar) + .collect(); + + Self { components } + } +}