0
$\begingroup$

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.

  • 1
    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.2012-01-15

1 Answers 1

1

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$

  • 0
    No, it describes a case disti$n$ction. In fact, in programming terms, you can read it as an "if" statement.2012-03-15