def test_linear_momentum():
    N = ReferenceFrame('N')
    Ac = Point('Ac')
    Ac.set_vel(N, (25 * N.y))
    I = outer(N.x, N.x)
    A = RigidBody('A', Ac, N, 20, (I, Ac))
    P = Point('P')
    Pa = Particle('Pa', P, 1)
    Pa.point.set_vel(N, (10 * N.x))
    raises(TypeError, (lambda : linear_momentum(A, A, Pa)))
    raises(TypeError, (lambda : linear_momentum(N, N, Pa)))
    assert (linear_momentum(N, A, Pa) == ((10 * N.x) + (500 * N.y)))
def test_linear_momentum():
    N = ReferenceFrame('N')
    Ac = Point('Ac')
    Ac.set_vel(N, (25 * N.y))
    I = outer(N.x, N.x)
    A = RigidBody('A', Ac, N, 20, (I, Ac))
    P = Point('P')
    Pa = Particle('Pa', P, 1)
    Pa.point.set_vel(N, (10 * N.x))
    raises(TypeError, (lambda : linear_momentum(A, A, Pa)))
    raises(TypeError, (lambda : linear_momentum(N, N, Pa)))
    assert (linear_momentum(N, A, Pa) == ((10 * N.x) + (500 * N.y)))