From 42da60cba0fabaf548e69747b2d380aa4846f018 Mon Sep 17 00:00:00 2001 From: ulaulaman Date: Sun, 7 Feb 2021 16:46:40 +0100 Subject: [PATCH] Update eyes code usingtkz-euclide package --- graphics/mars.tex | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/graphics/mars.tex b/graphics/mars.tex index 71b24bd..a8b6cd9 100755 --- a/graphics/mars.tex +++ b/graphics/mars.tex @@ -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} \ No newline at end of file