def roots_sh_legendre(n, mu=False):
 (x, w) = roots_legendre(n)
 x = ((x + 1) / 2)
 w /= 2
 if mu:
  return (x, w, 1.0)
 else:
  return (x, w)

def roots_sh_legendre ( n , mu = False ) : ( x , w ) = roots_legendre ( n ) x = ( ( x + 1 ) / 2 ) w /= 2 if mu : return ( x , w , 1.0 ) else : return ( x , w )
gauss-legendre quadrature .