I am new to TikZ and am working on a FBD, using relative points. I would like to add new x,y-axes to every new change in direction. I have tried something similar to what's found here: Projectile Motion Diagram using PGFplots/tikz?
However, this doesn't seem to work for relative points (I could of course be missing something that's obvious).
\documentclass{article}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{scopes}
\begin{document}
\def\fangle{148}
\def\llangle{38}
\def\ulangle{185}
\def\ubangle{31}
\def\flength{1.6cm}
\def\lllength{3.5cm}
\def\ullength{3.8cm}
\def\ublength{5.6cm}
\begin{tikzpicture}[
% force lines
force/.style={>=latex,draw=blue,fill=blue},
% axis lines
axis/.style={densely dashed,gray,font=\small},
% foot
F/.style={thick}
% lower leg
LL/.style={thick}
% upper leg
UL/.style={thick}
% upper body
UB/.style={thick}
]
\draw[blue,line width=2pt] (0,0) -- (\fangle:\flength) -- ++ (\llangle:\lllength) -- ++ (\ulangle:\ullength) -- ++ (\ubangle:\ublength);
%\draw[axis,->] (0,0) -- (1,0);
\end{tikzpicture}
\end{document}
Edit 2: I tried changing the points to coordinates using relative coordinates, so I could then put the axes off the coordinate points. However, nothing appears, even though the typeset was successful.
\coordinate (O) at (0,0);
\coordinate (F) at (O) -- ++ (\fangle:\flength);
\coordinate (LL) at (F) -- ++ (\llangle:\lllength);
\coordinate (UL) at (LL) -- ++ (\ulangle:\ullength);
\coordinate (UB) at (UL) -- ++ (\ubangle:\ublength);
\draw[blue, line width = 2pt] (O) -- ++ (F) -- ++ (LL) -- ++ (UL) -- ++ (UB);
Edit 3: This works to name the coordinates. However, now I need to figure out how to use them to add the axes to each change in direction. The FBD will look something like the picture, found below. So help with how to label, etc would be much appreciated as well! Though, I believe I will be able to figure that out, once I can get the axes to work.
\draw[blue,line width=2pt] (0,0) coordinate (O) node[red]{.} -- ++ (\fangle:\flength) coordinate (F) node[red]{.} -- ++ (\llangle:\lllength) coordinate (LL) node[red]{.} -- ++ (\ulangle:\ullength) coordinate (UL) node[red]{.} -- ++ (\ubangle:\ublength) coordinate (UB)node[red]{.};
