title: How to fit a Rectangle inside a Circle?
body: <p>So far I've tried creating another <code>Rectangle</code> to calculate the radius of an inner <code>Circle</code> with it's center and a point to the left side:</p>
  
  <pre class="lang-java prettyprint-override"><code>Rectangle rectangle = new Rectangle();
  Vector2 center = new Vector2();
  otherRectangle.getCenter(center);
  Vector2 side = new Vector2(otherRectangle.x, otherRectangle.y + otherRectangle.height / 2f);
  float size = center.dst(side);
  rectangle.setSize(size);
  rectangle.setCenter(center);
  </code></pre>
  
  <p>But this makes the <code>rectangle</code> be too small and I'd like the corners of the square to be touching the circle border:  </p>
  
  <p><a href="https://i.stack.imgur.com/uyaTg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uyaTg.png" alt="enter image description here"></a></p>