Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to find the radius of a rectangle based on a given x and y coordinate?

If so, how is the achieved.

I'm trying to create a rectangle in C++ ( using OpenGL ), and would like to obtain the formula for the radius of a Rectangle based on its center.

share|cite|improve this question
What's the radius of a rectangle?? – Hans Lundmark Jan 15 '12 at 8:37
It would be really helpful to have a specific example of what you know and what you want to know—a picture showing which measurements you know and what point and measurements you're trying to find would probably help a lot. – Isaac Jan 15 '12 at 17:12

1 point is not enough to determine a unique rectangle. If the radius of a rectangle means the distance of a point on the perimeter of a rectangle from its center in terms of the angle anticlockwise from the horizontal, and the rectangle has a corner (x,y) and centre (0,0) and sides parallel to the x and y axis, then

$r=\frac{y}{\sin \theta}$ for $a\leq\theta\leq \pi-a$ or $\pi+a\leq\theta\leq 2\pi-a$

$r=\frac{x}{\cos \theta}$ for $\pi -a\leq\theta\leq \pi+a$ or $-a\leq\theta\leq a$

share|cite|improve this answer
are those fors comparable to for loops in programming? – about blank Jan 15 '12 at 9:14
No, it describes a case distinction. In fact, in programming terms, you can read it as an "if" statement. – Johannes Kloos Mar 15 '12 at 9:04

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.