is_equal -> is_colinear

This commit is contained in:
Matt Low 2020-11-15 18:56:13 +04:00
parent b7475a44f2
commit 36ce94d3de
2 changed files with 4 additions and 5 deletions

View File

@ -76,7 +76,7 @@ class SeparatingAxisTheorem:
def add_if_not_exists(normal):
for existing in normals:
if is_equal(*existing, *normal):
if is_colinear(*existing, *normal):
return
normals.append(normal)

View File

@ -58,8 +58,7 @@ def vmax(x1, y1, x2, y2):
return max(x1, x2), max(y1, y2)
def is_equal(x1, y1, x2, y2):
"""Returns true if two unit vectors are pointed in either the same or
opposite directions.
"""
def is_colinear(x1, y1, x2, y2):
"""Returns whether two unit vectors are pointed in the same or
opposite directions."""
return math.isclose(abs(dot(x1, y1, x2, y2)), 1, rel_tol=1e-05)