text: """Distance on a circle"""
  
  import numpy as np
  
  
  def circle_dist(lat1, lng1, lat2, lng2):
      """
      Distance on a circle (in km)
  
      Parameters
      ----------
      lat1, lng1, lat2, lng2: float or array of float
  
      Returns
      -------
      distance:
        distance from ``(lat1, lng1)`` to ``(lat2, lng2)`` in kilometers.
      """
      phi1 = np.deg2rad(90 - lat1)
      phi2 = np.deg2rad(90 - lat2)
  
      theta1 = np.deg2rad(lng1)
      theta2 = np.deg2rad(lng2)
  
      cos = (np.sin(phi1) * np.sin(phi2) * np.cos(theta1 - theta2) +
             np.cos(phi1) * np.cos(phi2))
      arc = np.arccos(cos)
      return arc * 6373  # Earth radius in km
  