Debian Codegraph @

texmf-dist/doc/latex/mercatormap/mercatormap.doc.orthodromes.tex

raw
1 % !TeX root = mercatormap.tex
2 % !TeX encoding=UTF-8
3 % !TeX spellcheck=en_US
4 % include file of mercatormap.tex (manual of the LaTeX package mercatormap)
5 \clearpage
6 \section{Orthodromes and Loxodromes}\label{sec:orthodromes}%
7
8 A loxodrome is a curve which crosses all meridians with
9 a constant angle. On Mercator maps, loxodromes are depicted as straight lines
10 and can be drawn by simple \tikzname\ |path| elements.
11
12 On a sphere, the shortest path
13 from one point to another runs along an orthodrome where
14 an orthodrome is a great-circle.
15
16 The mathematical background and further information are found in \cite{Sturm:2020}.
17
18
19 %-------------------------------------------------------------------------------
20 \subsection{Orthodrome Drawing}
21
22 \begin{docMrcKey}{samples}{=\meta{number}}{no default, initially |100|}
23 An orthodrome curve is approximated by a polygon trajectory with
24 \meta{number} pieces.
25 \end{docMrcKey}
26
27
28 \begin{docTikzKey}{mermap samples}{=\meta{number}}{style, no default}
29 \tikzname\ variant to set \refKey{mermap/samples}.
30 \end{docTikzKey}
31
32 \enlargethispage*{1cm}
33
34 \begin{docCommand}{mrcdraworthodrome}{\oarg{options}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
35 Draws an orthodrome curve from a point with
36 latitude \meta{lat1} and longitude \meta{lon1}
37 to a point with
38 latitude \meta{lat2} and longitude \meta{lon2}.
39 This is a \tikzname\ path object where \meta{options} are
40 \tikzname\ settings for this path. There are two orthodrome pieces connecting
41 two positions (forming a great-circle). \refCom{mrcdraworthodrome} does
42 not necessarily choose the shorter one, see \cite{Sturm:2020}.
43 The drawn orthodrome is a spherical approximation instead of an ellipsoidal
44 one.
45 \tikzsetnextfilename{ortho_orthodrome1}%
46 \begin{dispExample}
47 \begin{tikzpicture}
48 \mrcmap[type=areafit,
49 south=40.7,north=48.2,west=-74.1,east=11.6,
50 source=topplusopen web,
51 tex width=\linewidth,tex height=6cm,
52 ]{ortho_orthodrome1}
53 \mrcdrawmap
54 \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
55 {\mrcmapattribution};
56 \mrcclipmap
57 \draw (mrcmap.south west) rectangle (mrcmap.north east);
58 \mrcdraworthodrome[red,very thick,mermap samples=100]
59 {48.14}{11.58}{40.71}{-74.01}
60 \node[red,fill=white] at ([above=1.3cm]mrcmap) {
61 \mrcprettyorthodistance{48.14}{11.58}{40.71}{-74.01} };
62 \end{tikzpicture}
63 \end{dispExample}
64 \end{docCommand}
65
66
67 \clearpage
68 \begin{docCommand}{mrcNPdraworthodrome}{\oarg{options}\marg{name1}\marg{name2}}
69 Identical to \refCom{mrcdraworthodrome}, but the start and end point are
70 described by named positions \meta{name1} and \meta{name2}.
71
72 \tikzsetnextfilename{ortho_orthodrome2}%
73 \begin{dispExample}
74 \begin{tikzpicture}
75 \mrcNPdef{munich}{48.14}{11.58}
76 \mrcNPdef{newyork}{40.71}{-74.01}
77 \mrcmap[type=areafit, area={munich,newyork},
78 source=topplusopen web,
79 tex width=\linewidth,tex height=6cm,
80 ]{ortho_orthodrome2}
81 \mrcdrawmap
82 \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
83 {\mrcmapattribution};
84 \mrcclipmap
85 \draw (mrcmap.south west) rectangle (mrcmap.north east);
86 \mrcmarker{type=pin,named position=munich,contents={M\"unchen}}
87 \mrcmarker{type=pinflip,shift=5mm,named position=newyork,
88 contents={New York City}}
89 \mrcNPdraworthodrome[red,very thick] {munich}{newyork}
90 \draw[blue,very thick] (\mrcNPcs{munich}) -- (\mrcNPcs{newyork});
91 \node[red,fill=white] at ([above=1.3cm]mrcmap) {
92 \mrcNPprettyorthodistance{munich}{newyork} };
93 \node[blue,fill=white] at ([below=5mm]mrcmap) {
94 \mrcNPprettyloxodistance{munich}{newyork} };
95 \end{tikzpicture}
96 \end{dispExample}
97 \end{docCommand}
98
99
100 \clearpage
101 %-------------------------------------------------------------------------------
102 \subsection{Orthodrome Points}
103
104 \begin{docCommands}[
105 ]{
106 {
107 doc new and updated = {2024-08-01}{2024-08-05},
108 doc name = mrcNPfromOrthoFraction,
109 doc parameter = \marg{name}\oarg{\textbackslash angle}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}\marg{fraction},
110 },
111 {
112 doc name = mrcNPfromOrthoFractionNamed,
113 doc parameter = \marg{name}\oarg{\textbackslash angle}\marg{name1}\marg{name2}\marg{fraction},
114 },
115 }
116 Defines a new named position \meta{name} which is located on a \meta{fraction}
117 from the starting point of the orthodromic curve
118 from a point with
119 latitude \meta{lat1} and longitude \meta{lon1} (or described by a named position \meta{name1})
120 to a point with
121 latitude \meta{lat2} and longitude \meta{lon2} (or described by a named position \meta{name2}).
122 The given starting and final point of the orthodrome need to have a distance of more than
123 \SI{1}{\meter}.
124 If \meta{\textbackslash angle} is given, this macro is set to the
125 angle between the tangent vector to the orthodrome and
126 the current parallel circle.
127
128 \tikzsetnextfilename{ortho_orthodrome3}%
129 \begin{dispExample}
130 \begin{tikzpicture}
131 \mrcNPdef{munich}{48.14}{11.58}
132 \mrcNPdef{newyork}{40.71}{-74.01}
133 \mrcmap[type=areafit, area={munich,newyork},
134 source=topplusopen web,
135 tex width=\linewidth,tex height=6cm,
136 ]{ortho_orthodrome3}
137 \mrcdrawmap
138 \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
139 {\mrcmapattribution};
140 \mrcclipmap
141 \draw (mrcmap.south west) rectangle (mrcmap.north east);
142 \mrcmarker{type=pin,named position=munich,contents={M\"unchen}}
143 \mrcmarker{type=pinflip,shift=5mm,named position=newyork,
144 contents={New York City}}
145 \mrcNPdraworthodrome[red,very thick] {munich}{newyork}
146 \foreach \fraction in { 0.1,0.3,0.5,0.7,1.0,1.1 }
147 {
148 \mrcNPfromOrthoFractionNamed{waypoint}[\myangle]
149 {munich}{newyork}{\fraction}
150 \mrcmarker{type=pin,named position=waypoint,
151 contents={\fraction: \fpeval{round(\myangle)}\textdegree }}
152 }
153 \end{tikzpicture}
154 \end{dispExample}
155 \end{docCommands}
156
157 \clearpage
158
159 \begin{docCommands}[
160 ]{
161 {
162 doc new and updated = {2024-08-01}{2024-08-05},
163 doc name = mrcNPfromOrthoDistance,
164 doc parameter = \marg{name}\oarg{\textbackslash angle}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}\marg{distance},
165 },
166 {
167 doc name = mrcNPfromOrthoDistanceNamed,
168 doc parameter = \marg{name}\oarg{\textbackslash angle}\marg{name1}\marg{name2}\marg{distance},
169 },
170 }
171 Defines a new named position \meta{name} which is located on a \meta{distance}
172 from the starting point of the orthodromic curve
173 from a point with
174 latitude \meta{lat1} and longitude \meta{lon1} (or described by a named position \meta{name1})
175 to a point with
176 latitude \meta{lat2} and longitude \meta{lon2} (or described by a named position \meta{name2}).
177 The given starting and final point of the orthodrome need to have a distance of more than
178 \SI{1}{\meter}. The unit for the \meta{distance} is kilometer.
179 If \meta{\textbackslash angle} is given, this macro is set to the
180 angle between the tangent vector to the orthodrome and
181 the current parallel circle.
182
183 \tikzsetnextfilename{ortho_orthodrome4}%
184 \begin{dispExample}
185 \begin{tikzpicture}
186 \mrcNPdef{munich}{48.14}{11.58}
187 \mrcNPdef{newyork}{40.71}{-74.01}
188 \mrcmap[type=areafit, area={munich,newyork},
189 source=topplusopen web,
190 tex width=\linewidth,tex height=6cm,
191 ]{ortho_orthodrome4}
192 \mrcdrawmap
193 \node[below,font=\fontsize{7pt}{7pt}\sffamily] at (mrcmap.south)
194 {\mrcmapattribution};
195 \mrcclipmap
196 \draw (mrcmap.south west) rectangle (mrcmap.north east);
197 \mrcmarker{type=pin,named position=munich,contents={M\"unchen}}
198 \mrcmarker{type=pinflip,shift=5mm,named position=newyork,
199 contents={New York City}}
200 \mrcNPdraworthodrome[red,very thick] {munich}{newyork}
201 \foreach \distance in { 1000,2000,3000,4000,5000,6000 }
202 {
203 \mrcNPfromOrthoDistanceNamed{waypoint}{munich}{newyork}{\distance}
204 \mrcmarker{type=pin,named position=waypoint,
205 contents={\SI{\distance}{\kilo\meter}}}
206 }
207 \end{tikzpicture}
208 \end{dispExample}
209 \end{docCommands}
210
211
212
213
214 \clearpage
215 %-------------------------------------------------------------------------------
216 \subsection{Orthodromic and Loxodromic Distances}
217
218 \begin{docCommand}{mrcprettyorthodistance}{\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
219 Approximate orthodromic distance between two points
220 with latitude \meta{lat1}, longitude \meta{lon1}
221 and latitude \meta{lat2}, longitude \meta{lon2}
222 with three valid digits.
223 \begin{dispExample}
224 \mrcprettyorthodistance{48.14}{11.58}{40.71}{-74.01}
225 \end{dispExample}
226 \end{docCommand}
227
228
229 \begin{docCommand}{mrcNPprettyorthodistance}{\marg{name1}\marg{name2}}
230 Approximate orthodromic distance between two named positions
231 \meta{name1} and \meta{name2} with three valid digits.
232 \begin{dispExample}
233 \mrcNPdef{munich}{48.14}{11.58}
234 \mrcNPdef{newyork}{40.71}{-74.01}
235 \mrcNPprettyorthodistance{munich}{newyork}
236 \end{dispExample}
237 \end{docCommand}
238
239
240 \begin{docCommand}{mrcstoreorthodistance}{\marg{macro}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
241 Stores the approximate orthodromic distance (in kilometers) between two points
242 with latitude \meta{lat1}, longitude \meta{lon1}
243 and latitude \meta{lat2}, longitude \meta{lon2}
244 to a given \meta{macro}.
245 \begin{dispExample}
246 \mrcstoreorthodistance\mydist{48.14}{11.58}{40.71}{-74.01}
247 \mydist
248 \end{dispExample}
249 \end{docCommand}
250
251
252 \begin{docCommand}{mrcprettyloxodistance}{\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
253 Approximate loxodromic distance between two points
254 with latitude \meta{lat1}, longitude \meta{lon1}
255 and latitude \meta{lat2}, longitude \meta{lon2}
256 with three valid digits.
257 \begin{dispExample}
258 \mrcprettyloxodistance{48.14}{11.58}{40.71}{-74.01}
259 \end{dispExample}
260 \end{docCommand}
261
262
263 \begin{docCommand}{mrcNPprettyloxodistance}{\marg{name1}\marg{name2}}
264 Approximate loxodromic distance between two named positions
265 \meta{name1} and \meta{name2} with three valid digits.
266 \begin{dispExample}
267 \mrcNPdef{munich}{48.14}{11.58}
268 \mrcNPdef{newyork}{40.71}{-74.01}
269 \mrcNPprettyloxodistance{munich}{newyork}
270 \end{dispExample}
271 \end{docCommand}
272
273 \enlargethispage*{1cm}
274
275 \begin{docCommand}{mrcstoreloxodistance}{\marg{macro}\marg{lat1}\marg{lon1}\marg{lat2}\marg{lon2}}
276 Stores the approximate loxodromic distance (in kilometers) between two points
277 with latitude \meta{lat1}, longitude \meta{lon1}
278 and latitude \meta{lat2}, longitude \meta{lon2}
279 to a given \meta{macro}.
280 \begin{dispExample}
281 \mrcstoreloxodistance\mydist{48.14}{11.58}{40.71}{-74.01}
282 \mydist
283 \end{dispExample}
284 \end{docCommand}
285