title: Numpy, RuntimeWarning: invalid value encountered in sqrt
body: <p>I am trying to draw a sphere in cartesian coordinates.
  However, I get a half sphere as if np.sqrt gives me only positive values.
  How can I complete the sphere? Any alternative to np.sqrt?</p>
  
  <p>I know how to draw a sphere in polar coordinates or with sin and cosine functions so I am only interested in drawing it by using x, y, z values such as;</p>
  
  <pre><code>x**2+y**2+z**2=1
  </code></pre>
  
  <p>Here is the code gives half sphere and the warning;</p>
  
  <pre><code>import matplotlib.pyplot as plt
  from mpl_toolkits.mplot3d import Axes3D
  
  fig = plt.figure(figsize=(20, 10))
  ax = fig.add_subplot(1,2,1, projection = '3d')
  
  xs=np.linspace(-1,1, 100)
  ys=np.linspace(-1,1, 100)
  xs,ys=np.meshgrid(xs,ys)
  zs= np.sqrt(1-xs*xs-ys*ys)
  
  ax.plot_surface(xs, ys, zs, lw = 0, antialiased = True)
  </code></pre>