code: func (r Rect) IntersectionPoints(l Line) []Vec {
  	// Use map keys to ensure unique points
  	pointMap := make(map[Vec]struct{})
  
  	for _, edge := range r.Edges() {
  		if intersect, ok := l.Intersect(edge); ok {
  			pointMap[intersect] = struct{}{}
  		}
  	}
  
  	points := make([]Vec, 0, len(pointMap))
  	for point := range pointMap {
  		points = append(points, point)
  	}
  
  	// Order the points
  	if len(points) == 2 {
  		if points[1].To(l.A).Len() < points[0].To(l.A).Len() {
  			return []Vec{points[1], points[0]}
  		}
  	}
  
  	return points
  }
docs: // IntersectionPoints returns all the points where the Rect intersects with the line provided.  This can be zero, one or
  // two points, depending on the location of the shapes.  The points of intersection will be returned in order of
  // closest-to-l.A to closest-to-l.B.