I borrowed some code on Kepler's 2nd Law from the linked post here on TeX answered by Tosco. I haven't compiled the document it is in awhile but needed today. When I did, I was told dimension too large. The dimension too large points to the following lines:
% \draw[very thin,->](\oldx,\ol dy)--++(\forcex,\forcey);
\ifnumgreater{(\n - \startone) * (\endone - \n)}{-1}
Prior to some update(not sure which one broke it), this code compiled and worked correctly. Now it doesn't. What can be done about this?
\documentclass[convert = false, tikz]{standalone}
\usepackage{amsmath}
\usepackage{etoolbox}
\usetikzlibrary{backgrounds}
\begin{document}
\gdef\myposx{10.0}
\gdef\myposy{0.0}
\gdef\vx{0.0}
\gdef\vy{4.6}
\gdef\forcefactor{150}
\gdef\deltat{0.025}
\gdef\smallmass{1}
\gdef\startone{100}
\gdef\endone{200}
\gdef\starttwo{1800}
\gdef\endtwo{1900}
\gdef\pathone{}
\gdef\pathtwo{}
\begin{tikzpicture}[scale = .2]
\filldraw(0, 0) circle [radius = 0.5cm];
\foreach \n in {1, ..., 3625}
{
\pgfextra{%
\global\let\oldx\myposx
\global\let\oldy\myposy
\pgfmathsetmacro{\currentsquareddistance}{\myposx * \myposx + \myposy *
\myposy}
\pgfmathsetmacro{\currentforce}{\forcefactor / \currentsquareddistance}
\pgfmathsetmacro{\currentangle}{atan2(\myposx, \myposy)}
\pgfmathsetmacro{\currentforcex}{-1 * \currentforce * cos(\currentangle)}
\pgfmathsetmacro{\currentforcey}{-1 * \currentforce * sin(\currentangle)}
\pgfmathsetmacro{\currentvx}{\vx + \deltat * \currentforcex / \smallmass}
\pgfmathsetmacro{\currentvy}{\vy + \deltat * \currentforcey / \smallmass}
\pgfmathsetmacro{\currentposx}{\myposx + \deltat * \currentvx}
\pgfmathsetmacro{\currentposy}{\myposy + \deltat * \currentvy}
\global\let\myposx\currentposx
\global\let\myposy\currentposy
\global\let\vx\currentvx
\global\let\vy\currentvy
\global\let\forcex\currentforcex
\global\let\forcey\currentforcey
\global\let\myangle\currentangle
\ifnumequal{\n}{\startone}{%
\global\let\startonex\oldx
\global\let\startoney\oldy
\xappto{\pathone}{(\oldx, \oldy)}
}{}
\ifnumequal{\n}{\starttwo}{%
\global\let\starttwox\oldx
\global\let\starttwoy\oldy
\xappto{\pathtwo}{(\oldx, \oldy)}
}{}
\ifnumequal{\n}{\endone}{%
\global\let\endonex\myposx
\global\let\endoney\myposy
\xappto{\pathone}{,(\myposx,\myposy)}
}{}
\ifnumequal{\n}{\endtwo}{%
\global\let\endtwox\myposx
\global\let\endtwoy\myposy
\xappto{\pathtwo}{,(\myposx, \myposy)}
}{}
}
% \draw[very thin,->](\oldx,\ol dy)--++(\forcex,\forcey);
\ifnumgreater{(\n - \startone) * (\endone - \n)}{-1}
{
\pgfextra{%
\xappto{\pathone}{,(\myposx, \myposy)}
}
}
{}
\ifnumgreater{(\n - \starttwo) * (\endtwo - \n)}{-1}
{
\pgfextra{%
\xappto{\pathtwo}{,(\myposx, \myposy)}
}
}
{}
\draw(\oldx, \oldy)--(\myposx, \myposy);
}
\begin{scope}[on background layer]
\filldraw[blue, opacity = .5] (0, 0)%
\foreach \point in \pathone
{%
--\point
}--(0, 0);
\filldraw[blue, opacity = .5] (0, 0)%
\foreach \point in \pathtwo
{%
--\point
}--(0, 0);
\end{scope}
\end{tikzpicture}
\end{document}



tikzmaintainers changed the implementation of theatan2function and introduced some bug in the process... – jub0bs Apr 16 '14 at 01:27