# Radius of largest sector that can fit in a rectangle, given the 'start angle' and 'sweep angle' of the sector

What we know:

I have a rectangle with a given Width and Height: Inside that rectangle, I want to fit an ellipse sector, with a known "Start angle" and "Sweep angle." Some contrived, random examples: The question:

Given the Width and Height of the rectangle, and given the 'start angle' and 'sweep angle' of the sector, how do I determine the largest RadiusX and RadiusY values of the resulting sector which will completely fit inside the rectangle? How do I solve for Radius X and Radius Y?

BONUS: How do I calculate the X/Y coordinates for the origin of the ellipse, as it fits inside the rectangle?

• Your "start angle" and "sweep angle" are they the real angles formed by the sides of the sector, or they are rather referred to a circle? – Aretino May 2 '16 at 16:52
• I'm not sure I understand your question. The five examples above are just 5 random examples, which show an ellipse sector with the given 'begin' angle and 'sweep' angle length. – BTownTKD May 2 '16 at 18:08
• In the picture below, your sweep angle for the ellipse on the right is 129° or 100°? [Picture] (i.stack.imgur.com/fdrRM.png) – Aretino May 2 '16 at 18:36
• I think I see. By "sweep angle" I refer to the degree of rotation, clockwise, starting from the start angle. – BTownTKD May 3 '16 at 1:20