0

Im using code from Dance of Venus (and variations) in TikZ/PGF

Im using

\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
    draw for t=0 upto 359: 108 dir 13t - 147 dir 8t .. endfor cycle;
endfig;
\end{mplibcode}
\end{document}

It draws the dance of the planets in the geocentric system. It works perfect but with small numbers. When Im trying to draw the dance of Neptune and Pluto it doesnt work.

Neptune
Orbital Period - 163.7:1 (Ratio)
Distance from Neptune to Sun - 4.4742 billion km - which is 4474 scaled

Pluto
Orbital Period - 247.9:1(Ratio)
Distance from Neptune to Sun - 5.9060 billion km - which is 5906 scaled

So when I try to draw the dance for example for Neptune it does not work

\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
    draw for t=0 upto 359: 4474 dir 1t - 147 dir 164t .. endfor cycle;
endfig;
\end{mplibcode}
\end{document}

Can some1 help me?:)
Maybe I should use different ratios or something?
I have almost all the dances of the planets but im missing only 3:
Juno
Neptune
Pluto

Planetary Fact Sheet(NASA)
https://nssdc.gsfc.nasa.gov/planetary/factsheet/planet_table_ratio.html

Thruston
  • 42,268

1 Answers1

1

First you need to allow the luamplib to deal with big numbers (greater than 4096), so add this

\mplibnumbersystem{double}

to the pre-amble of your document. (See this Q for more details about options). But then, you will find that the result looks a bit weird because you do not have enough points on the path to make smooth curves. So you will need to do something like this:

\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibnumbersystem{double}
\begin{mplibcode}
beginfig(1);
    numeric s; s = 1/8;
    draw for t=0 step s until 360 - s: 4474 dir 1t - 147 dir 164t .. endfor cycle;
endfig;
\end{mplibcode}
\end{document}

This will look better, but the figure will be huge, so you might want to scale it directly:

\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibnumbersystem{double}
\begin{mplibcode}
beginfig(1);
    numeric s; s = 1/8;
    draw (for t=0 step s until 360 - s: 4474 dir 1t - 147 dir 164t .. endfor cycle) scaled 1/32;
endfig;
\end{mplibcode}
\end{document}

Note: you need to compile this with lualatex so that you can use the luamplib library.

Thruston
  • 42,268