Given an angle and having drawn a line from the center of a bounding box, how can we compute the coordinates at which the line will intersect the bounding box?
Please have a look at the following diagram:

As you can see, for example, at angle 0 the line intersects point (0.5, 1)
How can we turn this problem into a computable formula that accepts an angle and returns x and y coordinates?
You can solve by using trigonometry and handling each 45 degree section separately:
Given:
Angle range; x; y