#NEWLINE# def angular_momentum( point , frame , * body ) : #NEWLINE# #INDENT# "Angular momentum of a system\n\n    This function returns the angular momentum of a system of Particle's and/or\n    RigidBody's. The angular momentum of such a system is equal to the vector\n    sum of the angular momentum of its constituents. Consider a system, S,\n    comprised of a rigid body, A, and a particle, P. The angular momentum of\n    the system, H, is equal to the vector sum of the angular momentum of the\n    particle, H1, and the angular momentum of the rigid body, H2, i.e.\n\n    H = H1 + H2\n\n    Parameters\n    ==========\n\n    point : Point\n        The point about which angular momentum of the system is desired.\n    frame : ReferenceFrame\n        The frame in which angular momentum is desired.\n    body1, body2, body3... : Particle and/or RigidBody\n        The body (or bodies) whose angular momentum is required.\n\n    Examples\n    ========\n\n    >>> from sympy.physics.mechanics import Point, Particle, ReferenceFrame\n    >>> from sympy.physics.mechanics import RigidBody, outer, angular_momentum\n    >>> N = ReferenceFrame('N')\n    >>> O = Point('O')\n    >>> O.set_vel(N, 0 * N.x)\n    >>> P = O.locatenew('P', 1 * N.x)\n    >>> P.set_vel(N, 10 * N.x)\n    >>> Pa = Particle('Pa', P, 1)\n    >>> Ac = O.locatenew('Ac', 2 * N.y)\n    >>> Ac.set_vel(N, 5 * N.y)\n    >>> a = ReferenceFrame('a')\n    >>> a.set_ang_vel(N, 10 * N.z)\n    >>> I = outer(N.z, N.z)\n    >>> A = RigidBody('A', Ac, a, 20, (I, Ac))\n    >>> angular_momentum(O, N, Pa, A)\n    10*N.z\n\n    " #NEWLINE# if ( not isinstance ( point , ReferenceFrame ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Please enter a valid ReferenceFrame' ) #NEWLINE# #UNINDENT# if ( not isinstance ( point , Point ) ) : #NEWLINE# #INDENT# raise TypeError ( 'Please specify a valid Point' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# angular_momentum_sys = Vector ( 0 ) #NEWLINE# for e in body : #NEWLINE# #INDENT# if isinstance ( e , ( RigidBody , Particle ) ) : #NEWLINE# #INDENT# angular_momentum_sys += e . angular_momentum ( point , frame ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( '*body must have only Particle or RigidBody' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return angular_momentum_sys