code: func (p *Path) IntersectionPath(path *Path) ([]*Point, [][2]int) {
  	// TODO: done some sort of line sweep here if p.Length() is big enough
  	var points []*Point
  	var indexes [][2]int
  
  	for i := 0; i < len(p.PointSet)-1; i++ {
  		pLine := NewLine(&p.PointSet[i], &p.PointSet[i+1])
  
  		for j := 0; j < len(path.PointSet)-1; j++ {
  			pathLine := NewLine(&path.PointSet[j], &path.PointSet[j+1])
  
  			if point := pLine.Intersection(pathLine); point != nil {
  				points = append(points, point)
  				indexes = append(indexes, [2]int{i, j})
  			}
  		}
  	}
  
  	return points, indexes
  }
docs: // IntersectionPath returns a slice of points and a slice of tuples [i, j] where i is the segment
  // in the parent path and j is the segment in the given path that intersect to form the given point.
  // Slices will be empty if there is no intersection.