Skip to content

Commit

Permalink
Merge branch 'feature/vector-plane-class' of github.com:cwapi3d/cwmat…
Browse files Browse the repository at this point in the history
…h into feature/vector-plane-class
  • Loading branch information
jspaquet committed Mar 13, 2024
2 parents 8bb863e + ac42e66 commit 39cd575
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/cwmath/tests/test_cwvector3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@ def test_dot_product(vector_1, vector_2):
assert result == 32


def test_magnitude(vector_1, vector_2):
def test_magnitude(vector_1):
result = vector_1.magnitude()
assert result == approx(3.7416573867739413)


def test_normalization(vector_1, vector_2):
def test_normalization(vector_1):
result = vector_1.normalize()
assert result == cwvector3d.CwVector3d(0.2672612419124244, 0.5345224838248488, 0.8017837257372732)


def test_normalization_magnitude(vector_1, vector_2):
def test_normalization_magnitude(vector_1):
result = vector_1.normalize().magnitude()
assert result == approx(1.0)


def test_normalization_direction(vector_1, vector_2):
def test_normalization_direction():
start_pt = cwvector3d.CwVector3d(0, 0, 100)
end_pt = cwvector3d.CwVector3d(0, 0, 0)
result = (end_pt - start_pt).normalize()
Expand All @@ -51,17 +51,17 @@ def test_subtraction(vector_1, vector_2):
assert result == cwvector3d.CwVector3d(-3, -3, -3)


def test_scalar_multiplication(vector_1, vector_2):
def test_scalar_multiplication(vector_1):
result = vector_1 * 2
assert result == cwvector3d.CwVector3d(2, 4, 6)


def test_scalar_division(vector_1, vector_2):
def test_scalar_division(vector_1):
result = vector_1 / 2
assert result == cwvector3d.CwVector3d(0.5, 1, 1.5)


def test_negation(vector_1, vector_2):
def test_negation(vector_1):
result = -vector_1
assert result == cwvector3d.CwVector3d(-1, -2, -3)

Expand All @@ -71,12 +71,12 @@ def test_equality(vector_1, vector_2):
assert vector_1 != vector_2


def test_string_representation(vector_1, vector_2):
def test_string_representation(vector_1):
result = str(vector_1)
assert result, "(1, 2, 3)"


def test_indexing(vector_1, vector_2):
def test_indexing(vector_1):
assert vector_1[0] == 1
assert vector_1[1] == 2
assert vector_1[2] == 3
Expand Down

0 comments on commit 39cd575

Please sign in to comment.