tikzdraw/graphics/io.tex

37 lines
1.1 KiB
TeX
Raw Normal View History

2020-09-06 00:21:05 +02:00
\documentclass{standalone}
%
\usepackage{tikz}
\usetikzlibrary{backgrounds}
\usepackage{tkz-euclide}
\usetkzobj{all}
%
\definecolor{space}{HTML}{0A2543}
\definecolor{io}{HTML}{a8a546}
\definecolor{iocrater}{HTML}{61582d}
\definecolor{ioborder}{HTML}{f4e96d}
%
\title{Io}
\begin{document}
\tikzset{
partial ellipse/.style args = {#1:#2:#3}{insert path={+ (#1:#3) arc (#1:#2:#3)}},
}
\begin{tikzpicture}[background rectangle/.style={fill=space},show background rectangle]
\tkzDefPoint(6.5,0){A}
\tkzDrawCircle[R,color=io,fill=io](A,4.5cm)
\tkzClipCircle[R](A,4.5cm)
\foreach \i in {1,2,...,10}{
\newcommand{\cX}{6.5}
\newcommand{\cY}{0}
\newcommand{\cR}{4.5}
\pgfmathparse{70*rnd+30}
\edef\tmp{\pgfmathresult}
\pgfmathrandominteger{\x}{300}{1000}
\pgfmathrandominteger{\y}{-450}{450}
\pgfmathparse{0.01*\x}\let\x\pgfmathresult
\pgfmathparse{0.01*\y}\let\y\pgfmathresult
\pgfmathparse{ifthenelse((\x-\cX)^2 + (\y-\cY)^2 <= \cR^2,"iocrater","white")}
\fill[\pgfmathresult] (\x,\y) circle (0.1);
\draw[color=ioborder] (\x,\y) circle (0.1);
}
\end{tikzpicture}
\end{document}