normalise can call (/)

This commit is contained in:
Edward Sankey 2023-03-29 09:40:07 +13:00
parent bf651862df
commit ce5d42de4e
1 changed files with 1 additions and 8 deletions

View File

@ -45,14 +45,7 @@ impl Tuple {
}
pub fn normalise(&self) -> Self {
let mag = self.magnitude();
tuple(
self.x / mag,
self.y / mag,
self.z / mag,
self.w / mag,
)
self / self.magnitude()
}
}