1

I would like to produce the following Brachistochrone picture in Latex:

enter image description here

I have searched this site for a Brachistochrone illustration that I might modify and found:

Coding brachistochrone curve in Metapost

After many unsuccessful attempts at modifying the code (though it was the first time I was able to figure out how to even run Metapost code), it decided to post this question. Any help in helping me to produce the first image (preferably Latex which I am familiar with) is appreciated.

Thank you.

DDS
  • 8,816
  • 4
  • 9
  • 36

1 Answers1

4

Here's a more modern version of my old answer, showing how to draw approximations to the other curves. This is wrapped up in luamplib to you need to compile it with lualatex. For more information about Metapost follow this link.

enter image description here

\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
    pair A, B;
    A = (-1,1) scaled 300;
    B = origin;
draw A -- (xpart A, ypart B) -- B withpen pencircle scaled 1/4 withcolor 3/4 white;

path p[];
p1 = A -- B;  % line

% circular
z0 = (xpart B, ypart A);
p2 = quartercircle rotated 180 scaled 2 abs (z0-B) shifted z0;

% parabola f = x^2, f' = 2x
p3 = A{1,-2} ... (xpart 1/2[A, B], ypart 3/4[A, B]){1,-1} ... B {1, 0};

% sixth degree f = x^6, f' = 6x^5 
p4 = A{1,-6} ... (xpart 1/2[A, B], ypart 63/64[A, B]){1, -6/32} ... B {1, 0};

r = 172; % <- a magic number...
p5 = (origin for t=5 step 5 until 180: -- (0,r) rotated t shifted ((t/57.29578,-1) scaled r) endfor) 
     shifted A cutafter ((up--down) scaled 10 shifted B);


drawoptions(withcolor 2/3 red);         draw p1; dotlabel.urt("Line", point 1/4 of p1);
drawoptions(withcolor 1/2 green);       draw p2; dotlabel.urt("Circle", point 1 of p2);
drawoptions(withcolor 1/4[red, green]); draw p3; dotlabel.urt("Parabola", point 1/2 of p3);
drawoptions(withcolor 3/4[red, green]); draw p4; dotlabel.llft("Sixth degree", point 3/4 of p4);
drawoptions(withcolor 1/2 blue);        draw p5; dotlabel.urt("Cycloid", point 22 of p5);

drawoptions();
dotlabel.ulft("$A$" , A);
dotlabel.urt("$B$", B);

endfig; \end{mplibcode} \end{document}

Notes

  • Making the cycloid pass through point B required some trial and error, hence the magic number 172 in the middle. If I can think of a more robust approach I will update this.

  • To draw approximations of the parabola and the x^6 line, I have just picked three points along them and added the appropriate direction syntax {x,y} so that the curves are doing in the right direction. To get more faithful lines you would have to add more points, but I thought that the sketches would be ok here.

Thruston
  • 42,268