Skip to main content
Source Link
Torbjørn T.
  • 208.5k
  • 15
  • 402
  • 583

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following examples uses the luamplib package, and must be compiled with lualatex.

White asteroids, varying size, on black background:

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
fill unitsquare scaled 4.8cm shifted (-1.2*r,-1.2*r) withcolor black;
for i=0 upto 720:
   pickup pencircle scaled 1pt scaled uniformdeviate(1.5);
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate) withcolor white;
endfor;
endfig
\end{mplibcode}
\end{document}

enter image description here

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following examples uses the luamplib package, and must be compiled with lualatex.

White asteroids, varying size, on black background:

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
fill unitsquare scaled 4.8cm shifted (-1.2*r,-1.2*r) withcolor black;
for i=0 upto 720:
   pickup pencircle scaled 1pt scaled uniformdeviate(1.5);
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate) withcolor white;
endfor;
endfig
\end{mplibcode}
\end{document}

enter image description here

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following examples uses the luamplib package, and must be compiled with lualatex.

White asteroids, varying size, on black background:

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
fill unitsquare scaled 4.8cm shifted (-1.2*r,-1.2*r) withcolor black;
for i=0 upto 720:
   pickup pencircle scaled uniformdeviate(1.5);
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate) withcolor white;
endfor;
endfig
\end{mplibcode}
\end{document}

enter image description here

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

added 592 characters in body
Source Link
Torbjørn T.
  • 208.5k
  • 15
  • 402
  • 583

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following exampleexamples uses the luamplib package, and must be compiled with lualatex.

White asteroids, varying size, on black background:

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
fill unitsquare scaled 4.8cm shifted (-1.2*r,-1.2*r) withcolor black;
for i=0 upto 720:
   pickup pencircle scaled 1pt scaled uniformdeviate(1.5);
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate) withcolor white;
endfor;
endfig
\end{mplibcode}
\end{document}

enter image description here

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following example uses the luamplib package, and must be compiled with lualatex.

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following examples uses the luamplib package, and must be compiled with lualatex.

White asteroids, varying size, on black background:

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
fill unitsquare scaled 4.8cm shifted (-1.2*r,-1.2*r) withcolor black;
for i=0 upto 720:
   pickup pencircle scaled 1pt scaled uniformdeviate(1.5);
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate) withcolor white;
endfor;
endfig
\end{mplibcode}
\end{document}

enter image description here

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

Added metapost+luamplib example
Source Link
Torbjørn T.
  • 208.5k
  • 15
  • 402
  • 583

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

enter image description herenot-very-good-looking asteroid belt created with TikZ

With Metapost

The following example uses the luamplib package, and must be compiled with lualatex.

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

enter image description here

With TikZ

I don't know how random your asteroids have to be, so this is maybe not good enough. It uses the dots pattern, so the 'asteroids' are evenly distributed. The border of the belt is randomized with the random steps decoration.

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{patterns,decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[decoration={random steps,segment length=5pt}]
\draw [black!40] circle[radius=2.65cm];
\fill [pattern color=black,pattern=dots,even odd rule,decorate] circle[radius=2.5cm] circle[radius=2.8cm];
\end{tikzpicture}
\end{document}

not-very-good-looking asteroid belt created with TikZ

With Metapost

The following example uses the luamplib package, and must be compiled with lualatex.

\documentclass{standalone}
\usepackage{luamplib}
\begin{document}
\begin{mplibcode}
beginfig(1);
r=2cm;
pickup pencircle scaled 1pt;
for i=0 upto 360:
   drawdot (r*cosd(i) + 2*normaldeviate, r*sind(i) + 2*normaldeviate);
endfor;
endfig
\end{mplibcode}
\end{document}

asteroid belt by Metapost

deleted 14 characters in body
Source Link
Torbjørn T.
  • 208.5k
  • 15
  • 402
  • 583
Loading
Source Link
Torbjørn T.
  • 208.5k
  • 15
  • 402
  • 583
Loading