mirror of
https://github.com/thunderbrewhq/typhoon.git
synced 2025-12-12 02:22:30 +00:00
feat(vector): add C3Vector::Mag
This commit is contained in:
parent
6c1bd11811
commit
e38af58adb
3 changed files with 23 additions and 0 deletions
|
|
@ -1,4 +1,5 @@
|
|||
#include "tempest/vector/C3Vector.hpp"
|
||||
#include "tempest/Math.hpp"
|
||||
|
||||
C3Vector& C3Vector::operator*=(float a) {
|
||||
this->x *= a;
|
||||
|
|
@ -8,6 +9,10 @@ C3Vector& C3Vector::operator*=(float a) {
|
|||
return *this;
|
||||
}
|
||||
|
||||
float C3Vector::Mag() const {
|
||||
return CMath::sqrt(this->SquaredMag());
|
||||
}
|
||||
|
||||
float C3Vector::SquaredMag() const {
|
||||
return this->x * this->x + this->y * this->y + this->z * this->z;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue