I am drawing some force diagrams, and would really like the ability to draw a small right triangle on a line, like in the snapshot below.
Right now I'm drawing my force vectors like so:
\draw[force,->] (O) -- (C)
node[below] {$F_1 = \SI{850}{\newton}$};
I tried to create another node node[midway] (midPoint) {}
, then \draw (midPoint) -- ++(0,-3mm) -- ++(4mm,0)
however, there is some ugly gap between the vector and this tiny triangle.
Is there a library that I don't know about to help create annotations like these? Or perhaps more idiomatic tikz way of doing this?
Thanks for your time!
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
EDIT: So I repurposed a tangentially related answer (Triangle as constraints in structural engineering) to some extent:
RightAngle/.style=
{
decoration={
markings,
mark=at position 0.5 with {
\draw[-, thin] (0,0) -- (0,-3mm)
node[midway, left] {\tiny 3};
\draw[-,thin] (0,-3mm) -- (4mm, 0)
node[midway, below] {\tiny 4};
}
},
postaction=decorate
}
\draw[force,->, RightAngle] (O) -- (C)
node[below right] {$F_1 = \SI{850}{\newton}$};
Which gets me almost there! However I'm still missing something to do with the new local coordinate system. How do I make that 3 leg come straight down (relative to the standard coordinate system)?
\documentclass
and the appropriate packages so that those trying to help don't have to recreate it.