Geometry /Trigonometry - Can someone help me solve for angle "a" ? I'm struggling.

Let x be the remaining part of the base next to the 400. Then we have sin(a) = 25/x and tan(a) = 100/(400 + x) which can be solved by a system of equations.
This image is a simplified version of a problem I ran into. Basically I've been struggling to find a general formula for angle "a" based on a fixed value for D and variable (but known) values for L & P.

In my thoughts is should be possible, however I cannot seem to find the formula for angle "a" based on L & P (with a fixed distance D). If anyone could point me in the right direction that would be greatly appreciated!
Let x be the length of the horizontal segment on the left, so that the whole horizontal line has length L + x.

Then x is the hypotenuse of the the small right triangle in the bottom left with one leg equal to D, and the whole base L + x is one leg of a large right triangle whose other leg is p.

These two triangles are similar, so the hypotenuse of the larger right triangle is px/D. By Pythagoras, we get

p\^2 + (L + x)\^2 = (px/D)\^2.

Now s = sec a = x/D, so we can rewrite the equation in terms of s:

p\^2 + (L + Ds)\^2 = (ps)\^2, or

(p\^2 - D\^2)s\^2 - 2LDs - (L\^2 + p\^2) = 0

In your picture p > D. In this case, this quadratic equation has only one positive solution s. Then a = arcsin(1/s).
If you just need a very good approximation, I took the pixels to find the tan\^-1(290/1650) to get an angle of 9.96 degrees, so it's probably very close to 10 degrees.