How do I calculate the relationship between the position of the vertex of a pentagon and two of its inner angles? You may have already seen my other questions about pantographs - a more simple case, and a case where the I need to know about the position not of a vertex, but of a point offset from one of the edges.
I am still experimenting with my pantograph, and I'm trying a version that uses, in effect, a pentagon instead of a rhombus. 
The advantage of the pentagon is that it solves some practical problems and simplifies construction of the device. This now looks like this:

(I use a pair of servo motors, driven by a PyBoard running MicroPython.)
As mentioned, there are two complications. Firstly, I'm now working with a pentagon, rather than a rhombus as before.
Secondly, because it's very difficult to find a simple and satisfactorily robust way of attaching the pencil at the tip of the device (i.e. where the red and purple arms meet), I have attached it to one of the arms - and that means there is an offset to take into account.
I need to work out: to what angle must I set each servo, to place the pencil tip at a particular x/y point? 
 A: It’s messy, but not difficult, to find the pencil location from the angles. My suggestion is that you create a table by repeating that calculation for all pairs of angles that are multiples of, say, $0.005$ radians, and then find the angles you need by looking up the desired $(x,y)$ in the resulting table and choosing the closest point. (You can add entries to the table where needed to get the desired precision for $x$ and $y$.) Here’s a sloppy bit of Mathematica code that I think finds the pencil location from the two angles. (Note that I thought the purple stick was blue, so use the letter b to refer to it.)
Notes on the notation:
\[Theta]y] is the angle of the yellow stick measured clockwise from horizontal.
\[Theta]g] is the angle of the green stick measured counterclockwise from horizontal.
h is the vertical offset from the horizontal center line to each servo.
l is the length of a stick (between pivot points).
ygmid is the midpoint of the right ends of the yellow and green sticks.
rbalt is the distance from ygmid to rbcorner (where the red and blue sticks meet).
clippedat is the distance from rbcorner to the [idealized] clip point (assuming the clip-to-pencil vector is at right angles to the stick, and the clip point is in the center of the stick's width).
penciloffset is the distance from the blue stick to the pencil.
pencil is the drawing point.
h := 0.6;
l := 3.0;
y0 := {0, -h};
y1 := y0 + l {Cos[\[Theta]y], -Sin[\[Theta]y]};
g0 := {0, h};
g1 := g0 + l {Cos[\[Theta]g], Sin[\[Theta]g]}; 
ygmid := (y1 + g1)/2;
rbalt := Sqrt[l^2 - (EuclideanDistance[y1, g1]/2)^2];
r1 := RotationTransform[-\[Pi]/2, ygmid];
rbcorner := ygmid + r1[rbalt Normalize[y1 - g1]];
clippedat := 1.0; clip := rbcorner + clippedat (y1 - rbcorner);
r2 := RotationTransform[-\[Pi]/2, clip];
penciloffset := 1.0;
pencil := clip + r2[penciloffset Normalize[y1 - rbcorner]];

