I have come up against a bit of a wall with this problem. Here is a lever that rotates around a pivot at $(0,0).$
$x_1$ and $y_1$ are known and fixed in length and position.
$d_1$ is known and fixed length only, it rotates around the pivot at $(0,0).$
Angle $A$ is known but is variable.
$d_2$ and Angle $B$ are unknown.
My question is, how can I use trig to calculate Angle $B$ and length $d_2?$ I am currently resorting to sketching it out in CAD and moving it when I need to know the new values but my aim is to have a spreadsheet going so I can just punch the variables in and get the results.
I understand that I need to break the geometry down into smaller triangles but I can't figure it out. If anyone is able to advise and hopefully describe what is needed I would be really grateful.
All the best.

Here's one possible method of solution.
Then $\alpha=\arctan(y_1/x_1).$ This allows us to calculate $\beta=A-\alpha.$ Furthermore, the length of the line segment $\overline{CE}=\sqrt{x_1^2+y_1^2}.$ Once we have $\beta$ and $\overline{CE},$ we can use the Law of Cosines on $\triangle CEF$ as follows: $$d_2=\sqrt{d_1^2+\overline{CE}^{\,2}-2d_1\!\left(\overline{CE}\right)\cos(\beta)}.$$
You can finish up with the Law of Sines to get $B.$