mirror of
https://github.com/hannobraun/Fornjot
synced 2025-11-29 10:52:58 +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())
|
.unwrap_or(Scalar::zero())
|
||||||
.sqrt()
|
.sqrt()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unused)] // code to use it is being worked on
|
||||||
|
pub fn normalize(self) -> Self {
|
||||||
|
self / self.magnitude()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Vector<3> {
|
impl Vector<3> {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user