How can I find the end point of this line segment? In the following image, I know $\theta, r, d, cx, px$.  
How can find $px, py$?

 A: Let the point at the $90$ degree angle be called $P$ at $(x_1,y_1)$. Then draw the line $x = x_1$ (parallel to y axis). Consider the point $Q = (x_1,y_2)$ where this intersects the diameter of the circle (in particular, the diameter that goes through the point at the very right). For convenience, call the origin of the circle $O$. You should be able to find the angle $POQ$ to be $180 - \theta$. Then the angle $OPQ$ is $\theta - 90$. Let $R$ be the point at $(px,py)$. Actually, we're going to call this $(x_2,y_2)$ to avoid confusion. Now, recall the line $x = y_1$ we drew earlier. Consider the intersection of that line and the horizontal line $y = y_2$. Notice that the segment $d$, the first line we drew (vertical line) and the horizontal line forms a right triangle with $P$ as one point and $R$ as another point. Let the right angle be labeled point $S$. Then we have the angle $RPS = 180 - \theta$. With that angle and given that you have a right triangle, you should be able to find $(x_2,y_2)$ with trigonometry.
