I am trying to draw a ripple pendulum similar to the below diagram but have absolutely no idea how to start, or even if it can be done in LaTeX? Another complication is I need it to have a purple background


Here is the diagram I am trying to draw. Thank you for any help or guidance :) enter image description here

  • Without any source code we can use for testing we cannot help. – daleif Aug 19 '15 at 10:01
  • 1
    Why don't you ask the author of this pic for the code? It looks like TeX to me. – LaRiFaRi Aug 19 '15 at 10:06
  • 3
    It is possible. You can try to use TikZ To draw it. But should not expect someone to do it for you if you don't give a try. – mvienney Aug 19 '15 at 10:07
  • 3
    You can start with: tex.stackexchange.com/questions/219038/… – Ignasi Aug 19 '15 at 10:07
  • 2
    @Bernard or is it white and gold? – Thruston Aug 19 '15 at 14:08

One LaTeX-friendly tool for doing this type of drawing is MetaPost. Getting started details are in the linked answer.

One technique for filling the background of an image, is to save the whole drawing in a picture variable, and then fill the bbox of the picture with the background colour, and then draw the picture on top.

Here's an example using a version of the OP image.

enter image description here

prologues := 3;
outputtemplate := "%j%c.eps";


u = 1.4cm;

numeric theta[];
theta1 = 12;
theta2 = 24;
theta3 = 36;

path segment[];
segment1 = (origin -- down) scaled 1.2u rotated theta1;
segment2 = (origin -- down) scaled 1.2u rotated theta2 shifted point 1 of segment1;
segment3 = (origin -- down) scaled 1.2u rotated theta3 shifted point 1 of segment2;

picture pendulum;
pendulum = image(
    draw (left--right) scaled 2u;
    for i=1 upto 3:
      draw segment[i];
      draw (origin--down) scaled 1u
                          shifted point 0 of segment[i] 
                          dashed withdots scaled 1/3;
      label.urt(btex $\ell$ etex, point 1/2 of segment[i]);
      label.urt(btex $m$    etex, point   1 of segment[i]);
      draw subpath(0, 1/45 (theta[i]-8)) of fullcircle 
           rotated 274 scaled .6u shifted point 0 of segment[i]
           withpen pencircle scaled .3;  
    for i=1 upto 3:
      fill fullcircle scaled 4 shifted point 1 of segment[i] withcolor .87 blue;
    label(btex $\theta_1$ etex scaled 0.8, point 0 of segment1 shifted (-6,-12));
    label(btex $\theta_2$ etex scaled 0.8, point 0 of segment2 shifted ( 6,-25));
    label(btex $\theta_3$ etex scaled 0.8, point 0 of segment3 shifted ( 8,-20));

bboxmargin := 10;
fill bbox pendulum withcolor .2[white,blue];
draw pendulum;

| improve this answer | |
  • A more friendly version of MetaPost-like drawing is asymptote (C-like syntax, OOP; handles LaTeX labels (even random math) cleanly). – vonbrand Aug 24 '15 at 19:16
  • 1
    @vonbrand, ha ha! those are the reasons I don't like Asymptote... but let's not start another my tool is better than your tool discussion. Why not provide an Asy version of the OP diagram as another answer? – Thruston Aug 24 '15 at 22:37

This a TiKZ solution


angle eccentricity=1.2,
ball/.style={circle, inner sep=0pt, minimum size=2mm, fill=blue, draw=blue, label=right:$m$},
background rectangle/.style={fill=purple!20},
show background rectangle]

\draw[thick] (-2,0) --(2,0);
\draw (0,0) coordinate (b0) foreach \i [count=\ni] in {-70,-55,-30} {--++(\i:2cm) node[midway,auto]{$l$} node[ball] (b\ni) {}};

\foreach \i [count=\auxi] in {b0,b1,b2}{
    \draw[dashed] (\i)--++(-90:1.8cm) coordinate[pos=.75] (aux\auxi);

\draw pic["$\theta_1$", draw, angle radius=1.2cm] {angle=aux1--b0--b1};
\draw pic["$\theta_2$",draw, angle radius=1.2cm] {angle=aux2--b1--b2};
\draw pic["$\theta_3$",draw, angle radius=1.2cm] {angle=aux3--b2--b3};



enter image description here

| improve this answer | |

Here is a pstricks solution:




    \psset{unit = 1.25, dotsize=5pt, dash=2pt 1.5pt, shortput=nab, linewidth=1pt}
    \uput [20](P1){$m$}
    \AplusB(P1)(Q2){P2}\uput [20](P2){$m$}
    \AplusB(P2)(1.5; -35){P3}\uput [20](P3){$m$}
    \psset{labelsep=2pt, linecolor=LightSteelBlue3}
    \psset{linewidth=0.4pt, linecolor=black}


enter image description here

| improve this answer | |
  • 1
    +1 Because of the color choice. I always like your colors :) – Manuel Aug 24 '15 at 17:30

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.