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.
Thanks in advance.
This is my interpretation of your question:
since we know that it is a square inscribed in a circle centered at the origin, then . Thus x & y can be calculated:
So any coordinate with either the x or y coordinates equation to or would lie on the edges of the square.
Hope it helps!
Hello, padfoot!
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: .
Then has coordinates: .
The four vertices are: .
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.
I'm not sure how to apply that.
I'll give an example.
r = 2
(x1,y1) = 1,1
(x2,y2) = 1,-1
The answer is Yes.
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.
-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
- All points in the area between these two circles can be called E1 and E2
ie;
Every (x,y) satisfying above is your answer (except those for which either is 0)
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...
-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