I am trying to visualize Keplers second law of planetary motion with tikz.
I managed to do the following:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw [rotate around={0:(1.5,0)}] (1.5,0) ellipse (2.5cm and 2cm);
%
\fill (0,0) coordinate (O) circle (2pt) node[below =7pt] {sun};%
\coordinate (A1) at (1.62,2) ;%%
\coordinate (A2) at (2.15,1.93);%%
\coordinate (B1) at (-0.81,0.77);%%
\coordinate (B2) at (-0.9,0.56);%%
\coordinate (B3) at (-0.95,0.39);%%
\coordinate (B4) at (-0.99,0.14);%%
\coordinate (B5) at (-1,-0.05);%%
\coordinate (B6) at (-0.97,-0.31);%%
\coordinate (B7) at (-0.92,-0.52);%%
%
%
\coordinate (C1) at (3.25,-1.43);%%
\coordinate (C2) at (3.51,-1.18);%%
%
\coordinate (P) at (3.42,1.28) ;%%
\fill (P) circle (1pt) node[above right] {planet};%
%
%
\filldraw[fill=blue,opacity=0.5] (O) -- (A1) -- (A2) --cycle;%
\filldraw[fill=blue,opacity=0.5] (O) -- (B1) -- (B2) -- (B3) -- (B4) -- (B5) -- (B6) -- (B7)
--cycle;%
\filldraw[fill=blue,opacity=0.5] (O) -- (C1) -- (C2) --cycle;%
%
\draw (1.5,0) coordinate (M) --node[above]{\footnotesize $a$}
(4,0);%
\fill (M) circle (1pt);
\end{tikzpicture}
\end{document}
This gives the following output:
However there are multiple issues:
How to fill the ellipse sector?
To fill the ellipse sectors I approximate them with polygons manually, in particular for the "larger" (but of course with equal area) part I used multiple manual "helper points". I did that by first drawing the image with geogebra, exporting it and cleaning up the code a bit. So is there a smart way to fill the true ellipse segment?
How to get the equal areas automatically?
To make the areas of (approximately) same size I roughly measured the approximations with geogebra and adjusted it with the mouse (very painful :-)).
In an ideal solution the following would be possible:
Specify two points of the ellipse (or the corresponding parameter of a parametrization) then the corresponding swept out area is filled automatically.
Specify another point of the ellipse and a corresponding swept out area is drawn automatically (with the same area as the first one). You can do this multiple times as you like.
It should be easy to modify the picture
For example when I change the sizes of the axes of the ellipse everything should change accordingly. This is not true in my solution because I specified the points manually.
Perhaps it is a good idea to externalize some calculations for this. That's why I added the luatex and python tags.
Edit: