def test_angle(): a = Vector(1,0,1) b = Vector(1,0,0) A = np.array(a) B = np.array(b) # Test for single vector pair assert(angle(A,B) == a.angle(b)) AA = np.tile(A, (10,5,1)) BB = np.tile(B, (10,5,1)) # Test at higher-dimensions assert(np.all( angle(AA,BB) == a.angle(b) ))
def test_angle(): a = Vector(1, 0, 1) b = Vector(1, 0, 0) A = np.array(a) B = np.array(b) # Test for single vector pair assert (angle(A, B) == a.angle(b)) AA = np.tile(A, (10, 5, 1)) BB = np.tile(B, (10, 5, 1)) # Test at higher-dimensions assert (np.all(angle(AA, BB) == a.angle(b)))
def test_vector_angle(): v1 = Vector([1, 0, 0]) v2 = Vector([0, 1, 0]) assert math.isclose(v1.angle(v2), math.pi / 2, rel_tol=1e-04)