Let's look at a simpler problem. Suppose you have the situation depicted in the figure below:
Then, given the angle $\alpha$, the coordinates of the point $C''$ are:
$$
C''_x = r\cos\alpha
\qquad\mbox{and}\qquad
C''_y = r\sin\alpha
$$
where $r$ is the radius of the circle.
Now let's look at a slightly more complicated problem, depicted below:
This is very similar to the situation above. In fact,
$$
C'_x = r\cos(\alpha+\beta)
\qquad\mbox{and}\qquad
C'_y = r\sin(\alpha+\beta)
$$
By using the trigonometric relations $\sin(\alpha+\beta) = \sin\alpha\cos\beta + \sin\beta\cos\alpha$ and $\cos(\alpha+\beta) = \cos\alpha\cos\beta - \sin\alpha\sin\beta$, we can write the above as follows:
$$
C'_x = r\cos\alpha\cos\beta - r\sin\alpha\sin\beta
\qquad\mbox{and}\qquad
C'_y = r\sin\alpha\cos\beta + r\sin\beta\cos\alpha
$$
But, wait... By looking at the previous situation and replacing $C''$ with $B'$ and $\alpha$ with $\beta$, we see that
$$
B'_x = r\cos\beta
\qquad\mbox{and}\qquad
B'_y = r\sin\beta
$$
Therefore, we can write
$$
C'_x = B'_x\cos\alpha - B'_y\sin\alpha
\qquad\mbox{and}\qquad
C'_y = B'_x\sin\alpha + B'_y\cos\alpha
$$
But what you want is this, instead:
Well, we can just move everything rigidly by the vector $-\vec{OA}$ so that $A$ is now the origin of the coordinate system and we get the situation just above. This amounts to subtracting $A$ from both $B$ and $C$ to get $B'$ and $C'$ in the above, and we find
$$
C_x - A_x = (B_x-A_x)\cos\alpha - (B_y-A_y)\sin\alpha
$$
$$
C_y - A_y = (B_x-A_x)\sin\alpha + (B_y-A_y)\cos\alpha
$$
Then, finally,
$$
C_x = A_x + (B_x-A_x)\cos\alpha - (B_y-A_y)\sin\alpha
$$
$$
C_y = A_y + (B_x-A_x)\sin\alpha + (B_y-A_y)\cos\alpha
$$
Let C be the circle located inside the first quadrant. (The logic will be the same if the origin is located at the top left corner.) We let its equation be $F(x, y) = (x – h)^2 + (y – k)^2 - r^2 = 0$.
Initial task == Testing whether the mouse pointer (at T(p, q)) is inside or outside of the circle.
This is easily done by testing whether F(p, q) is greater than or equal to or smaller than 0. The conclusion will be outside/ on/ inside the circle accordingly.
We assume that T(p, q) is inside the circle.
The corresponding point (the one on the circumference) is then (p, m) where m will have 2 values (? and ??).
From the fact that $m – k = \pm \sqrt(r^2 – (p – h)^2)$, and with the help of the diagram, we conclude that $?? = k + \sqrt(r^2 – (p – h)^2)$.
Best Answer
As you can see from the image, The point you require is at $-45 $ Degree from $0$ . So your required point is $R \cos (-\pi /4), R \sin (-\pi/4)$
Which can be equivalently written as?