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.
Asked
Active
Viewed 367 times
1
-
1Welcome to TeX.SE!!. Perhaps this post can be useful: https://tex.stackexchange.com/questions/54824/appending-a-line-of-fixed-length-to-a-spring-drawn-with-tikz-coil – Juan Castaño Apr 20 '21 at 05:09
-
Yeah those are the ones I tried to use but I have no clue how to turn it the orientation that I want. – user240220 Apr 20 '21 at 05:25
-
Did the provided answer solve your problem? If yes, consider accepting/upvoting it. – Dr. Manuel Kuehner Apr 21 '21 at 01:47
-
Did the provided answer solve your problem? If yes, consider accepting/upvoting it. – Dr. Manuel Kuehner May 04 '21 at 05:47
1 Answers
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}
Roland
- 6,655

