5

I know how to draw a simple line using TIKZ but I'm interested to draw something similar to the picture below, between two nodes.enter image description here

Later edit: Just to complicate it a little bit, let's suppose there are 3 nodes at positions: (0,0) (5,-1) and (3,-3). All this nodes needs to be connected by a serial connection.

PS: I'm very new to Latex.

1 Answers1

0
\begin{tikzpicture}
    \draw [help lines] (0,0) grid (5,5);
    \fill [red] (0.5,0.3) circle (2pt);
    \fill [blue] (4.7,4.8) circle (2pt);
    \coordinate (a) at ($ (0.5,0.3)!0.52! 1.5:(4.7,4.8) $);
    \coordinate (b) at ($ (4.7,4.8)!0.52! 1.5:(0.5,0.3) $);
    \draw[thick,purple] (0.5,0.3) -- (a) -- (b) -- (4.7,4.8);
\end{tikzpicture}

This the way to do it, based on the distance between point I need to change the angle and the percent from point to make them look somehow identical between all nodes.

enter image description here