Skip to content

Commit

Permalink
deploy: 9819864
Browse files Browse the repository at this point in the history
  • Loading branch information
cyschneck committed Oct 9, 2024
1 parent 626ecf1 commit 6fd7863
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 24 deletions.
1 change: 1 addition & 0 deletions _preview/1/README.html
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,7 @@ <h3>Working with Great Circles<a class="headerlink" href="#working-with-great-ci
<li><p>Generating a great circle arc and path</p></li>
<li><p>Midpoint (and additional intermediate points) of a great circle arc</p></li>
<li><p>Length of a great circle arc (the distance between two points)</p></li>
<li><p>Spherical distance to degrees</p></li>
<li><p>Bearing of a great circle arc</p></li>
<li><p>Compare great circle arc to rhumb line</p></li>
<li><p>Antipodal point</p></li>
Expand Down
1 change: 1 addition & 0 deletions _preview/1/_sources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Each section will make use of plotting to visually demonstrate concepts with `ma
- Generating a great circle arc and path
- Midpoint (and additional intermediate points) of a great circle arc
- Length of a great circle arc (the distance between two points)
- Spherical distance to degrees
- Bearing of a great circle arc
- Compare great circle arc to rhumb line
- Antipodal point
Expand Down
67 changes: 62 additions & 5 deletions _preview/1/_sources/notebooks/tutorials/arc_path.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"Great circles are circles that circumnavigate the globe\n",
"\n",
"1. Distance Between Points on a Great Circle Arc\n",
"1. Spherical distance to degrees\n",
"1. Determine the Bearing of a Great Circle Arc\n",
"1. Generating a Great Circle Arc with Intermediates Points\n",
"1. Determine the Midpoint of a Great Circle Arc\n",
Expand Down Expand Up @@ -244,7 +245,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"## Distance Between Points on a Great Circle Arc\n"
"## Distance Between Points on a Great Circle Arc"
]
},
{
Expand Down Expand Up @@ -302,10 +303,11 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Haversine (TODO)\n",
"### Vincenty Sphere Great Circle Distance (TODO)\n",
"### Vincenty Ellipsoid Great Circle Distance (TODO)\n",
"### Meeus Great Circle Distance (TODO)"
"Additional distance measuerments\n",
"- Haversine (TODO)\n",
"- Vincenty Sphere Great Circle Distance (TODO)\n",
"- Vincenty Ellipsoid Great Circle Distance (TODO)\n",
"- Meeus Great Circle Distance (TODO)"
]
},
{
Expand Down Expand Up @@ -477,6 +479,61 @@
"Compared to the distance from the associated airports in Denver and Boston ([DIA to Logan](https://www.greatcirclemap.com/?routes=DEN-BOS)) which has a distance of 2823 km"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Spherical distance to degrees\n",
"\n",
"Convert a distance from meters to degrees, measured along the great circle sphere with a radius of ~6371 km (mean radius of Earth)\n",
"\n",
"- See also: [ObsPy `kilometer2degrees()`](https://docs.obspy.org/packages/autogen/obspy.geodetics.base.kilometer2degrees.html)"
]
},
{
"cell_type": "code",
"execution_count": 359,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2.6949458523585643\n",
"300.0\n"
]
}
],
"source": [
"# assumes a spherical Earth\n",
"earth_radius = 6378.137 # km\n",
"\n",
"def km_to_degree_distance(distance_km=None):\n",
" return distance_km / (2 * earth_radius * np.pi / 360)\n",
"\n",
"def degree_to_km_distance(distance_degree=None):\n",
" return distance_degree * (2 * earth_radius * np.pi / 360)"
]
},
{
"cell_type": "code",
"execution_count": 363,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"300 km to degrees = 2.6949458523585643 degrees\n",
"6.381307 degree to km = 710.3638458355522 km\n"
]
}
],
"source": [
"print(f\"300 km to degrees = {km_to_degree_distance(300)} degrees\")\n",
"print(f\"6.381307 degree to km = {degree_to_km_distance(6.381307)} km\")"
]
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down
4 changes: 2 additions & 2 deletions _preview/1/notebooks/notebook-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,8 @@ <h5>of further and further<a class="headerlink" href="#of-further-and-further" t
<section id="header-levels">
<h6>header levels<a class="headerlink" href="#header-levels" title="Link to this heading"><i class="fas fa-link"></i></a></h6>
<p>as well <span class="math notranslate nohighlight">\(m = a * t / h\)</span> text! Similarly, you have access to other <span class="math notranslate nohighlight">\(\LaTeX\)</span> equation <a class="reference external" href="https://jupyter-notebook.readthedocs.io/en/stable/examples/Notebook/Typesetting%20Equations.html"><strong>functionality</strong></a> via MathJax (demo below from link),</p>
<div class="amsmath math notranslate nohighlight" id="equation-8db3ca5f-aeb4-400c-8cf9-2d4e9453f0d8">
<span class="eqno">()<a class="headerlink" href="#equation-8db3ca5f-aeb4-400c-8cf9-2d4e9453f0d8" title="Permalink to this equation"><i class="fas fa-link"></i></a></span>\[\begin{align}
<div class="amsmath math notranslate nohighlight" id="equation-0c56ba9a-af36-498d-80dc-9024e39173e0">
<span class="eqno">()<a class="headerlink" href="#equation-0c56ba9a-af36-498d-80dc-9024e39173e0" title="Permalink to this equation"><i class="fas fa-link"></i></a></span>\[\begin{align}
\dot{x} &amp; = \sigma(y-x) \\
\dot{y} &amp; = \rho x - y - xz \\
\dot{z} &amp; = -\beta z + xy
Expand Down
60 changes: 44 additions & 16 deletions _preview/1/notebooks/tutorials/arc_path.html
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ <h2>Overview<a class="headerlink" href="#overview" title="Link to this heading">
<p>Great circles are circles that circumnavigate the globe</p>
<ol class="arabic simple">
<li><p>Distance Between Points on a Great Circle Arc</p></li>
<li><p>Spherical distance to degrees</p></li>
<li><p>Determine the Bearing of a Great Circle Arc</p></li>
<li><p>Generating a Great Circle Arc with Intermediates Points</p></li>
<li><p>Determine the Midpoint of a Great Circle Arc</p></li>
Expand Down Expand Up @@ -650,18 +651,13 @@ <h3>Determine Distance Mathematically via Unit Sphere<a class="headerlink" href=
</div>
</div>
</div>
</section>
<section id="haversine-todo">
<h3>Haversine (TODO)<a class="headerlink" href="#haversine-todo" title="Link to this heading"><i class="fas fa-link"></i></a></h3>
</section>
<section id="vincenty-sphere-great-circle-distance-todo">
<h3>Vincenty Sphere Great Circle Distance (TODO)<a class="headerlink" href="#vincenty-sphere-great-circle-distance-todo" title="Link to this heading"><i class="fas fa-link"></i></a></h3>
</section>
<section id="vincenty-ellipsoid-great-circle-distance-todo">
<h3>Vincenty Ellipsoid Great Circle Distance (TODO)<a class="headerlink" href="#vincenty-ellipsoid-great-circle-distance-todo" title="Link to this heading"><i class="fas fa-link"></i></a></h3>
</section>
<section id="meeus-great-circle-distance-todo">
<h3>Meeus Great Circle Distance (TODO)<a class="headerlink" href="#meeus-great-circle-distance-todo" title="Link to this heading"><i class="fas fa-link"></i></a></h3>
<p>Additional distance measuerments</p>
<ul class="simple">
<li><p>Haversine (TODO)</p></li>
<li><p>Vincenty Sphere Great Circle Distance (TODO)</p></li>
<li><p>Vincenty Ellipsoid Great Circle Distance (TODO)</p></li>
<li><p>Meeus Great Circle Distance (TODO)</p></li>
</ul>
</section>
<section id="determine-distance-points-via-python-package-pyproj">
<h3>Determine Distance Points via Python Package <code class="docutils literal notranslate"><span class="pre">pyproj</span></code><a class="headerlink" href="#determine-distance-points-via-python-package-pyproj" title="Link to this heading"><i class="fas fa-link"></i></a></h3>
Expand Down Expand Up @@ -788,6 +784,41 @@ <h3>Determine Distance Points via Python Package <code class="docutils literal n
<p>Compared to the distance from the associated airports in Denver and Boston (<a class="reference external" href="https://www.greatcirclemap.com/?routes=DEN-BOS">DIA to Logan</a>) which has a distance of 2823 km</p>
</section>
</section>
<section id="spherical-distance-to-degrees">
<h2>Spherical distance to degrees<a class="headerlink" href="#spherical-distance-to-degrees" title="Link to this heading"><i class="fas fa-link"></i></a></h2>
<p>Convert a distance from meters to degrees, measured along the great circle sphere with a radius of ~6371 km (mean radius of Earth)</p>
<ul class="simple">
<li><p>See also: <a class="reference external" href="https://docs.obspy.org/packages/autogen/obspy.geodetics.base.kilometer2degrees.html">ObsPy <code class="docutils literal notranslate"><span class="pre">kilometer2degrees()</span></code></a></p></li>
</ul>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="c1"># assumes a spherical Earth</span>
<span class="n">earth_radius</span> <span class="o">=</span> <span class="mf">6378.137</span> <span class="c1"># km</span>

<span class="k">def</span> <span class="nf">km_to_degree_distance</span><span class="p">(</span><span class="n">distance_km</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">return</span> <span class="n">distance_km</span> <span class="o">/</span> <span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">earth_radius</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">360</span><span class="p">)</span>

<span class="k">def</span> <span class="nf">degree_to_km_distance</span><span class="p">(</span><span class="n">distance_degree</span><span class="o">=</span><span class="kc">None</span><span class="p">):</span>
<span class="k">return</span> <span class="n">distance_degree</span> <span class="o">*</span> <span class="p">(</span><span class="mi">2</span> <span class="o">*</span> <span class="n">earth_radius</span> <span class="o">*</span> <span class="n">np</span><span class="o">.</span><span class="n">pi</span> <span class="o">/</span> <span class="mi">360</span><span class="p">)</span>
</pre></div>
</div>
</div>
</div>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;300 km to degrees = </span><span class="si">{</span><span class="n">km_to_degree_distance</span><span class="p">(</span><span class="mi">300</span><span class="p">)</span><span class="si">}</span><span class="s2"> degrees&quot;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s2">&quot;6.381307 degree to km = </span><span class="si">{</span><span class="n">degree_to_km_distance</span><span class="p">(</span><span class="mf">6.381307</span><span class="p">)</span><span class="si">}</span><span class="s2"> km&quot;</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>300 km to degrees = 2.6949458523585643 degrees
6.381307 degree to km = 710.3638458355522 km
</pre></div>
</div>
</div>
</div>
</section>
<section id="determine-the-bearing-of-a-great-circle-arc">
<h2>Determine the Bearing of a Great Circle Arc<a class="headerlink" href="#determine-the-bearing-of-a-great-circle-arc" title="Link to this heading"><i class="fas fa-link"></i></a></h2>
<section id="determine-the-bearing-mathematically-via-unit-sphere">
Expand Down Expand Up @@ -1672,13 +1703,10 @@ <h2>Resources and references<a class="headerlink" href="#resources-and-reference
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#imports">Imports</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#distance-between-points-on-a-great-circle-arc">Distance Between Points on a Great Circle Arc</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#determine-distance-mathematically-via-unit-sphere">Determine Distance Mathematically via Unit Sphere</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#haversine-todo">Haversine (TODO)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#vincenty-sphere-great-circle-distance-todo">Vincenty Sphere Great Circle Distance (TODO)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#vincenty-ellipsoid-great-circle-distance-todo">Vincenty Ellipsoid Great Circle Distance (TODO)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#meeus-great-circle-distance-todo">Meeus Great Circle Distance (TODO)</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#determine-distance-points-via-python-package-pyproj">Determine Distance Points via Python Package <code class="docutils literal notranslate"><span class="pre">pyproj</span></code></a></li>
</ul>
</li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#spherical-distance-to-degrees">Spherical distance to degrees</a></li>
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#determine-the-bearing-of-a-great-circle-arc">Determine the Bearing of a Great Circle Arc</a><ul class="nav section-nav flex-column">
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#determine-the-bearing-mathematically-via-unit-sphere">Determine the Bearing Mathematically via Unit Sphere</a></li>
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#determine-the-bearing-via-python-package-pyproj">Determine the Bearing via Python Package <code class="docutils literal notranslate"><span class="pre">pyproj</span></code></a></li>
Expand Down
2 changes: 1 addition & 1 deletion _preview/1/searchindex.js

Large diffs are not rendered by default.

0 comments on commit 6fd7863

Please sign in to comment.