5

I want to draw the following diagram :
enter image description here

I have tried to draw the diagram using the following command :

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw[dotted] (-4,-3) grid (4,7);
\draw[thick] (0,0) ellipse (2cm and 0.5cm);
    \draw[thick,->] (0,1) to [in=1, out=1](2,1.5)--(-2,2)--(2,2.5)--(-2,3)--(2,3.5)--(0,4);
 \end{tikzpicture}
\end{document}  

This yields :
enter image description here But it does not give the actual diagram which I want. How can I draw the required diagram using TiKZ?

  • Search the site for spiral or coil – percusse Oct 2 '14 at 12:14
5

Only new thing is the use of bending library to have bent arrow head.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{decorations.markings}
\usetikzlibrary{arrows.meta,bending}
\begin{document}
\begin{tikzpicture}
\draw[dotted] (-4,-3) grid (4,7);
\draw[thick] (0,0) ellipse (2cm and 0.5cm);
    \draw[thick,decoration={aspect=0.31, segment length=7mm,
     amplitude=2cm,coil},decorate,arrows = {<[bend]-}] (0,4) --(0,1);
\node[draw,fill=white,circle,inner sep=1pt] at (0,1){};
 \end{tikzpicture}
\end{document}

enter image description here

4

An easy way to plot a spiral is to use parametric equations, i.e.,

t = [0..2*n*pi]
x = sin(t)
y = cos(t)
z = t

Very naively speaking, in this form, n indicated the number of spiral rounds and x,y coordinate is actually a circle. By providing some coefficient to the equation one can make conical spirals or generate clockwise/counter-clockwise spirals. I will leave the study of math to you. Here is a basic starting point that you can modify it meet your requirements.

\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis} [
    view={0}{30},
    axis lines=none,
    ymin=-2,
    ymax=5,
    xmin=-2,
    xmax=2]

    \addplot3 [thick, ->, blue, domain=3:7*pi, samples = 100, samples y=0] ({sin(deg(-x))}, {cos(deg(-x))}, {x});
    \addplot3 [thick, red , domain=0:2*pi, samples = 100, samples y=0] ({sin(deg(x))}, {cos(deg(x))}, -3);
    \addplot3 [thick, only marks, blue, mark=o] ({sin(deg(-3))}, {cos(deg(-3)}, {3});
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

By playing around the gains, parameters and the axis view, you can generate what you want.

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.