rect.intersectionWithLineFromCenterToPoint(p [, angle])

Return the point on the boundary of the rectangle that is the intersection of the rectangle with a line starting in the center of the rectangle ending in the point p.

If angle is specified, the intersection will take into account the rotation of the rectangle by angle degrees around its center.