# Thread: square incribed in cricle

1. ## square inscribed in circle

I have a problem here that I haven't been able to solve.
You're given a circle with radius r and a square is inscribed on it.
The center of the circle is at the origin and the edges of the square do not lie on coordinate axis. Given co-ordinates (x1,y1), tell whether the co-ordinates lie on any side of the square.
I hope my question is clear.

2. I see you are a newbie very warm Welcome to the Forum

Hint: There can be infinite squares in a circle

I have a problem here that I haven't been able to solve.
You're given a circle with radius r and a square is inscribed on it.
The center of the circle is at the origin and the edges of the square do not lie on coordinate axis. Given co-ordinates (x1,y1), tell whether the co-ordinates lie on any side of the square.
I hope my question is clear.
This is my interpretation of your question:

since we know that it is a square inscribed in a circle centered at the origin, then $\displaystyle \theta = 45 degrees = \frac{\pi}{4}$. Thus x & y can be calculated:
$\displaystyle x = r \cdot cos\theta = r \cdot cos\frac{\pi}{4}$

$\displaystyle y = r \cdot sin\theta = r \cdot sin\frac{\pi}{4}$
$\displaystyle \Rightarrow x = y$

So any coordinate with either the x or y coordinates equation to $\displaystyle r \cdot cos\frac{\pi}{4}$ or $\displaystyle r \cdot sin\frac{\pi}{4}$ would lie on the edges of the square.

Hope it helps!

4. Please excuse my previous post. I looked at ADARSH's post and realized my mistake. There are infinitely many squares inscribed in a circle. I was just looking at a particular case.

I don't know what you're asking, but I'll take a guess.

You're given a circle with radius r and a square is inscribed on it.
The center of the circle is at the origin.
Given co-ordinates (x1,y1) of one vertex, locate the other vertices.
Code:
                Y
|
* * *
*     |     * P
* - - - + - - - o(x1,y1)
*|       |     * |*
|       |  r*   |
* |       | * θ   | *
- - * | - - - + - - - | * - - X
* |      O|       | *
|       |       |
*|       |       | *
* - - - + - - - *
*     |     *
* * *
|

The coordinates of the one vertex is: .$\displaystyle P(x_1,y_1)$

$\displaystyle \text{Let }r\, = \,\text{distance }OP.$
$\displaystyle \text{Let }\theta \,=\,\angle POX,\,\text{ where }\tan\theta \,=\,\frac{y_1}{x_1}$

Then $\displaystyle P$ has coordinates: .$\displaystyle \left(r\cos\theta,\:r\sin\theta\right)$

The four vertices are: .$\displaystyle \bigg[r\cos\!\left(\theta + \frac{\pi}{2}n\right),\: r\sin\!\left(\theta + \frac{\pi}{2}n\right)\bigg]\;\text{ for }n = 0,1,2,3$

6. Thanks for the replies. I tried to use it to solve the problem but unfortunately it didn't work out.
I'll try to tell the question here.

There is a circular island of radius r (centered at origin). The owner wants to build a square tower inscribed on it. Given two points E1 (x1,y1) and E2 (x2,y2) for entrance and exit, is it possible to build a tower such that the two points (E1 and E2) lie on the tower's foundation ?

Hopefully, it made more sense this time around.

7. From your reply it seems either you are hesitating to give complete question or question is wrong

If its first case - Dont worry we are not gonna spoon feed you

8. I just rephrased the question. I removed the unnecessary parts. If you guys are still having trouble understanding it, I'll post the original one.

9. The square will have diameter 2r
So
$\displaystyle \sqrt{2r^2}= \text{side of square}$

Now ther can be infinite such squares(after rotating)
Locus of all such squares is a circle of radius equal to half the side of square ie; $\displaystyle \frac{r}{\sqrt{2}}$

10. I'm not sure how to apply that.

I'll give an example.
r = 2
(x1,y1) = 1,1
(x2,y2) = 1,-1

You get this by taking the vertices of the square as A(2,0), B(0,2), C(-2,0), D(0,-2). The points (1,1) and (1,-1) lie on lines AB and AD respectively.

I'm not sure how to apply that.

I'll give an example.
r = 2
(x1,y1) = 1,1
(x2,y2) = 1,-1

You get this by taking the vertices of the square as A(2,0), B(0,2), C(-2,0), D(0,-2). The points (1,1) and (1,-1) lie on lines AB and AD respectively.
I've attached a sketch.

You easily can determine the area where the points $\displaystyle E_1$ and $\displaystyle E_2$ must be located so that the condition is satisfied.

12. I'm sorry but I still didn't get it. How do you get the area where E1 and E2 must be located ?

13. -Since you didn't specify the real values of points to be checked we took it as (x,y)

- Since the square could be rotated we rotated it and hence(as in earboth's figure) every point of that area got included

-the mid point of a square inscribed in a circle is the point nearest to it

-Joining the midpoints of a particular side of a rotating square square we get a cicle of radius $\displaystyle \frac{r}{\sqrt{2}}$

- All points in the area between these two circles can be called E1 and E2
ie;$\displaystyle r^2 \ge x^2 +y^2 \ge \frac{r^2}{2}$

Every (x,y) satisfying above is your answer (except those for which either is 0)

14. Thanks a lot. It makes sense now. I have one doubt though.
Can't the two points E1 and E2 satisfy that condition but be part of two different squares ?
For example, is it possible to get a point E1 that lies on the line of a square S1 and E2 lie on a square S2 but not on S1 ?
I hope I'm not sounding like an idiot...

15. -See every point that satisfies that condition can be called E1 or E2

-This does NOT mean that every point that satisfies it are part of same square they may not be so

-the thing that satisfies that condition is an area (of which every point ) is your answer