See attachment for figure.
Consider the line from A to the y-axis. Its length is
It is also equal to
So we have
Consider the triangle ABP. It's a right angle triangle.
Length of BP is a.
Angle ABP is pi-t.
So since sin(ABP)=AP/BP, we get :
by simple trigonometry,