mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 06:16:04 +00:00
actually make Vec3::length sqrt
This commit is contained in:
parent
dbfbffac14
commit
804a9fd800
1 changed files with 1 additions and 1 deletions
|
@ -135,7 +135,7 @@ impl Vec3 {
|
|||
/// Get the distance of this vector to the origin by doing
|
||||
/// `sqrt(x^2 + y^2 + z^2)`.
|
||||
pub fn length(&self) -> f64 {
|
||||
self.x * self.x + self.y * self.y + self.z * self.z
|
||||
f64::sqrt(self.x * self.x + self.y * self.y + self.z * self.z)
|
||||
}
|
||||
|
||||
/// Get the squared distance from this position to another position.
|
||||
|
|
Loading…
Add table
Reference in a new issue