Update eyes code usingtkz-euclide package

This commit is contained in:
ulaulaman 2021-02-07 16:46:40 +01:00
parent cc244d8934
commit 42da60cba0
1 changed files with 21 additions and 7 deletions

View File

@ -3,6 +3,8 @@
\usepackage{tikz}
\usetikzlibrary{backgrounds}
%
\usepackage{tkz-euclide}
%
\usepackage{xcolor}
\definecolor{space}{HTML}{0A2543}
\definecolor{earth}{HTML}{0089FA}
@ -13,9 +15,17 @@
\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,]
\begin{scope}[scale=2.5]
\coordinate (E) at (2.6,0.4);
\coordinate (F) at (3.7,0.7);
\draw[fill=mars,ultra thick] (3,0.5) circle (2.1cm);
\tkzDefPoint(3,0.5){M}
\tkzDefPoint(5.1,0.5){R}
\tkzDefPoint(2.4,0.7){E}
\tkzDefPoint(3.5,0.7){F}
%
\tkzDefShiftPoint[E](0.15,-0.2){E1}
\tkzDefShiftPoint[E](-0.15,-0.2){E2} %for pupils at left
\tkzDefShiftPoint[F](0.15,-0.2){F1}
\tkzDefShiftPoint[F](-0.15,-0.2){F2} %for pupils at left
%
\tkzDrawCircle[fill = mars](M,R)
%scar
\draw[-,thick] (1.8,0.2) -- (2.9,1.5);
\draw[-] (1.9,0.2) -- (1.9,0.4);
@ -32,10 +42,14 @@
%mouth
\draw[-,thick] (2.8,-0.6) -- (3,-0.55);
%eyes
\draw[fill=white] (2.4,0.7) ellipse (7pt and 10pt);
\draw[fill=white] (3.5,0.7) ellipse (7pt and 10pt);
\draw[fill=black,rotate around={-30:(E)}] (2.5,0.5) ellipse (2pt and 5pt);
\draw[fill=black,rotate around={-30:(F)}] (3.75,0.5) ellipse (2pt and 5pt);
\draw[fill=white] (E) ellipse (7pt and 10pt);
\draw[fill=white] (F) ellipse (7pt and 10pt);
%pupils right
\draw[fill=black,rotate around={-30:(E)}] (E1) ellipse (2pt and 5pt);
\draw[fill=black,rotate around={-30:(F)}] (F1) ellipse (2pt and 5pt);
%pupils left
%\draw[fill=black,rotate around={30:(E)}] (E2) ellipse (2pt and 5pt);
%\draw[fill=black,rotate around={30:(F)}] (F2) ellipse (2pt and 5pt);
\end{scope}
\end{tikzpicture}
\end{document}