Calculate max size of rectangle in pie chart I'm trying to get the maximum possible width and height of a rectangle inside a pie chart. All fields have the same angle. $\alpha$ is never bigger than $90^{\circ}$.
I have the variables $\alpha$, $r$, $b$ and I know that $w = 3h$. 
I'm searching for $w$, $h$ and $P_1 (x_1, y_1)$.
I'm a programmer, so I'm not that good with math and I have to translate this to Code afterwards. Thanks for your help!

Edit:
I'm using Javascript. Thanks to Paul. He explained me, that I have to use radians instead of degree using Math.tan. In addition, there is no Math.cot in Javascript. That's why I had to create two more functions.
const tan = (deg) => Math.tan(deg * Math.PI / 180);
const cot = (value) => 1 / tan(value);


Here's a possible answer, based on the truth of my comment.
No way to draw a picture now.
In your figure, let $z$ be the distance from the center to the top edge of the rectangle. Then
$$.
z = (w/2)\cot(\alpha/2).
$$
Then the distance to the bottom edge of the rectangle is
$$
z+ h = z + (w/3)
$$
... will finish later ...
