1

I would like to create the following image in tikz.

enter image description here

I am completely new to it, so I tried to change the code at http://www.texample.net/tikz/examples/free-body-diagrams/

to

\def\iangle{90} 

\def\down{-90}
\def\arcr{0.5cm} 
\begin{tikzpicture}[
    force/.style={>=latex,draw=blue,fill=blue},
    axis/.style={densely dashed,gray,font=\small},
    M/.style={rectangle,draw,fill=lightgray,minimum size=0.5cm,thin},
    m/.style={rectangle,draw=black,fill=lightgray,minimum size=0.3cm,thin},
    plane/.style={draw=black,fill=blue!10},
    string/.style={draw=red, thick},
    pulley/.style={thick},
]

\matrix[column sep=1cm] {
   \draw[plane] (0,-1) coordinate (base)
                     -- coordinate[pos=0.5] (mid) ++(\iangle:3) coordinate (top)
                     |- (base) -- cycle;
    \path (mid) node[M,rotate=\iangle,yshift=0.5cm] (M) {};
&
    %%%
    % Free body diagram of M2 pulley
    \draw[pulley] (top) -- ++(\iangle:0.25) circle (0.5cm)
                   ++ (90-\iangle:0.5) coordinate (pulley);
    \draw[string] (M.east) -- ++(\iangle:2.0cm) arc (90+\iangle:0:0.25)
                  -- ++(0,-1) node[m] {};
\\
};
\end{tikzpicture}

but I am not close. Some basic pointers would be appreciated.

  • A matrix is used to align an array of nodes. You definitely don't want \draws inside. (base), (mid) and (top) are undefined. – John Kormylo Sep 26 '18 at 13:03
3

Something like this:

enter image description here

Here is the code:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}
\begin{document}

\begin{tikzpicture}[>=Latex]
   \draw[thick] (0,0) circle (10mm);
   \draw[thick,->](-1,0)--++(0,-2)node[below]{$T_2$};
   \draw[thick,->](1,0)--++(0,-2)node[below]{$T_2$};
   \draw[thick,->](0,0)--++(0,2)node[above]{$T_1$};
\end{tikzpicture}

\end{document}

The \usetikzlibrary{arrows.meta} and >=Latex are to give the latex arrow heads in the OP.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.