Problem related “polygon offseting”

Knowing points P1,P2,P3 and distance d and the angles shown in the figure, angle between a and b not necessary 90º

What's the size of K?

-
possible duplicate of What's the size of K in this figure? – Ross Millikan Mar 30 '12 at 23:49
Is not the same problem, please read it again. – Gabriel Mar 30 '12 at 23:51
I agree it is not quite the same problem. Sorry. If you are the same user, please ask that the accounts be merged. – Ross Millikan Mar 30 '12 at 23:59

It may be convenient to represent this in the complex plane, with $P2 = 0$. Let the three vertices on the top of the figure be $P4$, $P5$, $P6$ from left to right. Now $P4 = P1 (1 - i d/a)$, $P6 = P3 (1 + i d/b)$. $P5 = P4 - s P1 = P6 - t P3$ where $s$ and $t$ are real. Solve $s P1 - t P3 = P4 - P6$ and $s \overline{P1} - t \overline{P3} = \overline{P4-P6}$, obtaining $s$ and $t$ and thus $P5$. Then $k = |P5 - P2|$.
Knowing $P_1,P_2,P_3$, you can use the law of cosines to work out the angle at $P_2$. Drop a perpendicular from $P_2$ to a point $Q$ on the line segment parallel to the segment of length $a$, and another to the point $R$ on the line segment parallel to the segment of length $b$. This makes two congruent little right triangles, so you can work out the angle of either one of them at $P_2$. Now for these little right triangles you have an angle and a side, $d$, so you can get the hypotenuse, $k$.