is_equal -> is_colinear
This commit is contained in:
		@ -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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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)
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user