title: How to draw a circle through two points (at diameter end)?
body: <p>There are two points on the stereographic projection as shown in the figure:</p>
  
  <p><a href="https://i.stack.imgur.com/s36jx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s36jx.png" alt="enter image description here"></a></p>
  
  <p>These points are supposed to be on the end points of a dimeter of a circle. How to draw a circle passing through these two points?</p>
  
  <p>Code for the above plot:</p>
  
  <pre><code>import matplotlib.pylab as plt
  from mpl_toolkits.basemap import Basemap
  import numpy as np
  from scipy.interpolate import splev, splrep
  
  # create instance of basemap, note we want a south polar projection to 90 = E
  myMap = Basemap(projection='spstere',boundinglat=0,lon_0=180,resolution='l',round=True,suppress_ticks=True)
  # set the grid up
  gridX, gridY = 10.0, 15.0
  parallelGrid = np.arange(-90.0,90.0,gridX)
  meridianGrid = np.arange(-180.0,180.0,gridY)
  
  # draw parallel and meridian grid, not labels are off. We have to manually create these.
  myMap.drawparallels(parallelGrid,labels=[False,False,False,False])
  myMap.drawmeridians(meridianGrid,labels=[False,False,False,False],labelstyle='+/-',fmt='%i')
  
  
  # plot azimuth labels, with a North label.
  ax = plt.gca()
  ax.text(0.5,1.025,'N',transform=ax.transAxes,horizontalalignment='center',verticalalignment='bottom',size=25)
  for para in np.arange(gridY,360,gridY):
      x= (1.1*0.5*np.sin(np.deg2rad(para)))+0.5
      y= (1.1*0.5*np.cos(np.deg2rad(para)))+0.5
      ax.text(x,y,u'%i\N{DEGREE SIGN}'%para,transform=ax.transAxes,horizontalalignment='center',verticalalignment='center')
  
  summerAzi = np.array([0, 360])
  summerAlt = np.array([40, 4])
  summerX, summerY = myMap(summerAzi, -summerAlt)
  
  
  summerX_new = np.linspace(summerX.min(), summerX.max(),30)
  summerY_smooth = splev(summerX_new, splrep(summerX, summerY, k=1))
  
  myMap.plot(summerX_new, summerY_smooth, 'g')
  
  myMap.plot(summerX, summerY, 'go')   
  plt.show()
  </code></pre>