This Project Pythia Cookbook covers the background and mathematics of working with great circles and, where available, this cookbook will demonstrate how to determine the features of a great circle with both existing open-source Python packages and through spherical trigonometry
A great circle is the largest circle that can be drawn onto a sphere (like the Earth) that is the same diameter of the sphere. Great Circle arcs connect two positions on the curved surface of a planet like Earth and are commonly used for navigation that relies on "as-the crow flies" directions like planes, ships, and satellites
Image Source: Wolfram MathWorld
Great circles are commonly used in navigation, satellites in remote sensing, and working with coordinates on planets, but can be difficult to find resources to fully explain how to use them.
This cookbook is broken into two main sections:
- Foundations and Terminology
- Working with Great Circles
- "Great Circle Terminology": Covers the important terminology for working with and understanding great circles
- "Coordinate Systems": Covers important terminology and functions required to understand and converted to different types of coordinate systems like Cartesian, Spherical, Polar, and Latitude/Longitude
Each section will make use of plotting to visually demonstrate concepts with matplotlib
and cartopy
This is the main section of this notebook and will cover specific details about how to understand and calculate important features in great circles.
- Distance between Points on a Great Circle Arc
- Spherical Distance to Degrees
- Determine the Bearing of a Great Circle Arc
- Generate a Great Circle Arc with Intermediate Points
- Determine the Midpoint of a Great Circle Arc
- Generate a Great Circle Path
- Determine an Antipodal Point
- Determine the distance of a point to a great circle arc (cross-track and along-track distance)
- Determine if a point lies on a great circle arc and path (with and without tolerances)
- Determine the maximum latitude on a Great Circle Path
- Determine the minimum latitude on a Great Great path
- Determine when a great circle path crosses parallels
- Find the intersection of two great circle paths (always exists)
- Find the intersection of two great circle arcs (if it exists)
- Calculate the acute and obtuse angle of two Great Circle paths
- Calculate the Directed Angle of two Great Circle paths based on an intersection point
- Working with Spherical Triangles formed by great circle arcs
- Determine clockwise/counterclockwise ordering of points on spherical polygon
- Area and Permieter of quadrilateral patch on a unit sphere
- Determine if a given point is within a spherical polygon
- Mean center of spherical polygon
You can either run the notebook using Binder or on your local machine.
The simplest way to interact with a Jupyter Notebook is through
Binder, which enables the execution of a
Jupyter Book in the cloud. The details of how this works are not
important for now. All you need to know is how to launch a Pythia
Cookbooks chapter via Binder. Simply navigate your mouse to
the top right corner of the book chapter you are viewing and click
on the rocket ship icon, (see figure below), and be sure to select
“launch Binder”. After a moment you should be presented with a
notebook that you can interact with. I.e. you’ll be able to execute
and even change the example programs. You’ll see that the code cells
have no output at first, until you execute them by pressing
{kbd}Shift
+{kbd}Enter
. Complete details on how to interact with
a live Jupyter notebook are described in Getting Started with
Jupyter.
If you are interested in running this material locally on your computer, you will need to follow this workflow:
-
Clone the
https://github.com/ProjectPythia/great-circle-cookbook
repository:git clone https://github.com/ProjectPythia/great-circle-cookbook.git
-
Move into the
great-circle-cookbook
directorycd great-circle-cookbook
-
Create and activate your conda environment from the
environment.yml
fileconda env create -f environment.yml conda activate cookbook-gc
-
Move into the
notebooks
directory and start up Jupyterlabcd notebooks/ jupyter lab