# 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?