code: def fitLine(points, c="orange", lw=1):
      
      data = np.array(points)
      datamean = data.mean(axis=0)
      uu, dd, vv = np.linalg.svd(data - datamean)
      vv = vv[0] / np.linalg.norm(vv[0])
      # vv contains the first principal component, i.e. the direction
      # vector of the best fit line in the least squares sense.
      xyz_min = points.min(axis=0)
      xyz_max = points.max(axis=0)
      a = np.linalg.norm(xyz_min - datamean)
      b = np.linalg.norm(xyz_max - datamean)
      p1 = datamean - a * vv
      p2 = datamean + b * vv
      l = vs.Line(p1, p2, c=c, lw=lw, alpha=1)
      l.info["slope"] = vv
      l.info["center"] = datamean
      l.info["variances"] = dd
      return l
docs: Fits a line through points.
  
      Extra info is stored in ``actor.info['slope']``, ``actor.info['center']``, ``actor.info['variances']``.
  
      .. hint:: |fitline| |fitline.py|_