-
Notifications
You must be signed in to change notification settings - Fork 0
/
sim.direction.html
605 lines (510 loc) · 30.1 KB
/
sim.direction.html
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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>sim.direction module — PyMoSim v0.8 Manual</title>
<link href="_static/css/theme.css" rel="stylesheet" />
<link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
<link rel="stylesheet"
href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/basic.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js">
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="sim.drawable module" href="sim.drawable.html" />
<link rel="prev" title="sim package" href="sim.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="en" />
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
<div class="container-fluid" id="banner"></div>
<nav class="navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar" id="navbar-main"><div class="container-xl">
<div id="navbar-start">
<a class="navbar-brand" href="index.html">
<img src="_static/icon.png" class="logo" alt="logo">
</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapsible" aria-controls="navbar-collapsible" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar-collapsible" class="col-lg-9 collapse navbar-collapse">
<div id="navbar-center" class="mr-auto">
<div class="navbar-center-item">
<ul id="navbar-main-elements" class="navbar-nav">
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="comm.html">
comm package
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="node.html">
node package
</a>
</li>
<li class="toctree-l1 current active nav-item">
<a class="reference internal nav-link" href="sim.html">
sim package
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="map.html">
map package
</a>
</li>
</ul>
</div>
</div>
<div id="navbar-end">
<div class="navbar-end-item">
<form class="bd-search d-flex align-items-center" action="search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form>
</div>
<div class="navbar-end-item">
<ul id="navbar-icon-links" class="navbar-nav" aria-label="Icon Links">
<li class="nav-item">
<a class="nav-link" href="https://github.com/cfoh/pymosim" rel="noopener" target="_blank" title="GitHub">
<span><i class="fab fa-github-square"></i></span>
<label class="sr-only">GitHub</label>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<div class="container-xl">
<div class="row">
<!-- Only show if we have sidebars configured, else just a small margin -->
<div class="col-12 col-md-3 bd-sidebar"><form class="bd-search d-flex align-items-center" action="search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
<ul class="current nav bd-sidenav">
<li class="toctree-l1 current active">
<a class="current reference internal" href="#">
sim.direction module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.drawable.html">
sim.drawable module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.event.html">
sim.event module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.frame.html">
sim.frame module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.loc.html">
sim.loc module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.scenario.html">
sim.scenario module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.simsystem.html">
sim.simsystem module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.simulation.html">
sim.simulation module
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="sim.version.html">
sim.version module
</a>
</li>
</ul>
</div>
</nav>
</div>
<div class="d-none d-xl-block col-xl-2 bd-toc">
<div class="toc-item">
<div class="tocsection onthispage pt-5 pb-3">
<i class="fas fa-list"></i> On this page
</div>
<nav id="bd-toc-nav">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#list-of-classes">
List of Classes
</a>
<ul class="visible nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#dir">
<code class="xref py py-class docutils literal notranslate">
<span class="pre">
DIR
</span>
</code>
</a>
</li>
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#dir2d">
<code class="xref py py-class docutils literal notranslate">
<span class="pre">
Dir2D
</span>
</code>
</a>
</li>
<li class="toc-h3 nav-item toc-entry">
<a class="reference internal nav-link" href="#northdir">
<code class="xref py py-class docutils literal notranslate">
<span class="pre">
NorthDir
</span>
</code>
</a>
</li>
</ul>
</li>
</ul>
</nav>
</div>
<div class="toc-item">
</div>
</div>
<main class="col-12 col-md-9 col-xl-7 py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
<div>
<div class="section" id="module-sim.direction">
<span id="sim-direction-module"></span><h1>sim.direction module<a class="headerlink" href="#module-sim.direction" title="Permalink to this headline">¶</a></h1>
<p>The module <cite>direction</cite> provides classes to describe the direction in the
simulation world. It contains an abstract class for extension. To write
your own direction class, your class must extend <a class="reference internal" href="#sim.direction.DIR" title="sim.direction.DIR"><code class="xref py py-class docutils literal notranslate"><span class="pre">sim.direction.DIR</span></code></a>
abstract class and implement the corresponding abstract methods.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<ul class="simple">
<li><p>Created by: CH Foh (2021)</p></li>
</ul>
</div>
<div class="section" id="list-of-classes">
<h2>List of Classes<a class="headerlink" href="#list-of-classes" title="Permalink to this headline">¶</a></h2>
<div class="section" id="dir">
<h3><a class="reference internal" href="#sim.direction.DIR" title="sim.direction.DIR"><code class="xref py py-class docutils literal notranslate"><span class="pre">DIR</span></code></a><a class="headerlink" href="#dir" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>This is the base direction class. It mainly defines specification.</p>
</div></blockquote>
</div>
<div class="section" id="dir2d">
<h3><a class="reference internal" href="#sim.direction.Dir2D" title="sim.direction.Dir2D"><code class="xref py py-class docutils literal notranslate"><span class="pre">Dir2D</span></code></a><a class="headerlink" href="#dir2d" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>For a flat world, use <cite>Dir2D</cite> class which describes an angle of
a direction. The angle for a North pointing direction is 0 degree.
The angle increases as the direction rotates clockwise.</p>
</div></blockquote>
</div>
<div class="section" id="northdir">
<h3><a class="reference internal" href="#sim.direction.NorthDir" title="sim.direction.NorthDir"><code class="xref py py-class docutils literal notranslate"><span class="pre">NorthDir</span></code></a><a class="headerlink" href="#northdir" title="Permalink to this headline">¶</a></h3>
<blockquote>
<div><p>It is a constant north pointing direction.</p>
</div></blockquote>
<hr class="docutils" />
<dl class="py class">
<dt id="sim.direction.DIR">
<em class="property">class </em><code class="sig-prename descclassname">sim.direction.</code><code class="sig-name descname">DIR</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">azimuth</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">0</span></em>, <em class="sig-param"><span class="n">elevation</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">abc.ABC</span></code></p>
<p>This is an abstract class for direction. All direction classes should extend
this class. It may have several abstract methods to be reimplemented.</p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.DIR.clone" title="sim.direction.DIR.clone"><code class="xref py py-obj docutils literal notranslate"><span class="pre">clone</span></code></a>()</p></td>
<td><p>Clone a copy of this instance.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#sim.direction.DIR.get_azimuth" title="sim.direction.DIR.get_azimuth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_azimuth</span></code></a>()</p></td>
<td><p>Return the azimuth angle.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.DIR.get_elevation" title="sim.direction.DIR.get_elevation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_elevation</span></code></a>()</p></td>
<td><p>Return the elevation angle.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#sim.direction.DIR.is_within" title="sim.direction.DIR.is_within"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_within</span></code></a>(other, range)</p></td>
<td><p>This function returns a bool describing if the direction of <cite>other</cite> is within a specific range of its direction.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.DIR.rotate_to" title="sim.direction.DIR.rotate_to"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rotate_to</span></code></a>(other)</p></td>
<td><p>This is a method to set its direction to <cite>other</cite>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#sim.direction.DIR.set_azimuth_given" title="sim.direction.DIR.set_azimuth_given"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_azimuth_given</span></code></a>(from_loc, to_loc)</p></td>
<td><p>Set the direction to the azimuth angle from a point viewing to another point.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="sim.direction.DIR.__init__">
<em class="property">abstract </em><code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">azimuth</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">0</span></em>, <em class="sig-param"><span class="n">elevation</span><span class="p">:</span> <span class="n">float</span> <span class="o">=</span> <span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>This is an abstract constructor to be reimplemented.
Subclass should call super() to create <cite>azimuth</cite> and <cite>elevation</cite> angles.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.DIR.clone">
<em class="property">abstract </em><code class="sig-name descname">clone</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR.clone" title="Permalink to this definition">¶</a></dt>
<dd><p>Clone a copy of this instance.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.DIR.is_within">
<em class="property">abstract </em><code class="sig-name descname">is_within</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">other</span></em>, <em class="sig-param"><span class="n">range</span><span class="p">:</span> <span class="n">float</span></em><span class="sig-paren">)</span> → bool<a class="headerlink" href="#sim.direction.DIR.is_within" title="Permalink to this definition">¶</a></dt>
<dd><p>This function returns a bool describing if the direction of <cite>other</cite> is
within a specific range of its direction.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>other</strong><span class="classifier">An instance of extended DIR</span></dt><dd><p>The other direction to compare with.</p>
</dd>
<dt><strong>range</strong><span class="classifier">float</span></dt><dd><p>A positive real number specifying the +/- range within itself.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt>bool</dt><dd><p>Return whether <cite>other</cite> is +/- range within itself.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.DIR.rotate_to">
<em class="property">abstract </em><code class="sig-name descname">rotate_to</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">other</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#sim.direction.Dir2D" title="sim.direction.Dir2D">sim.direction.Dir2D</a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR.rotate_to" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a method to set its direction to <cite>other</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.DIR.get_azimuth">
<em class="property">abstract </em><code class="sig-name descname">get_azimuth</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR.get_azimuth" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the azimuth angle.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.DIR.get_elevation">
<em class="property">abstract </em><code class="sig-name descname">get_elevation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR.get_elevation" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the elevation angle.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.DIR.set_azimuth_given">
<code class="sig-name descname">set_azimuth_given</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">from_loc</span></em>, <em class="sig-param"><span class="n">to_loc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.DIR.set_azimuth_given" title="Permalink to this definition">¶</a></dt>
<dd><p>Set the direction to the azimuth angle from a point viewing to
another point.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>from_loc</strong><span class="classifier">An instance of extended LOC</span></dt><dd><p>The viewing location.</p>
</dd>
<dt><strong>to_loc</strong><span class="classifier">An instance of extended LOC</span></dt><dd><p>The location to view to from <cite>from_loc</cite>.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="sim.direction.Dir2D">
<em class="property">class </em><code class="sig-prename descclassname">sim.direction.</code><code class="sig-name descname">Dir2D</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">azimuth</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sim.direction.DIR" title="sim.direction.DIR"><code class="xref py py-class docutils literal notranslate"><span class="pre">sim.direction.DIR</span></code></a></p>
<p>This is a class which describes an angle of a direction in 2D.
The angle for a North pointing direction is 0 degree. The angle increases as
the direction rotates clockwise.
This class has a constant elevation angle of zero.</p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.Dir2D.clone" title="sim.direction.Dir2D.clone"><code class="xref py py-obj docutils literal notranslate"><span class="pre">clone</span></code></a>()</p></td>
<td><p>Clone a copy of this instance.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#sim.direction.Dir2D.diff" title="sim.direction.Dir2D.diff"><code class="xref py py-obj docutils literal notranslate"><span class="pre">diff</span></code></a>(other)</p></td>
<td><p>This function returns the angle of <cite>other</cite> from its point of view.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.Dir2D.get_azimuth" title="sim.direction.Dir2D.get_azimuth"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_azimuth</span></code></a>()</p></td>
<td><p>Return the azimuth angle.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#sim.direction.Dir2D.get_elevation" title="sim.direction.Dir2D.get_elevation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_elevation</span></code></a>()</p></td>
<td><p>Return the elevation angle.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.Dir2D.is_within" title="sim.direction.Dir2D.is_within"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_within</span></code></a>(other, range)</p></td>
<td><p>This function returns a bool describing if the direction of <cite>other</cite> is within a specific range of its direction on either side.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#sim.direction.Dir2D.rotate" title="sim.direction.Dir2D.rotate"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rotate</span></code></a>(angle)</p></td>
<td><p>Use this method to rotate its direction clockwise by an <cite>angle</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.Dir2D.rotate_to" title="sim.direction.Dir2D.rotate_to"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rotate_to</span></code></a>(other)</p></td>
<td><p>This is a method to set its direction to <cite>other</cite>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_azimuth_given</span></code>(from_loc, to_loc)</p></td>
<td><p>Set the direction to the azimuth angle from a point viewing to another point.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="sim.direction.Dir2D.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">azimuth</span><span class="o">=</span><span class="default_value">0</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the constructor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>azimuth</strong><span class="classifier">float</span></dt><dd><p>The azimuth angle. For a North pointing direction, the angle is 0 degree.
The angle increases as the direction rotates clockwise.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.clone">
<code class="sig-name descname">clone</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D.clone" title="Permalink to this definition">¶</a></dt>
<dd><p>Clone a copy of this instance.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.get_azimuth">
<code class="sig-name descname">get_azimuth</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D.get_azimuth" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the azimuth angle.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.get_elevation">
<code class="sig-name descname">get_elevation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D.get_elevation" title="Permalink to this definition">¶</a></dt>
<dd><p>Return the elevation angle.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.rotate">
<code class="sig-name descname">rotate</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">angle</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D.rotate" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to rotate its direction clockwise by an <cite>angle</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.rotate_to">
<code class="sig-name descname">rotate_to</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">other</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#sim.direction.Dir2D" title="sim.direction.Dir2D">sim.direction.Dir2D</a></span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.Dir2D.rotate_to" title="Permalink to this definition">¶</a></dt>
<dd><p>This is a method to set its direction to <cite>other</cite>.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.diff">
<code class="sig-name descname">diff</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">other</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#sim.direction.Dir2D" title="sim.direction.Dir2D">sim.direction.Dir2D</a></span></em><span class="sig-paren">)</span> → float<a class="headerlink" href="#sim.direction.Dir2D.diff" title="Permalink to this definition">¶</a></dt>
<dd><p>This function returns the angle of <cite>other</cite> from its point of view.
That is, what is the angle of <cite>other</cite> if its angle is zero.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.Dir2D.is_within">
<code class="sig-name descname">is_within</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">other</span><span class="p">:</span> <span class="n"><a class="reference internal" href="#sim.direction.Dir2D" title="sim.direction.Dir2D">sim.direction.Dir2D</a></span></em>, <em class="sig-param"><span class="n">range</span><span class="p">:</span> <span class="n">float</span></em><span class="sig-paren">)</span> → bool<a class="headerlink" href="#sim.direction.Dir2D.is_within" title="Permalink to this definition">¶</a></dt>
<dd><p>This function returns a bool describing if the direction of <cite>other</cite> is
within a specific range of its direction on either side. See description in
base class for detail.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="sim.direction.NorthDir">
<em class="property">class </em><code class="sig-prename descclassname">sim.direction.</code><code class="sig-name descname">NorthDir</code><a class="headerlink" href="#sim.direction.NorthDir" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#sim.direction.Dir2D" title="sim.direction.Dir2D"><code class="xref py py-class docutils literal notranslate"><span class="pre">sim.direction.Dir2D</span></code></a></p>
<p>This is a shortcut to create a fixed North pointing direction.</p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.NorthDir.clone" title="sim.direction.NorthDir.clone"><code class="xref py py-obj docutils literal notranslate"><span class="pre">clone</span></code></a>()</p></td>
<td><p>Clone a copy of this instance.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">diff</span></code>(other)</p></td>
<td><p>This function returns the angle of <cite>other</cite> from its point of view.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_azimuth</span></code>()</p></td>
<td><p>Return the azimuth angle.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_elevation</span></code>()</p></td>
<td><p>Return the elevation angle.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_within</span></code>(other, range)</p></td>
<td><p>This function returns a bool describing if the direction of <cite>other</cite> is within a specific range of its direction on either side.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">rotate</span></code>(angle)</p></td>
<td><p>Use this method to rotate its direction clockwise by an <cite>angle</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#sim.direction.NorthDir.rotate_to" title="sim.direction.NorthDir.rotate_to"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rotate_to</span></code></a>(other)</p></td>
<td><p>The method does nothing, since this instance describes a constant direction.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_azimuth_given</span></code>(from_loc, to_loc)</p></td>
<td><p>Set the direction to the azimuth angle from a point viewing to another point.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="sim.direction.NorthDir.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.NorthDir.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the constructor.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>azimuth</strong><span class="classifier">float</span></dt><dd><p>The azimuth angle. For a North pointing direction, the angle is 0 degree.
The angle increases as the direction rotates clockwise.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.NorthDir.clone">
<code class="sig-name descname">clone</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.NorthDir.clone" title="Permalink to this definition">¶</a></dt>
<dd><p>Clone a copy of this instance.</p>
</dd></dl>
<dl class="py method">
<dt id="sim.direction.NorthDir.rotate_to">
<code class="sig-name descname">rotate_to</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">other</span></em><span class="sig-paren">)</span><a class="headerlink" href="#sim.direction.NorthDir.rotate_to" title="Permalink to this definition">¶</a></dt>
<dd><p>The method does nothing, since this instance describes a constant
direction.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
</main>
</div>
</div>
<script src="_static/js/index.1c5a1a01449ed65a7b51.js"></script>
<footer class="footer mt-5 mt-md-0">
<div class="container">
<div class="footer-item">
<p class="copyright">
© Copyright 2021, cfoh.<br/>
</p>
</div>
<div class="footer-item">
<p class="sphinx-version">
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 3.4.3.<br/>
</p>
</div>
</div>
</footer>
</body>
</html>