1

I am attempting to make this into a Tikz Picture but it seemed like copy pasting stuff until it worked out didn't seem to work for me this time so would anyone be able to help me out to make this in LaTeX? Currently making a few physics questions and I would like to not just copy and paste this drawing on it. Thanks in advance.

Mass-Spring

1 Answers1

3

Here you have something to begin with. The code of the spring was taken from this question from @JohnD e.g. the answer of @user11232.

\documentclass[border=1cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing,patterns}
\usetikzlibrary{calc,patterns,decorations.markings}
\usetikzlibrary{positioning,snakes}

\begin{document}

\begin{tikzpicture}[every node/.style={draw,outer sep=0pt,inner sep=0pt,thick}]

\tikzstyle{spring}=[thick,decorate,decoration={aspect=0.5, segment length=1mm, amplitude=2mm,coil}]

\draw[thick] (0,0) --(0,3); \draw[thick] (0,0) --(3,0) node[draw=none,xshift=5pt]{\tiny $x$};

\node at(0,0.25) (a) [draw=none] {}; \node at (2,0.25)(b) [minimum size=0.5cm,label=$\rightarrow$] {m};

\draw [spring] (a) -- (b) node[draw=none,pos=.5,right=.25cm] {}; \node at (2,-1)(c) [draw=none,yshift=5pt] {\tiny $x=0$}; \draw[dashed] (b.south) -- (c.north);

\end{tikzpicture} \end{document}

enter image description here

Roland
  • 6,655