summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/mercatormap/mercatormap.doc.orthodromes.tex
blob: 178551584126e11e43e827f5404294963e8c8cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
% !TeX root = mercatormap.tex
% !TeX encoding=UTF-8
% !TeX spellcheck=en_US
% include file of mercatormap.tex (manual of the LaTeX package mercatormap)
\clearpage
\section{Orthodromes and Loxodromes}\label{sec:orthodromes}%

A loxodrome is a curve which crosses all meridians with
a constant angle. On Mercator maps, loxodromes are depicted as straight lines
and can be drawn by simple \tikzname\ |path| elements.

On a sphere, the shortest path
from one point to another runs along an orthodrome where
an orthodrome is a great-circle.

The mathematical background and further information are found in \cite{Sturm:2020}.


%-------------------------------------------------------------------------------
\subsection{Orthodrome Drawing}

\begin{docMrcKey}{samples}{=\meta{number}}{no default, initially |100|}
  An orthodrome curve is approximated by a polygon trajectory with
  \meta{number} pieces.
\end{docMrcKey}


\begin{docTikzKey}{mermap samples}{=\meta{number}}{style, no default}
  \tikzname\ variant to set \refKey{/mermap/samples}.
\end{docTikzKey}


\begin{docCommand}{mrcdraworthodrome}{\oarg{options}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
  Draws an orthodrome curve from a point with
  latitude \meta{lat1} and longitude \meta{lon1}
  to a point with
  latitude \meta{lat2} and longitude \meta{lon2}.
  This is a \tikzname\ path object where \meta{options} are
  \tikzname\ settings for this path. There are two orthodrome pieces connecting
  two positions (forming a great-circle). \refCom{mrcdraworthodrome} does
  not necessarily choose the shorter one, see \cite{Sturm:2020}.
  The drawn orthodrome is a spherical approximation instead of an ellipsoidal
  one.
  \tikzsetnextfilename{ortho_orthodrome1}%
  \begin{dispExample}
    \begin{tikzpicture}
      \mrcmap[type=areafit,
          south=40.7,north=48.2,west=-74.1,east=11.6,
          source=topplusopen web,
          tex width=\linewidth,tex height=6cm,
        ]{ortho_orthodrome1}
        \mrcdrawmap
        \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
          {\mrcmapattribution};
        \mrcclipmap
      \draw (mrcmap.south west) rectangle (mrcmap.north east);
      \mrcdraworthodrome[red,very thick,mermap samples=100]
        {48.14}{11.58}{40.71}{-74.01}
      \node[red,fill=white] at ([above=1.3cm]mrcmap) {
        \mrcprettyorthodistance{48.14}{11.58}{40.71}{-74.01} };
    \end{tikzpicture}
  \end{dispExample}
\end{docCommand}


\clearpage
\begin{docCommand}{mrcNPdraworthodrome}{\oarg{options}\marg{name1}\marg{name2}}
  Identical to \refCom{mrcdraworthodrome}, but the start and end point are
  described by named positions \meta{name1} and \meta{name2}.

  \tikzsetnextfilename{ortho_orthodrome2}%
  \begin{dispExample}
    \begin{tikzpicture}
      \mrcNPdef{munich}{48.14}{11.58}
      \mrcNPdef{newyork}{40.71}{-74.01}
      \mrcmap[type=areafit, area={munich,newyork},
          source=topplusopen web,
          tex width=\linewidth,tex height=6cm,
          ]{ortho_orthodrome2}
        \mrcdrawmap
        \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
          {\mrcmapattribution};
        \mrcclipmap
      \draw (mrcmap.south west) rectangle (mrcmap.north east);
      \mrcmarker{type=pin,named position=munich,contents={M\"unchen}}
      \mrcmarker{type=pinflip,shift=5mm,named position=newyork,
        contents={New York City}}
      \mrcNPdraworthodrome[red,very thick] {munich}{newyork}
      \draw[blue,very thick] (\mrcNPcs{munich}) -- (\mrcNPcs{newyork});
      \node[red,fill=white] at ([above=1.3cm]mrcmap) {
        \mrcNPprettyorthodistance{munich}{newyork} };
      \node[blue,fill=white] at ([below=5mm]mrcmap) {
        \mrcNPprettyloxodistance{munich}{newyork} };
    \end{tikzpicture}
  \end{dispExample}
\end{docCommand}


\clearpage
%-------------------------------------------------------------------------------
\subsection{Orthodromic and Loxodromic Distances}

\begin{docCommand}{mrcprettyorthodistance}{\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
  Approximate orthodromic distance between two points
  with latitude \meta{lat1}, longitude \meta{lon1}
  and latitude \meta{lat2}, longitude \meta{lon2}
  with three valid digits.
  \begin{dispExample}
  \mrcprettyorthodistance{48.14}{11.58}{40.71}{-74.01}
  \end{dispExample}
\end{docCommand}


\begin{docCommand}{mrcNPprettyorthodistance}{\marg{name1}\marg{name2}}
  Approximate orthodromic distance between two named positions
  \meta{name1} and \meta{name2} with three valid digits.
  \begin{dispExample}
  \mrcNPdef{munich}{48.14}{11.58}
  \mrcNPdef{newyork}{40.71}{-74.01}
  \mrcNPprettyorthodistance{munich}{newyork}
  \end{dispExample}
\end{docCommand}


\begin{docCommand}{mrcstoreorthodistance}{\marg{macro}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
  Stores the approximate orthodromic distance (in kilometers) between two points
  with latitude \meta{lat1}, longitude \meta{lon1}
  and latitude \meta{lat2}, longitude \meta{lon2}
  to a given \meta{macro}.
  \begin{dispExample}
  \mrcstoreorthodistance\mydist{48.14}{11.58}{40.71}{-74.01}
  \mydist
  \end{dispExample}
\end{docCommand}


\begin{docCommand}{mrcprettyloxodistance}{\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
  Approximate loxodromic distance between two points
  with latitude \meta{lat1}, longitude \meta{lon1}
  and latitude \meta{lat2}, longitude \meta{lon2}
  with three valid digits.
  \begin{dispExample}
  \mrcprettyloxodistance{48.14}{11.58}{40.71}{-74.01}
  \end{dispExample}
\end{docCommand}


\begin{docCommand}{mrcNPprettyloxodistance}{\marg{name1}\marg{name2}}
  Approximate loxodromic distance between two named positions
  \meta{name1} and \meta{name2} with three valid digits.
  \begin{dispExample}
  \mrcNPdef{munich}{48.14}{11.58}
  \mrcNPdef{newyork}{40.71}{-74.01}
  \mrcNPprettyloxodistance{munich}{newyork}
  \end{dispExample}
\end{docCommand}


\begin{docCommand}{mrcstoreloxodistance}{\marg{macro}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
  Stores the approximate loxodromic distance (in kilometers) between two points
  with latitude \meta{lat1}, longitude \meta{lon1}
  and latitude \meta{lat2}, longitude \meta{lon2}
  to a given \meta{macro}.
  \begin{dispExample}
  \mrcstoreloxodistance\mydist{48.14}{11.58}{40.71}{-74.01}
  \mydist
  \end{dispExample}
\end{docCommand}