Hello, axl456!
This takes quite a bit of work . . .
$\displaystyle \text{For any given line }L_1\text{, I need to create two orthogonal lines}$
$\displaystyle L_2\text{ and }L_3\text{ with length }c\text{ at the ends of }L_1.$
We have points $\displaystyle P_1(x_1,y_1)$ and $\displaystyle P_2(x_2,y_2).$
Let: $\displaystyle \,\theta$ = the angle at $\displaystyle \,P_1.$
Let: $\displaystyle R \:=\:\overline{P_1P_2} \:=\:\sqrt{(x_2x_1)^2 + (y_2y_1)^2}$
Code:

 (x2,y2)
 ♥ P2
 R * 
 *  y2y1
 * @ 
 P1 ♥*
 (x1,y1) x2x1

  +               

Then we have: .$\displaystyle \begin{Bmatrix}\sin\theta &=& \dfrac{y_2y_1}{R} \\ \\[4mm] \cos\theta &=& \dfrac{x_2x_1}{R}\end{Bmatrix}$
Let:. . $\displaystyle \begin{Bmatrix} \Delta x &=& \frac{1}{2}c\sin\theta \\ \\[4mm] \Delta y &=& \frac{1}{2}c\cos\theta \end{Bmatrix}$
Code:
 C
 *
 \
  \
 A  \ ∆x
 * .♥.
 \ * P2\ 
 ∆y \ * \  ∆y
  \P1 * \
 .♥. *
 ∆x \  D
 \ 
 \
 *
 B

  +               

To move from $\displaystyle \,P_1$ to $\displaystyle \,A$: .move left $\displaystyle \Delta x$ and up $\displaystyle \Delta y.$
. . Hence: .$\displaystyle A(x_1\! \! \Delta x,\;y_1 \!+\! \Delta y)$
To move from $\displaystyle \,P_1$ to $\displaystyle \,B$: .move right $\displaystyle \Delta x$ and down $\displaystyle \Delta y.$
. . Hence: .$\displaystyle B(x_1\! +\! \Delta x,\;y_1\!\!\Delta y)$
To move from $\displaystyle \,P_2$ to $\displaystyle \,C$: .move left $\displaystyle \Delta x$ and up $\displaystyle \Delta y.$
. . Hence: .$\displaystyle C(x_2\!\!\Delta x,\;y_2\!+\!\Delta y)$
To move from $\displaystyle \,P_2$ to $\displaystyle \,D$: .move right $\displaystyle \Delta x$ and down $\displaystyle \Delta y.$
. . Hence: .$\displaystyle D(x_2\!+\!\Delta x,\;y_2\!\!\Delta y)$