[FEAT] Tuple add negative
This commit is contained in:
@@ -120,3 +120,22 @@ TEST_CASE("Subtracting two vectors", "[Tuple][Operations]")
|
||||
|
||||
REQUIRE((v1 - v2) == Tuple::Vector(-2, -4, -6));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
TEST_CASE("Subtracting a vector from the zero vector", "[Tuple][Operations]")
|
||||
{
|
||||
Tuple zero = Tuple::Vector(0, 0, 0);
|
||||
Tuple v = Tuple::Vector(1, -2, 3);
|
||||
|
||||
REQUIRE((zero - v) == Tuple::Vector(-1, 2, -3));
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------- */
|
||||
|
||||
TEST_CASE("Negative a tuple", "[Tuple][Operations]")
|
||||
{
|
||||
Tuple a(1, -2, 3, -4);
|
||||
|
||||
REQUIRE(-a == Tuple(-1, 2, -3, 4));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user