Well eh, you look for math? Well, the solution is an infine amount of points, so you need to know wich of them you need (The end of the intersect line, the middle or ... ). In addtion try to describe in what sort of positions the rect will be, will it tilt? And in what directions?