code: def distances(direction, center, r=1):
      """Compute sphere-line intersection.
  
      Parameters
      -----------
      direction: vector
          direction vector (line starts at 0)
      center: vector
          center of sphere (coordinate vector)
      r: float
          radius of sphere
  
      Returns
      --------
      tpos, tneg: floats
          the positive and negative coordinate along the `l` vector where `r` is intersected.
          If no intersection, throws AssertError.
  
      """
      loc = (direction * center).sum()
      osqrnorm = (center**2).sum()
      # print(loc.shape, loc.shape, osqrnorm.shape)
      rootterm = loc**2 - osqrnorm + r**2
      # make sure we are crossing the sphere
      assert (rootterm > 0).all(), rootterm
      return -loc + rootterm**0.5, -loc - rootterm**0.5
  
imports: import numpy
  from numpy.linalg import norm
  import matplotlib.pyplot
label_desc: Use image node_id 7 for calling a global function with example usage: distances(direction, center, r) and returns: unknown,  unknown