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
|
|
@ -43,6 +43,23 @@ TEST_CASE("C3Vector::operator*=", "[vector]") {
|
|||
}
|
||||
}
|
||||
|
||||
TEST_CASE("C3Vector::Mag", "[vector]") {
|
||||
SECTION("calculates mag") {
|
||||
auto vector = C3Vector(4.0f, 16.0f, 32.0f);
|
||||
REQUIRE(vector.Mag() == 36.0f);
|
||||
}
|
||||
|
||||
SECTION("calculates mag of C3Vector(0.0f, 0.0f, 0.0f)") {
|
||||
auto vector = C3Vector(0.0f, 0.0f, 0.0f);
|
||||
REQUIRE(vector.Mag() == 0.0f);
|
||||
}
|
||||
|
||||
SECTION("calculates mag of C3Vector(-4.0f, -16.0f, -32.0f)") {
|
||||
auto vector = C3Vector(-4.0f, -16.0f, -32.0f);
|
||||
REQUIRE(vector.Mag() == 36.0f);
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("C3Vector::SquaredMag", "[vector]") {
|
||||
SECTION("calculates squared mag") {
|
||||
auto vector = C3Vector(1.0f, 2.0f, 3.0f);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue