I would like to point out that your CAD application can most likely do this for you. Just make a parametric drawing and sweep the values you need. This may be more practical as you go forward since the cad application can effortlessly make changes based on geometric constraints and you don't need to calculate this.

Image 1: Parametric sweep of one value. No harder than typing 3 values. Note the drawing s intentionally exaggerated.
Making the sweep by script is not much harder. This opens up statistical analysis by montecarlo simulation. Doing it this way reduces chance of error made during the mathematical analysis. Of course, this is both a good thing and a bad thing. Analytical analysis can give insights into global minima, but as the complexity of your analysis grows this might not be feasible so a local minima may suffice.
But yeah you can calculate this by hand too, the problem is that one you start adding the things you now consider trivial this may no longer be a trivial extension.

Image 2: Vector expression
You can express this as a equation of vector expressions
$$
\vec a + \vec b + \vec c = 0
$$
where $\vec a$ is known, magnitude of $\vec b$ is known and direction of $\vec c$ is linked to vector $\vec b$. So vector $\vec b$ is $D \cdot \{sin(\theta), cos(\theta)\}$ therefore $\vec c$ is $x \cdot\{-cos(\theta), sin(\theta)\}$. Since you have 2 directions and 2 unknowns this is solvable. But i wont take this further.