def _ellipticJi(u, v, m): # Ignoring special cases for now. # u=0: (1j*b[0]/b[1], 1/b[1], b[2]/b[1]) # v=0: (a[0], a[1], a[2]) a = ellipticJ(u, m) b = ellipticJ(v, 1 - m) c = b[1]**2 + m * (a[0] * b[0])**2 return [ (a[0] * b[2] / c) + 1j * (a[1] * a[2] * b[0] * b[1] / c), (a[1] * b[1] / c) + 1j * (-a[0] * a[2] * b[0] * b[2] / c), (a[2] * b[1] * b[2] / c) + 1j * (-m * a[0] * a[1] * b[0] / c), ]
def _ellipticJi_imag(v, m): sn, cn, dn, phi = ellipticJ(v, 1 - m) return 1j * sn / cn, 1 / cn, dn / cn
def _ellipticJi_real(u, m): sn, cn, dn, phi = ellipticJ(u, m) return sn, cn, dn