# Thread: Circle inside a square

1. ## Circle inside a square

This will probably be really simple but I've been working on it for a solid hour and I can't seem to solve it.

Basically I have a circle inside of a square and I wish to calculate the distance between the origin and the edge of the square. Sounds pretty simple ay?

I know the radius and thus all the dimensions of the square and the angle.

This is what i have:

a = angle
b = 90 - a

c = r * cos(a);
d = r * sin(b);

and then whichever is smaller c or d is the distance. This doesn't work, at least it doesn't seem to

Conor

2. ## Re: Circle inside a square

You will need better definitions. Perhaps if you labled the drawing.

a = ?? Any angle?
b = ?? Compliment of some angle?
c = ?? x-coordinate of some point on the circle?
d = ?? y-coordinate of probably some other point on the circle?
I think I can assume what r is, but the others need a little help.

3. ## Re: Circle inside a square

Originally Posted by TKHunny
You will need better definitions. Perhaps if you labled the drawing.

a = ?? Any angle?
b = ?? Compliment of some angle?
c = ?? x-coordinate of some point on the circle?
d = ?? y-coordinate of probably some other point on the circle?
I think I can assume what r is, but the others need a little help.
I have removed the circle after realising it's redundant. and i have labeled things..

this is just the top right quarter too.

[IMG=http://img803.imageshack.us/img803/3804/squarequ.png][/IMG]