1 | initial version |
Altough the approach by @Balaji will probably work without any problems, I do think this can be done much easier. From an angle and a starting point one can use mathematics to derive the function that represents the line. Once you have done that the following steps are quite easy.
x = 0
, then you can define the y value of your line equation and see if that still falls within the range of your top edge. Necessary equation: http://stackoverflow.com/questions/1571294/line-equation-with-angle