Distance to ray intersection with a rectangle
The top-right, top-left, bottom-left, bottom-right points (in that order) of the rectangle
A point
A vector
The distance to intersection
Distance to ray intersection with a rectangle