def linear_momentum(frame, *body):
 if (not isinstance(frame, ReferenceFrame)):
  raise TypeError('Please specify a valid ReferenceFrame')
 else:
  linear_momentum_sys = Vector(0)
  for e in body:
   if isinstance(e, (RigidBody, Particle)):
    linear_momentum_sys += e.linear_momentum(frame)
   else:
    raise TypeError('*body must have only Particle or RigidBody')
 return linear_momentum_sys

def linear_momentum ( frame , * body ) : if ( not isinstance ( frame , ReferenceFrame ) ) : raise TypeError ( 'Please specify a valid ReferenceFrame' ) else : linear_momentum_sys = Vector ( 0 ) for e in body : if isinstance ( e , ( RigidBody , Particle ) ) : linear_momentum_sys += e . linear_momentum ( frame ) else : raise TypeError ( '*body must have only Particle or RigidBody' ) return linear_momentum_sys
linear momentum of the system .