latex-pictures

A collection of TikZ drawings and other images 🖌️

geodesic.tikz (1423B)

 1 % This picture represents the fact that geodesics locally minimize distances
 2 % Copyright Pablo (C) 2021
 3 \begin{tikzpicture}[scale=0.5]
 4   % The cirference
 5   \draw (0, 0) circle (3);
 6 
 7   % The equator
 8   \begin{scope}
 9     \clip (-3, 0) rectangle (3, -3);
10     \draw ellipse (3 and 1);
11   \end{scope}
12 
13   % Greenwhich
14   \begin{scope}
15     \clip (-3, -3) rectangle (0, 3);
16     \draw ellipse (1 and 3);
17   \end{scope}
18 
19   % The curve
20   \begin{scope}
21     \clip (-3, 0) rectangle (0, -3);
22     \draw[very thick] ellipse (1 and 3);
23   \end{scope}
24   \begin{scope}
25     \clip (3, -3) rectangle (0, 3);
26     \draw[very thick, dotted] ellipse (1 and 3);
27   \end{scope}
28 
29   % The ends
30   \filldraw (0, 3) circle (2pt) (-1, 0) circle (2pt);
31 
32   \draw (-0.87, -1.5) circle (0.3);
33   \draw (-1.17, -1.5) -- (-4, 1);
34 
35   % Zoom in ares
36   \begin{scope}[shift={(-6, 1)}]
37     \draw (0, 0) circle (2);
38 
39     % The geodesic
40     \draw[very thick] (0, -2) -- (0, 2);
41     \filldraw (0, -2) circle (2pt) (0, 2) circle (2pt);
42 
43     % Another curve
44     \draw[dotted] (   0,    2) to[out=180, in=90] 
45                   (-0.6,  1.4) to[out=270, in=150] 
46                   ( 0.5,  0.7) to[out=-30, in=0] 
47                   ( 0.3,  0.1) to[out=180, in=180] 
48                   ( 0.5,  0.6) to[out=0, in=120] 
49                   ( 1.3,  0.7) to[out=-60, in=60] 
50                   ( 0.4, -0.5) to[out=240, in=90] 
51                   (   0,   -2);
52   \end{scope}
53 \end{tikzpicture}
54