1
2
Fork 0
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:
mat 2023-06-14 23:50:21 -05:00
parent dbfbffac14
commit 804a9fd800

View file

@ -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.