mirror of
https://github.com/hannobraun/Fornjot
synced 2025-11-28 10:22:19 +00:00
Add Vector::normalize
This commit is contained in:
parent
30fbe3e2e9
commit
5778366e00
@ -19,6 +19,11 @@ impl<const D: usize> Vector<D> {
|
||||
.unwrap_or(Scalar::zero())
|
||||
.sqrt()
|
||||
}
|
||||
|
||||
#[allow(unused)] // code to use it is being worked on
|
||||
pub fn normalize(self) -> Self {
|
||||
self / self.magnitude()
|
||||
}
|
||||
}
|
||||
|
||||
impl Vector<3> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user