def _rectForce(x,pot,t=0.):
    """
    NAME:
       _rectForce
    PURPOSE:
       returns the force in the rectangular frame
    INPUT:
       x - current position
       t - current time
       pot - (list of) Potential instance(s)
    OUTPUT:
       force
    HISTORY:
       2011-02-02 - Written - Bovy (NYU)
    """
    #x is rectangular so calculate R and phi
    R= nu.sqrt(x[0]**2.+x[1]**2.)
    phi= nu.arccos(x[0]/R)
    sinphi= x[1]/R
    cosphi= x[0]/R
    if x[1] < 0.: phi= 2.*nu.pi-phi
    #calculate forces
    Rforce= _evaluateplanarRforces(pot,R,phi=phi,t=t)
    phiforce= _evaluateplanarphiforces(pot,R,phi=phi,t=t)
    return nu.array([cosphi*Rforce-1./R*sinphi*phiforce,
                     sinphi*Rforce+1./R*cosphi*phiforce])
def _rectForce ( x , pot , t = 0. ) : R = nu . sqrt ( x [ 0 ] ** 2. + x [ 1 ] ** 2. ) phi = nu . arccos ( x [ 0 ] / R ) sinphi = x [ 1 ] / R cosphi = x [ 0 ] / R if x [ 1 ] < 0. : phi = 2. * nu . pi - phi Rforce = _evaluateplanarRforces ( pot , R , phi = phi , t = t ) phiforce = _evaluateplanarphiforces ( pot , R , phi = phi , t = t ) return nu . array ( [ cosphi * Rforce - 1. / R * sinphi * phiforce , sinphi * Rforce + 1. / R * cosphi * phiforce ] )
NAME:
       _rectForce
    PURPOSE:
       returns the force in the rectangular frame
    INPUT:
       x - current position
       t - current time
       pot - (list of) Potential instance(s)
    OUTPUT:
       force
    HISTORY:
       2011-02-02 - Written - Bovy (NYU)