(theta, phi, lonlat=False)
return np.array([sintheta * np.cos(phi), sintheta * np.sin(phi), np.cos(theta)]).T
ang2vec : convert angles to 3D position vector

    Parameters
    ----------
    theta : float, scalar or arry-like
      colatitude in radians measured southward from north pole (in [0,pi]).
    phi : float, scalar or array-like
      longitude in radians measured eastward (in [0, 2*pi]).
    lonlat : bool
      If True, input angles are assumed to be longitude and latitude in degree,
      otherwise, they are co-latitude and longitude in radians.

    Returns
    -------
    vec : float, array
      if theta and phi are vectors, the result is a 2D array with a vector per row
      otherwise, it is a 1D array of shape (3,)

    See Also
    --------
    vec2ang, rotator.dir2vec, rotator.vec2dir
ang2vec : convert angles to 3D position vector
ang2vec : convert angles to 3D position vector
def ang2vec(theta, phi, lonlat=False):
    """ang2vec : convert angles to 3D position vector

    Parameters
    ----------
    theta : float, scalar or arry-like
      colatitude in radians measured southward from north pole (in [0,pi]).
    phi : float, scalar or array-like
      longitude in radians measured eastward (in [0, 2*pi]).
    lonlat : bool
      If True, input angles are assumed to be longitude and latitude in degree,
      otherwise, they are co-latitude and longitude in radians.

    Returns
    -------
    vec : float, array
      if theta and phi are vectors, the result is a 2D array with a vector per row
      otherwise, it is a 1D array of shape (3,)

    See Also
    --------
    vec2ang, rotator.dir2vec, rotator.vec2dir
    """
    if lonlat:
        theta, phi = lonlat2thetaphi(theta, phi)
    check_theta_valid(theta)
    sintheta = np.sin(theta)
    return np.array([sintheta * np.cos(phi), sintheta * np.sin(phi), np.cos(theta)]).T
def ang2vec ( theta , phi , lonlat = False ) : if lonlat : theta , phi = lonlat2thetaphi ( theta , phi ) check_theta_valid ( theta ) sintheta = np . sin ( theta ) return np . array ( [ sintheta * np . cos ( phi ) , sintheta * np . sin ( phi ) , np . cos ( theta ) ] ) . T