Given a point on a circle, find it on a given square Math is not my forte so I apologize. I have a seemingly simple problem and I'm unable to figure out the formula for this.
I'd describe the problem as given the center point of a circle and a point on the edge of the circle, find the same point on a square with the same length as the diameter of the circle.

The filled in points in this image are the ones I'm trying to find.
As an addition, I'd love some online resources on where I can learn how to do this kind of math and intuitively find the answer for myself in the future. Cheers.
 A: 
You are looking for trigonometric functions. Good news is you need very simple ones. Here is a recap:
In the figure above, suppose the radius of the circle is 1. The horizontal diameter (in cyan) is called the cosine axis, and the vertical diameter (in magenta) the sine axis. Corresponding to each point $P$ on the circle are two points $X$ and $Y$ on the cosine and sine axes, respectively. For angle $\widehat a$ between $OA$ and $OP$ we have
$$cos (a) = OX \quad , \quad sin(a) = OY$$
The vertical line (in red) that is tangent to the circle at point $A$ is called the tangent axis, and the horizontal line (in blue) that is tangent to the circle at $B$ is called the cotangent axis. Now you can see that your task has to do with these two axes. In the example shown in the figure above, you are looking for point $Q$, which is on the tangent axis. The length $AQ$ is $tan(a)$. Point $Q$ is on the tangent axis if angle $\widehat a$ is between $-45^o$ and $45^o$ . If angle $\widehat a$ is between $45^o$ and $135^o$ then the point $Q$ falls on the cotangent axis and you will want to have $cot(a)$ . For other angles you can easily find the coordinates of point $Q$ by symmetry.
So, if angle $\widehat a$ is given, then depending on its value you are looking for $\pm tan(a)$ or $\pm cot(a)$ . If instead of $\widehat a$ , the coordinates $x$ and $y$ of $P$ are given, then you should only note that
$$x = cos(a) \quad , \quad y = sin(a)$$
$$\frac yx = tan(a) \quad , \quad \frac xy = cot(a)$$
and when $\widehat a = 45^o$ , $\; x=y \;$  and  $\; tan(a) = 1 \;$ .
A: Suppose the circle and square is centered at $(0,0)$ the circle has radius $r$ and the square has sides $2r$.  The midpoint of the sides of the square are $(0,r), (r,0), (0, -r), (-r,0)$ and the corners are $(-r,r),(r,r), (r,-r)$ and $(-r,-r)$.
Okay a point on the circle is $(x_1,y_1)$
So the equation of the line from $(0,0)$ to $(x_1, y_1)$ will have slope $m=\frac {x_1}{y_1}$.  And the equation of the line is $y = \frac {x_1}{y_1}x$.
Now there are four cases to consider based on what side of the square the line will intersect.
Case 1:  The line goes through the right side of the square.
That means $x_1 > 0$ and $|y_1| \le x_1$ and so $ -1 \le m \le 1$.
So if $m = 1$ then the line will go through the right side of the square.
So let that point be $(r, y_2)$.
But theb we have the formula $y = mx$ so $y_2 = mr =\frac {y_1}{x_1}r$. and the point on the square is $(r, \frac {y_1}{x_1}r)$
Case 2:
The line passes through the top of the square.
Then $y_1 > 0$ and $|x_1| \ge y_1$ and so $|m| =|\frac {y_1}{x_1}| \ge 1$
So if $m > 1$ or $m < -1$ then the line goes through the top the square.
And the point is $(x_2, r)$.
I should point out that if the point of the circle was $(x_1, y_1) = (0, r)$ then we'd have a case where $m = \frac {y_1}{x_1} =\frac r0 =\infty$.  This is the case that the line is completely vertical.
In this case it's obvious the point on the square is the exact same point of the circle so the point is $(0,r)$.  Otherwise....
The equation of our line is $y = mx =\frac{y_1}{x_1}$ so $r = m x_2$ and $r = \frac {y_1}{x_1} x_2$ so $\frac {x_1}{y_1}r = x_2$.
And the point is $(\frac {x_1}{y_1}r, r)$>
....
The case where the line goes through the left and right side are similar.
If $-1 \le m \le 1$ but $x_1 < 0$ then the line goes through the left side of the square and
the point is $(x_2, y_2) = (-r, -r\frac {y_1}{x_1})$.
And if $m \le -1$ or $m \ge 1$ (or $x_1 = 0$ and $m = \infty$) but $y_1 < 0$ then the line goes through the bottom of the square and
the point is $(x_2, y_2) = (-r\frac {x_1}{y_1} ,-r)$
