code: def spherical_to_vector(spherical):
      
      spherical = np.asanyarray(spherical, dtype=np.float64)
      if not is_shape(spherical, (-1, 2)):
          raise ValueError('spherical coordinates must be (n, 2)!')
  
      theta, phi = spherical.T
      st, ct = np.sin(theta), np.cos(theta)
      sp, cp = np.sin(phi), np.cos(phi)
      vectors = np.column_stack((ct * sp,
                                 st * sp,
                                 cp))
      return vectors
docs: Convert a set of (n,2) spherical vectors to (n,3) vectors
  
      Parameters
      -----------
      spherical : (n , 2) float
         Angles, in radians
  
      Returns
      -----------
      vectors : (n, 3) float
        Unit vectors