Use 'sq' macro where possible

This commit is contained in:
Scott Lahteine
2017-05-02 18:51:23 -05:00
parent 66eba3346b
commit b8ba3b7647
2 changed files with 7 additions and 7 deletions

View File

@ -63,7 +63,7 @@ vector_3 vector_3::get_normal() {
return normalized;
}
float vector_3::get_length() { return sqrt((x * x) + (y * y) + (z * z)); }
float vector_3::get_length() { return sqrt(sq(x) + sq(y) + sq(z)); }
void vector_3::normalize() {
const float inv_length = 1.0 / get_length();