summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-05-04 14:39:48 +0000
committerKarl Berry <karl@freefriends.org>2020-05-04 14:39:48 +0000
commit97e420fd95c1f4e34378c64c88428cb7a37486d5 (patch)
tree70b27829587d14a312f01505b634e7712816d57e
parent1460531c2d64c686f544746ecbabf81a08dee43b (diff)
tikz-planets
git-svn-id: svn://tug.org/texlive/trunk@55002 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/tikz-planets/README.md5
-rw-r--r--Master/texmf-dist/doc/latex/tikz-planets/planets-doc.pdfbin54223 -> 167190 bytes
-rw-r--r--Master/texmf-dist/doc/latex/tikz-planets/planets-doc.tex161
-rw-r--r--Master/texmf-dist/tex/latex/tikz-planets/planets.sty328
4 files changed, 375 insertions, 119 deletions
diff --git a/Master/texmf-dist/doc/latex/tikz-planets/README.md b/Master/texmf-dist/doc/latex/tikz-planets/README.md
index 8cfd1cc000f..3fc545aee10 100644
--- a/Master/texmf-dist/doc/latex/tikz-planets/README.md
+++ b/Master/texmf-dist/doc/latex/tikz-planets/README.md
@@ -4,7 +4,7 @@ These files provide the TikZ-planets package that makes it easy to illustrate ce
# Installation
Move the package (.sty file) to a latex search directory if
- you want to be able to use it from any directory. Ask you
+ you want to be able to use it from any directory. Ask your
system administrator if you need help.
# Requirements
@@ -24,4 +24,5 @@ This repository contains the following files:
- README.md, the current file
# License
-Files are shared under the CC-BY-SA 4.0 license. \ No newline at end of file
+Copyright 2020 Isabelle M. Santos
+This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/ \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.pdf b/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.pdf
index 5d3c61634df..970b3f27ba4 100644
--- a/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.pdf
+++ b/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.tex b/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.tex
index 0702461061a..8e694a014a6 100644
--- a/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.tex
+++ b/Master/texmf-dist/doc/latex/tikz-planets/planets-doc.tex
@@ -1,6 +1,18 @@
+% tikz-planets documentation -- illustrate celestial mechanics with TikZ
+% Version 1.0.2
+
+% Isabelle M. Santos
+% This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
+% To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
\documentclass[12pt, twocolumn]{article}
\usepackage{url}
+\usepackage[hidelinks]{hyperref}
\usepackage{planets}
@@ -8,7 +20,7 @@
\title{The TikZ-planets package}
\author{Isabelle M. Santos}
-\date{Version 1.0.1 -- 2020/03/30}
+\date{Version 1.0.2 -- 2020/04/19}
\begin{document}
\maketitle
@@ -35,12 +47,14 @@ Tikz-planets requires the following standard packages to be installed
\end{itemize}
\subsection{License}
-The package can be found at \url{https://framagit.org/Moutmout/tikz-planets.git}. It is under the CC-BY-SA license.
+The package can be found at \url{https://framagit.org/Moutmout/tikz-planets.git}.
+
+This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License. To view a copy of this license, visit \url{http://creativecommons.org/licenses/by-sa/4.0/}.
\section{Usage}
\subsection{Drawing a planet}
Drawing one of the eight solar system planets is rather straightforward, use \verb|\planet[surface=earth]|, replacing the option \verb|earth| with the name of any planet.
-Although they are not planets, the \verb|\planet| command can also be used to draw the Sun and the Moon, by setting the \verb|surface| option.
+Although they are not planets, the \verb|\planet| command can also be used to draw the Sun, the Moon and Pluto, by setting the \verb|surface=<name>| keyword.
\begin{verbatim}
\planet[surface=sun]
@@ -67,31 +81,45 @@ If you need a planet that isn't in the solar system, you can make a generic one
\end{tikzpicture}
\subsection{Rings}
-The four gas giants in the solar system sport a ring.
-In the current version of the package, only Saturn is shown with a ring.
+The four gas giants in the solar system sport a ring, but only Saturn is shown with a ring by default.
+A "Saturn-like" set of rings can be drawn around any planet with the \verb|rings| option.
+A thin ring with a custom radius can be drawn with the \verb|ring=<radius>| option.
+%and a thin ring with the \verb|thin ring| option.
+%Thin rings can be set with a custom radius.
+
+\begin{verbatim}
+\planet[surface=mercury, rings]
+\planet[surface=neptune, ring=1.5]
+\end{verbatim}
+\begin{tikzpicture}
+\planet[surface=mercury, rings]
+\planet[surface=neptune, ring=1.5, centerx=4.4]
+\end{tikzpicture}
\subsection{Rotational characteristics}
Most planets rotate around a set axis that can be tilted with respect to the plane of orbit.
The rotation axis of the Earth, for instance, is tilted by 23.5 degrees.
Uranus spins on its side, with a rotation axis tilted at 90 degrees.
-This can be illustrated using the \verb|tilt| and the \verb|rotation| options.
+This can be illustrated using the \verb|tilt=<angle in degrees>| and the \verb|rotation| options.
+
+Venus rotates in the opposite direction compared to the other planets in the solar system.
+This can be illustrated with the \verb|retrograde| option.
\begin{verbatim}
-\planet[surface=earth, tilt=23.5]
-\planet[surface=uranus, tilt=90, rotation]
-\planet[surface=venus, retrograde, rotation]
+\planet[surface=pluto, tilt=22.5]
+\planet[surface=uranus, tilt=90, rotation,
+ ring=1.7]
+\planet[surface=venus,
+ retrograde, rotation]
\end{verbatim}
\begin{tikzpicture}
-\planet[surface=earth, tilt=23.5]
-\planet[surface=uranus, tilt=90, rotation, centerx=3.3]
+\planet[surface=pluto, tilt=22.5]
+\planet[surface=uranus, tilt=90, rotation, ring=1.7, centerx=3.3]
\planet[surface=venus, rotation, retrograde, centerx=6.6]
\end{tikzpicture}
-Venus rotates in the opposite direction compared to the other planets in the solar system.
-This can be illustrated with the \verb|retrograde| option.
-
\subsection{Phases}
-Half of a planet or moon in in the shadow of the Sun. This can be illustrated with the \verb|phase| keyword, which can take the following values: \verb|new|, \verb|first crescent|, \verb|first half|, \verb|waxing gibbous|, \verb|full|, \verb|waning gibbous|, \verb|last half| or \verb|last crescent|.
+Half of a planet or moon is in the shadow of the Sun. This can be illustrated with the \verb|phase=<name>| keyword, which can take the following values: \verb|new|, \verb|first crescent|, \verb|first half|, \verb|waxing gibbous|, \verb|full|, \verb|waning gibbous|, \verb|last half| or \verb|last crescent|.
\hspace{1em}
@@ -114,15 +142,48 @@ Half of a planet or moon in in the shadow of the Sun. This can be illustrated wi
\node[red, align=center] at (0, -2) {last \\ crescent};
\end{tikzpicture}
+If the phase is specified for a planet with "Saturn-like" rings, then the rings will also be shaded.
+
+\begin{verbatim}
+\planet[surface=saturn,
+ phase=first half, tilt=20]
+\planet[surface=saturn,
+ phase=waxing gibbous, tilt=-20]
+\end{verbatim}
+\begin{tikzpicture}
+\planet[surface=saturn, phase=first half, tilt=20]
+\planet[surface=saturn, phase=waxing gibbous, centerx=4.5, tilt=-20]
+\end{tikzpicture}
+
\subsection{Size and position}
By default, a planet has a radius of $1$ and is centered at $(0, 0)$.
-
To draw schematics illustrating celestial mechanics, it is useful to use several \verb|\planet|s in one figure.
-The position of the center of the planet can be set using the \verb|centerx| and the \verb|centery| keywords.
-The size of the planet is set with the \verb|scale| keyword.
+
+The size of the planet is set with the \verb|scale=<planet radius>| keyword.
+For instance, \verb|scale=2| makes the radius of the planet twice as big.
+
+The position of the center of the planet can be set by specifying the $x$ and $y$ coordinates of the center with the \verb|centerx=<x coordinate>| and/or \verb|centery=<y coordinate>| keywords.
+Alternatively, the coordinates of the planet's center can be set using the \verb|center=<point>| keyword.
+This makes it possible to specify the center of the planet in either cartesian, polar coordinates or named points.
+
+\begin{verbatim}
+\planet[center={(0, 1.5)}, scale=.6]
+\planet[centerx=4, centery = 1]
+\planet[center={(45 : 3)}, scale=1.2]
+\node (A) at (7, 2) {};
+\planet[center={(A)}]
+\end{verbatim}
+\begin{tikzpicture}
+\planet[center={(0, 1.5)}, scale=.6]
+\planet[centerx=4, centery = 1]
+\planet[center={(45 : 3)}, scale=1.2]
+\node (A) at (7, 2) {};
+\planet[center={(A)}]
+\end{tikzpicture}
\onecolumn
\section{Complete examples}
+Here are a few examples of what can be done with the TikZ-planets package. More examples can be found at \url{https://framagit.org/search?utf8=%E2%9C%93&snippets=true&scope=snippet_titles&repository_ref=&search=tikz-planets}.
\subsection{The seasons}
Season's are caused by the tilt of Earth's axis.
This is why summer in the northern hemisphere happens at the same time as winter in the southern hemisphere.
@@ -150,7 +211,7 @@ Half of the Moon is in the shadow of the Sun.
Since the Moon goes around the Earth, the shadows on the near-side of the Moon change.
\begin{verbatim}
- \planet[surface=earth]
+ \planet[surface=earth, phase=first half]
\planet[surface=sun, centerx=10, scale=2]
\planet[surface=moon, phase=first half, centerx=-2.5, scale=.5]
@@ -159,7 +220,7 @@ Since the Moon goes around the Earth, the shadows on the near-side of the Moon c
\planet[surface=moon, phase=first half, centery=2.5, scale=.5]
\end{verbatim}
\begin{tikzpicture}
- \planet[surface=earth]
+ \planet[surface=earth, phase=first half]
\planet[surface=sun, centerx=10, scale=2]
\planet[surface=moon, phase=first half, centerx=-2.5, scale=.5]
@@ -169,34 +230,60 @@ Since the Moon goes around the Earth, the shadows on the near-side of the Moon c
\end{tikzpicture}
\subsection{The solar system}
-You might have learned "My Violent Evil Monster Just Scared Us Nuts" or some other mnemonic to remember the order of the eight (or nine if you're old enough) planets in the solar system.
+You might have learned ``My Violent Evil Monster Just Scared Us Nuts'', ``My Very Excellent Mother Just Served Us Nachos'', or some other mnemonic to remember the order of the eight (or nine if you're old enough) planets in the solar system.
The distances in the following sketch are not to scale, but the radii roughly are.
\begin{verbatim}
\clip (0,-3) rectangle (20, 3);
\planet[surface=sun, scale=28, centerx=-27]
- \planet[surface=mercury, centerx=1.5, scale=.1]
- \planet[surface=venus, centerx=2.5, scale=.25]
- \planet[surface=earth, centerx=3.5, scale=.25]
- \planet[surface=mars, centerx=4.5, scale=.13]
- \planet[surface=jupiter, centerx=8, scale=2.75]
- \planet[surface=saturn, centerx=12, scale=2.3]
- \planet[surface=uranus, centerx=15, scale=1]
- \planet[surface=neptune, centerx=16.8, scale=.97]
+ \planet[surface=mercury, centerx=1.5, tilt=0, scale=.1]
+ \planet[surface=venus, centerx=2.5, tilt=2.6, scale=.25]
+ \planet[surface=earth, centerx=3.5, tilt=23.5, scale=.25]
+ \planet[surface=mars, centerx=4.5, tilt=25.2, scale=.13]
+ \planet[surface=jupiter, centerx=8, tilt=3, scale=2.75]
+ \planet[surface=saturn, centerx=12, tilt=26.7, scale=2.3]
+ \planet[surface=uranus, centerx=15.5, tilt=97.8, scale=1]
+ \planet[surface=neptune, centerx=17.3, tilt=28.3, scale=.97]
\end{verbatim}
\begin{tikzpicture}
\clip (0,-3) rectangle (20, 3);
\planet[surface=sun, scale=28, centerx=-27]
- \planet[surface=mercury, centerx=1.5, scale=.1]
- \planet[surface=venus, centerx=2.5, scale=.25]
- \planet[surface=earth, centerx=3.5, scale=.25]
- \planet[surface=mars, centerx=4.5, scale=.13]
- \planet[surface=jupiter, centerx=8, scale=2.75]
- \planet[surface=saturn, centerx=12, scale=2.3]
- \planet[surface=uranus, centerx=15.5, scale=1]
- \planet[surface=neptune, centerx=17.3, scale=.97]
+ \planet[surface=mercury, centerx=1.5, tilt=0, scale=.1]
+ \planet[surface=venus, centerx=2.5, tilt=2.6, scale=.25]
+ \planet[surface=earth, centerx=3.5, tilt=23.5, scale=.25]
+ \planet[surface=mars, centerx=4.5, tilt=25.2, scale=.13]
+ \planet[surface=jupiter, centerx=8, tilt=3, scale=2.75]
+ \planet[surface=saturn, centerx=12, tilt=26.7, scale=2.3]
+ \planet[surface=uranus, centerx=15.5, tilt=97.8, scale=1]
+ \planet[surface=neptune, centerx=17.3, tilt=28.3, scale=.97]
\end{tikzpicture}
+\twocolumn
+
+\section{Changelog}
+
+\subsection{Version 1.0.2}
+\begin{itemize}
+\item Made planets and wasysym compatible
+\item Possibility to use a point to specify the center of a planet (thus use polar coordinates)
+\item Make a more schematic representation of Jupiter that better fits with the graphical style used for the telluric planets
+\item A ring system can be added around any planet
+\item Ensure the radius of a planet is exactly 1 by default
+\item Thin rings can be drawn with any radius
+\item Draw the phase before rings to avoid having a strange shadow on the rings
+\item Rings typically are in the equatorial plane of their planet: make rings tilt with axial tilt
+\item Use solid color rather than shading for rings so that they have the same appearance when tilted
+\item Added Pluto
+\item Added shading to the rings for each phase
+\item Fixed documentation typos
+\end{itemize}
+\subsection{Version 1.0.1}
+\begin{itemize}
+\item Crescent and gibbous phases
+\item Added Mercury, Venus, Jupiter, Saturn, Uranus and Neptune surfaces
+\item Rotation can now be retrograde
+\item Color used no longer depends on x11names
+\end{itemize}
\end{document} \ No newline at end of file
diff --git a/Master/texmf-dist/tex/latex/tikz-planets/planets.sty b/Master/texmf-dist/tex/latex/tikz-planets/planets.sty
index 6fcc37304e2..a0717ad2620 100644
--- a/Master/texmf-dist/tex/latex/tikz-planets/planets.sty
+++ b/Master/texmf-dist/tex/latex/tikz-planets/planets.sty
@@ -1,6 +1,19 @@
-\ProvidesPackage{planets}
+% Package tikz-planets -- illustrate celestial mechanics with TikZ
+% Version 1.0.2
+
+% Isabelle M. Santos
+% This work is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License.
+% To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/4.0/
+
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+\ProvidesPackage{planets}[2020/04/19 v1.0.2 celestial mechanics with Tikz]
\RequirePackage{tikz}
+\usetikzlibrary{decorations.pathmorphing}
+
\RequirePackage{xstring}
% Colors %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -18,6 +31,8 @@
\definecolor{neptune4}{rgb}{.12, .56, 1}
\definecolor{neptune5}{rgb}{.42, .35, .8}
\definecolor{neptune_white}{rgb}{94, 1, 1}
+\definecolor{pluto1}{rgb}{.82, .77, .71}
+\definecolor{pluto2}{rgb}{.24, .18, .11}
\definecolor{brownish}{rgb}{.7, .58, .42}
\definecolor{wheat}{rgb}{.96, .87, .7}
@@ -30,27 +45,38 @@
% Keys %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newif\ifrotation
+\newif\ifequator
+\newif\ifaxis
\newif\ifretrograde
-\newif\ifring
+\newif\ifrings
\RequirePackage{pgfkeys}
\pgfkeys{
/planet/.is family, /planet,
- surface/.estore in = \surface,
- tilt/.estore in = \tilt,
- phase/.estore in = \phase,
+ surface/.estore in = \surfacename,
+ tilt/.estore in = \axialtilt,
+ phase/.estore in = \planetphase,
rotation/.is if = rotation,
+ equator/.is if = equator,
+ axis/.is if = axis,
retrograde/.is if = retrograde,
+ rings/.is if = rings,
+ ring/.estore in = \ringradius,
color/.estore in = \mycolor,
- centerx/.estore in = \centerx,
- centery/.estore in = \centery,
- scale/.estore in = \scale,
+ center/.code={\pgfkeyssetvalue{center}{#1}\pgfkeysgetvalue{center}{\planetcenter}},
+ centerx/.estore in = \planetcenterx,
+ centery/.estore in = \planetcentery,
+ scale/.estore in = \planetscale,
default/.style = {
surface = none,
tilt = 0,
phase = full,
rotation = false,
+ equator = false,
+ axis = false,
retrograde = false,
+ rings = false,
+ ring =,
color = cyan,
centerx = 0,
centery = 0,
@@ -69,8 +95,8 @@
}
\newcommand{\addrotation}{%
- % equator arrow
\ifretrograde
+ % equator arrow
\draw [->, very thick] (0, 0) -- (-0.4, 0);
% axis arrow
@@ -84,7 +110,7 @@
\fi
}
-\newcommand{\addphase}[1]{%
+\newcommand{\addsurfacephase}[1]{%
\IfEqCase{#1}{%
{new}{\fill [opacity=0.6, black] (0, 0) circle (1);}
{first half}{\fill [opacity=0.6, black] (90:1) arc (90:270:1) -- cycle;}
@@ -99,13 +125,78 @@
}
}
+\newcommand{\drawringpath}[1]{
+ \path[#1, even odd rule]
+ (0, 0) circle [x radius = 1.3, y radius = .13]
+ (0, 0) circle [x radius = 1.7, y radius = .17]
+ (0, 0) circle [x radius = 1.75, y radius = .175]
+ (0, 0) circle [x radius = 2.1, y radius = .21];
+}
+\newcommand{\addringphase}[1]{%
+ \IfEqCase{#1}{%
+ {new}{
+ \clip (-.85, -.25) -- (.85, -.25) -- (1, 0) -- (-1, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {first half}{
+ \clip (-1, -.1) -- (-1, .1) -- (-2.2, 0) -- (-2.2, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {last half}{
+ \clip (1, -.1) -- (1, .1) -- (2.2, 0) -- (2.2, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {first crescent}{
+ \clip (-1.1, 0) -- (-1.5, -.22) -- (0, -.22) -- (1, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {last crescent}{
+ \clip (1.1, 0) -- (1.5, -.22) -- (0, -.22) -- (-1, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {waxing gibbous}{
+ \clip (-1.2, 0) -- (-1.5, .22) -- (0, .22) -- (1, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {waning gibbous}{
+ \clip (1.2, 0) -- (1.5, .22) -- (0, .22) -- (-1, 0) -- cycle;
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {top half}{
+ %pass
+ }
+ {bottom half}{
+ \drawringpath{inner color=black, outer color=black, opacity=.6}
+ }
+ {full}{
+ %pass
+ }
+ }
+}
+\newcommand{\addrings}{%
+ \drawringpath{inner color=yellowish!90!black,outer color=yellowish!90!black}
+}
+
+\newcommand{\addthinring}[1]{%
+
+ \def\a{#1}
+ \def\b{\a/7}
+ \def\x{ sqrt( (\a*\a-\b*\b*\a*\a) / (\a*\a-\b*\b) ) }
+ \def\y{ sqrt( 1 - (\a*\a-\b*\b*\a*\a) / (\a*\a-\b*\b) ) }
+
+ \begin{scope}
+ \clip (-{\x}, 0) -- ({\x}, 0) -- ({\x}, 1) --({{\a}}, 1) -- ({\a}, -1) -- (-{\a}, -1) -- (-{\a}, 1) -- (-{\x}, 1) -- (-{\x}, 0) -- cycle;
+ \draw[gray] (0, 0) circle ({\a} and {\b});
+ \end{scope}
+}
+
% Surfaces %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\sun}{%
+\newcommand{\sunsurface}{%
\draw [yellow!50, ultra thick, fill=yellow!85!red] (0, 0) circle (1);
}
-\newcommand{\mercury}{%
+\newcommand{\mercurysurface}{%
\draw [gray!70!black, ultra thick, fill=gray] (0, 0) circle (1);
\draw [mercury_crater_edge, fill=mercury_crater] ( 0.5 , 0.56 ) circle ( 0.094 );
@@ -124,10 +215,10 @@
\draw [mercury_crater_edge, fill=mercury_crater] ( 0.61 , -0.14 ) circle ( 0.03 );
\draw [mercury_crater_edge, fill=mercury_crater] ( 0.7 , -0.16 ) circle ( 0.01 );
- \draw [mercury_crater_edge, fill=mercury_crater] ( -0.32 , -0.29 ) circle ( 0.02 );
\draw [mercury_crater_edge, fill=mercury_crater] ( -0.47 , -0.41 ) circle ( 0.08 );
\draw [mercury_crater_edge, fill=mercury_crater] ( -0.2 , -0.87 ) circle ( 0.07 );
\draw [mercury_crater_edge, fill=mercury_crater] ( -0.78 , -0.17 ) circle ( 0.03 );
+ \draw [mercury_crater_edge, fill=mercury_crater] ( -0.32 , -0.29 ) circle ( 0.02 );
\draw [mercury_crater_edge, fill=mercury_crater] ( -0.57 , -0.66 ) circle ( 0.02 );
\draw [mercury_crater_edge, fill=mercury_crater] ( -0.38 , 0.49 ) circle ( 0.1 );
@@ -145,11 +236,11 @@
color(1.7cm)=(venus2!90!black);
color(1.9cm)=(venus1)
}
-\newcommand{\venus}{%
+\newcommand{\venussurface}{%
\draw [color=brown!40, shading=Venus, ultra thick] (0, 0) circle (1);
}
-\newcommand{\earth}{
+\newcommand{\earthsurface}{
% Globe
\draw [fill=cyan] (0,0) circle (1);
@@ -168,11 +259,11 @@
\draw [neptune3, ultra thick] (0,0) circle (1);
}
-\newcommand{\moon}{%
- % Disque
+\newcommand{\moonsurface}{%
+ % Disc
\draw [fill=gray!30] (0, 0) circle (1);
- % Crateres
+ % Craters
\draw [gray!60, ultra thick, fill=gray!55] (-.55, .2) circle (.4);
\draw [gray!65, ultra thick, fill=gray!60] (-.1, .65) circle (.3);
@@ -183,18 +274,18 @@
\draw [gray!55, ultra thick, fill=gray!50] (.2, -.2) circle (.2);
- % Petits crateres
+ % Small craters
\draw [gray, very thick, fill=gray!80] (.1, -.7) circle (.05);
\draw [gray, very thick, fill=gray!80] (.8, -.2) circle (.05);
\draw [gray, very thick, fill=gray!80] (-.3, .7) circle (.05);
\draw [gray, very thick, fill=gray!80] (-.1, .6) circle (.05);
\draw [gray, very thick, fill=gray!80] (-.2, 0) circle (.05);
- % Bord
+ % Edge
\draw [gray!40, ultra thick] (0, 0) circle (1);
}
-\newcommand{\mars}{%
+\newcommand{\marssurface}{%
\draw [fill=red!50!brown] (0, 0) circle (1);
% Poles
@@ -205,6 +296,25 @@
\draw [color=red!60!black, ultra thick] (0, 0) circle (1);
}
+\newcommand{\jupitersurface}{
+ \draw[color=brown!60, fill=brown!20, ultra thick] (0, 0) circle (1);
+
+ %Stripes
+ \clip (0, 0) circle (1);
+ \fill [color=brown!70, decorate, decoration={snake, segment length=5, amplitude=.2, post length=0}] (-1.2, -.25) -- (1.1, -.25) -- (1.1, .25) -- (-1.2, .25) -- cycle;
+
+ \fill [color=brown!70, decorate, decoration={snake, segment length=5, amplitude=.2, post length=0}] (130:1) -- (50:1) -- (50:2) arc (50:130:2) -- cycle;
+ \fill [color=brown!70, decorate, decoration={snake, segment length=5, amplitude=.2, post length=0}] (130:-1) -- (50:-1) -- (50:-2) arc (50:130:-2) -- cycle;
+
+ \fill [color=brown!30, decorate, decoration={snake, segment length=5, amplitude=.2, post length=0}] (-1.2, -.03) -- (1.1, -.03) -- (1.1, .03) -- (-1.2, .03) -- cycle;
+
+ \fill [color=brown!50, decorate, decoration={snake, segment length=5, amplitude=.2, post length=0}] (-1.2, .5) -- (1.1, .5) -- (1.1, .54) -- (-1.2, .54) -- cycle;
+ \fill [color=brown!50, decorate, decoration={snake, segment length=5, amplitude=.2, post length=0}] (-1.2, -.5) -- (1.1, -.5) -- (1.1, -.54) -- (-1.2, -.54) -- cycle;
+
+ % Spot
+ \fill[color=red!50!brown] (-.4, -.3) circle (.18 and .14);
+}
+
\pgfdeclareverticalshading{Jupiter}{2cm}{
color(0cm)=(brownish);
color(0.2cm)=(wheat!55!sienna);
@@ -219,52 +329,36 @@
color(1.7cm)=(white);
color(1.9cm)=(wheat!90!black)
}
-\newcommand{\jupiter}{%
- \draw [color=brown!80!yellow, shading=Jupiter, ultra thick] (0, 0) circle (1);
+\newcommand{\shadedjupitersurface}{%
+ \draw [color=brown!50, shading=Jupiter, ultra thick] (0, 0) circle (1);
% Spot
\draw [brownish!50!orangish, thick, fill=orange!50!red] (-0.4, -0.25) circle (.13 and .1);
}
-\pgfdeclareverticalshading{SaturnBottom}{2cm}{
+\pgfdeclareverticalshading{Saturn}{2cm}{
color(0cm)=(whiteish!55!black);
- color(0.2cm)=(greenish!50);
- color(0.3cm)=(whiteish);
- color(0.5cm)=(greenish);
- color(0.6cm)=(whiteish!50!orangish);
- color(1.2cm)=(greenish);
- color(1.4cm)=(wheat!90!black);
- color(1.7cm)=(wheat);
- color(1.9cm)=(pinkish)
-}
-\pgfdeclareverticalshading{SaturnTop}{2cm}{
- color(0cm)=(pinkish);
- color(.1cm)=(wheat);
- color(.3cm)=(wheat!90!black);
- color(.6cm)=(greenish);
- color(1cm)=(whiteish!50!orangish);
- color(1.4cm)=(yellowish!70!orangish);
- color(1.8cm)=(whiteish!55!sienna)
+ color(0.1cm)=(greenish!50);
+ color(0.15cm)=(whiteish);
+ color(0.25cm)=(greenish);
+ color(0.3cm)=(whiteish!50!orangish);
+ color(0.6cm)=(greenish);
+ color(0.7cm)=(wheat!90!black);
+ color(0.85cm)=(wheat);
+ color(0.95cm)=(pinkish);
+ color(1cm)=(pinkish);
+ color(1.1cm)=(wheat);
+ color(1.2cm)=(wheat!90!black);
+ color(1.3cm)=(greenish);
+ color(1.5cm)=(whiteish!50!orangish);
+ color(1.7cm)=(yellowish!70!orangish);
+ color(1.9cm)=(whiteish!55!sienna)
}
-\newcommand{\saturn}{%
- % Top half
- \fill [color=yellowish, shading=SaturnTop, ultra thick] (0:1) arc (0:180:1) -- cycle;
- \draw [yellowish, ultra thick] (0:1) arc (0:180:1);
-
- % Ring
- \path[inner color=black,outer color=yellowish,even odd rule]
- (0, 0) circle [x radius = 1.5, y radius = .25]
- (0, 0) circle [x radius = 1.7, y radius = .3]
- (0, 0) circle [x radius = 1.75, y radius = .33]
- (0, 0) circle [x radius = 1.95, y radius = .38];
-
- % Bottom half
- \fill [color=yellowish, shading=SaturnBottom, ultra thick] (180:1) arc (180:360:1) -- cycle;
- \draw [yellowish, ultra thick] (180:1) arc (180:360:1);
-
+\newcommand{\saturnsurface}{%
+ \draw [color=yellowish, shading=Saturn, ultra thick, shading angle=\axialtilt] (0, 0) circle (1);
}
-\newcommand{\uranus}{%
+\newcommand{\uranussurface}{%
\draw [color=uranus_gray, fill=uranus_blue, ultra thick] (0, 0) circle (1);
}
@@ -277,50 +371,124 @@
color(1.6cm)=(neptune4);
color(1.9cm)=(neptune5)
}
-\newcommand{\neptune}{%
- \draw [color=blue!40, shading=Neptune, ultra thick] (0, 0) circle (1);
+\newcommand{\neptunesurface}{%
+ \draw [color=blue!40, shading=Neptune, ultra thick, shading angle=\axialtilt] (0, 0) circle (1);
+}
+
+\pgfdeclareverticalshading{Pluto}{2cm}{
+ color(0cm)=(pluto1);
+ color(.4cm)=(pluto2);
+ color(.7cm)=(pluto2);
+ color(1.2cm)=(pluto1);
+ color(1.9cm)=(pluto1)
+}
+\newcommand{\plutosurface}{%
+ \fill [shading=Pluto, shading angle=\axialtilt] (0, 0) circle (1);
+
+ \fill [pluto1, thick, domain=-150:100, samples=50]
+ plot ({ .67*sin(\x) * sin(\x) * sin(\x) + .5 },
+ { .65 * cos(\x) - .2 * cos(2*\x) - .1 * cos(3*\x) - .05 * cos(4*\x) - .4 } );
+
+ \draw [color=pluto2!50, ultra thick] (0,0) circle (1);
+}
+
+\newcommand{\genericsurface}{
+ \draw [color=white!50!\mycolor, fill=\mycolor, ultra thick] (0, 0) circle (1);
}
\newcommand{\addsurface}[1]{%
\IfEqCase{#1}{%
- {earth}{\earth}
- {moon}{\moon}
- {sun}{\sun}
- {mars}{\mars}
- {mercury}{\mercury}
- {venus}{\venus}
- {jupiter}{\jupiter}
- {saturn}{\saturn}
- {uranus}{\uranus}
- {neptune}{\neptune}
- {none}{}
+ {earth}{\earthsurface}
+ {moon}{\moonsurface}
+ {sun}{\sunsurface}
+ {mars}{\marssurface}
+ {mercury}{\mercurysurface}
+ {venus}{\venussurface}
+ {jupiter}{\jupitersurface}
+ {shadedjupiter}{\shadedjupitersurface}
+ {saturn}{\saturnsurface}
+ {uranus}{\uranussurface}
+ {neptune}{\neptunesurface}
+ {pluto}{\plutosurface}
+ {none}{\genericsurface}
}
}
% Main command %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\newcommand{\planet}[1][]{%
+\newcommand{\planet}[1][]{\begingroup%
\pgfkeys{/planet, default, #1}
- \begin{scope}[shift = {(\centerx, \centery)}, scale = \scale]
+ \pgfkeysifdefined{center}{%if
+ % pass
+ }{%else
+ \def\planetcenter{(\planetcenterx, \planetcentery)}
+ }
- % Circle %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- \draw [color=white!50!\mycolor, ultra thick, fill=\mycolor] (0, 0) circle (1);
+ \IfStrEqCase{\surfacename}{{saturn}{\ringstrue}}
- \begin{scope}[rotate=\tilt]
- \addsurface{\surface}
- \end{scope}
+ \begin{scope}[shift = \planetcenter, scale = \planetscale]
+
+ \ifrings
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \begin{scope}[rotate=\axialtilt]% bottom half
+ \clip (0, 0) circle (1);
+ \addsurface{\surfacename}
+ \end{scope}
+ \begin{scope}
+ \addsurfacephase{\planetphase}
+ \end{scope}
+ \begin{scope}[rotate=\axialtilt]
+ \addrings
+ \addringphase{\planetphase}
+ \end{scope}
+ \begin{scope}[rotate=\axialtilt]% top half
+ \clip (-1, 0) rectangle (1, 1);
+ \clip (0, 0) circle (1);
+ \addsurface{\surfacename}
+ \end{scope}
+ \begin{scope}
+ \clip (\axialtilt : -1.1) -- (\axialtilt : 1.1) -- (1.1, 1.1) -- (-1.1, 1.1) -- cycle;
+ \addsurfacephase{\planetphase}
+ \end{scope}
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \else
+ \begin{scope}[rotate=\axialtilt]
+ \clip (0, 0) circle (1);
+ \addsurface{\surfacename}
+ \end{scope}
+ \addsurfacephase{\planetphase}
+ \fi
\ifrotation
- \begin{scope}[rotate=\tilt]
+ \begin{scope}[rotate=\axialtilt]
\addaxis
\addequator
\addrotation
\end{scope}
\fi
- \addphase{\phase}
+ \ifequator
+ \begin{scope}[rotate=\axialtilt]
+ \addequator
+ \end{scope}
+ \fi
+
+ \ifaxis
+ \begin{scope}[rotate=\axialtilt]
+ \addaxis
+ \end{scope}
+ \fi
+
+ \IfStrEq{\ringradius}{}{%
+ %pass
+ }{%
+ \begin{scope}[rotate=\axialtilt]
+ \addthinring{\ringradius}
+ \end{scope}
+ }%
\end{scope}
+ \endgroup
}