how do i calculate coordinates of point on rectangle based on angle

424 Views Asked by At

If i want to find out what is x and y of point lies of a line drawn from center of the rectangle to outward at certain angle.

take a look at picture below.enter image description here

2

There are 2 best solutions below

1
On BEST ANSWER

It looks like a line clipping problem (computer graphics). Right?

http://www.cc.gatech.edu/grads/h/Hao-wei.Hsieh/Haowei.Hsieh/mm.html#sec2

1
On

$\displaystyle{\large x = {a \over 2}\quad}$. $\displaystyle{\large y = {a \over 2}\,\tan\left(\angle\right).\quad}$ $\displaystyle{\large a}$: Rectangle base.