How can I caculate the segment length necessary to separate a certain area from a sector under a given angle? Consider the geometry in this drawing.

A circular sector with radius $r$ is divided into two parts by a segment $l$ starting from one of the ends if its arc and meeting the opposite side of the sector at an angle $\alpha$. The sector area outside of $l$ (as indicated by blue shading in the drawing) is $A$.
The values $r$, $\alpha$ and $A$ are given, I need to find $l$. I also need the solution to be easily calculable (using a computer).

With $\beta$ and $d$ as indicated in the drawing, one easily sees
$$
\begin{gather}
A = \frac{r^2}{2} \cdot (\beta - \sin\beta \cos\beta)
+ \frac{l^2}{2} \cdot \sin\alpha \cos\alpha \tag{1}\\
d = r \cdot \sin\beta = l \cdot \sin\alpha  \tag{2}.
\end{gather}
$$
However, I can't seem to solve this for $l$. How can it be done? Is there maybe a better approach than the two equations above?

It looks to me that $$A=\frac{r^2 \beta}{2}-\frac{rl}{2}\sin(\alpha-\beta)$$ thus
$$l=\frac{r^2\beta-2A}{r\sin(\alpha-\beta)}$$
