Drawing an arrow

Solution

\begin{align} x_3&=x_2+\frac{L_2}{L_1}\bigl[(x_1-x_2)\cos\theta+(y_1-y_2)\sin\theta\bigr],\\ y_3&=y_2+\frac{L_2}{L_1}\bigl[(y_1-y_2)\cos\theta-(x_1-x_2)\sin\theta\bigr],\\ x_4&=x_2+\frac{L_2}{L_1}\bigl[(x_1-x_2)\cos\theta-(y_1-y_2)\sin\theta\bigr],\\ y_4&=y_2+\frac{L_2}{L_1}\bigl[(y_1-y_2)\cos\theta+(x_1-x_2)\sin\theta\bigr]. \end{align}

Explanation

Let's call $P_i$ the point of coordinates $(x_i,y_i)$, then \begin{align} P_3&=P_2+L_2\mathbf{v}_3,\\ P_4&=P_2+L_2\mathbf{v}_4 \end{align} where $$ \mathbf{v}_3=(\cos(\theta_0-\theta),\sin(\theta_0-\theta)),\\ \mathbf{v}_4=(\cos(\theta_0+\theta),\sin(\theta_0+\theta)) $$ and $\theta_0$ is such that $$ \mathbf{v}=\frac{P_1-P_2}{L_1}=(\cos\theta_0,\sin\theta_0). $$ Then \begin{align} \cos\theta_0&=\frac{x_1-x_2}{L_1},\\ \sin\theta_0&=\frac{y_1-y_2}{L_1} \end{align} so that, using trigonometric addition formulas \begin{align} \mathbf{v}_3&=\left(\frac{x_1-x_2}{L_1}\cos\theta+\frac{y_1-y_2}{L_1}\sin\theta,\frac{y_1-y_2}{L_1}\cos\theta-\frac{x_1-x_2}{L_1}\sin\theta\right),\\ \mathbf{v}_3&=\left(\frac{x_1-x_2}{L_1}\cos\theta-\frac{y_1-y_2}{L_1}\sin\theta,\frac{y_1-y_2}{L_1}\cos\theta+\frac{x_1-x_2}{L_1}\sin\theta\right) \end{align} and finally \begin{align} x_3&=x_2+L_2\left(\frac{x_1-x_2}{L_1}\cos\theta+\frac{y_1-y_2}{L_1}\sin\theta\right),\\ y_3&=y_2+L_2\left(\frac{y_1-y_2}{L_1}\cos\theta-\frac{x_1-x_2}{L_1}\sin\theta\right),\\ x_4&=x_2+L_2\left(\frac{x_1-x_2}{L_1}\cos\theta-\frac{y_1-y_2}{L_1}\sin\theta\right),\\ y_4&=y_2+L_2\left(\frac{y_1-y_2}{L_1}\cos\theta+\frac{x_1-x_2}{L_1}\sin\theta\right), \end{align} or better written \begin{align} x_3&=x_2+\frac{L_2}{L_1}\bigl[(x_1-x_2)\cos\theta+(y_1-y_2)\sin\theta\bigr],\\ y_3&=y_2+\frac{L_2}{L_1}\bigl[(y_1-y_2)\cos\theta-(x_1-x_2)\sin\theta\bigr],\\ x_4&=x_2+\frac{L_2}{L_1}\bigl[(x_1-x_2)\cos\theta-(y_1-y_2)\sin\theta\bigr],\\ y_4&=y_2+\frac{L_2}{L_1}\bigl[(y_1-y_2)\cos\theta+(x_1-x_2)\sin\theta\bigr]. \end{align}


Hint: Draw a line from $(x_3,y_3) \to (x_1,y_1)$, then use trigonometry to find out the angle $x_2x_1x_3$. Then use more trig to find the equation of the line that connects $(x_3,y_3) \to (x_1,y_1)$, and also the equation from $(x_3,y_3) \to (x_2,y_2)$, then solve the system of equations to find $(x_3,y_3)$

The process is similar for $(x_4,y_4)$.


Using the scalar product, notice that

$$(x_1-x_2)(x_3-x_2)+(y_1-y_2)(y_3-y_2) = L_1 L_2 \cos \theta$$

and

$$(x_1-x_2)(x_4-x_2)+(y_1-y_2)(y_4-y_2) = L_1 L_2 \cos \theta \; .$$

as well as equations related to the length

$$(x_3-x_2)^2+(y_3-y_2)^2 = L_2^2$$

and

$$(x_4-x_2)^2+(y_4-y_2)^2 = L_2^2$$

You can thus solve these equations in $(x_3,y_3)$ and $(x_4,y_4)$. Note that they really are the same pair of equations (eq 1 & eq 3 w.r.t. eq 2 & eq 4) which means that those equation have 2 solutions which are related to different possible orientations of your angles $\theta$. You can filter out which solution is which by looking at their location with respect to $(x_1,y_1)$ and $(x_2,y_2)$.

Let me expand a bit on the answer. So my equations are

$$(x_1-x_2)(x-x_2)+(y_1-y_2)(y-y_2) = L_1 L_2 \cos \theta$$

and

$$(x-x_2)^2+(y_3-y_2)^2 = L_2^2$$

Now, introduce $(x-x_2)=X$ and $(y-y_2)=aX$. The equations become

$$(x_1-x_2)X+(y_1-y_2)aX = L_1 L_2 \cos \theta$$

and

$$X^2+a^2X^2 = L_2^2$$

The first equation gives

$$X = \frac{L_1 L_2 \cos \theta}{(x_1-x_2)+(y_1-y_2)a}$$

which you can substitute in the second to give an equation of second degree in $a$ only.

$$(1+a^2)(L_1 L_2 \cos \theta)^2 = L_2^2 ((x_1-x_2)+(y_1-y_2)a)^2$$

This will have two solutions for $a$.