code: def find_coord(targ_length,xyz,rcum,theta,phi):
      
      #   [1] Find spherical coordinates for the line segment containing
      #           the endpoint.
      #   [2] Find endpoint in spherical coords and convert to cartesian
      i = np.nonzero(rcum <= targ_length)[0][-1]
      if i == len(theta):
          return xyz[-1,:]
      else:
          r_lcl = targ_length-rcum[i] # remaining length along line segment
          (dx,dy,dz) = spherical_to_cartesian(r_lcl,theta[i],phi[i])
          return xyz[i,:] + [dx,dy,dz]
docs: Find (x,y,z) ending coordinate of segment path along section
      path.
  
      Args:
          targ_length = scalar specifying length of segment path, starting
                        from the begining of the section path
          xyz = coordinates specifying the section path
          rcum = cumulative sum of section path length at each node in xyz
          theta, phi = angles between each coordinate in xyz