YourName-HW04

your name
the date you completed the first version;  date of most recent revision
This template was revised February 28, 2021.

Introduction and Statement of Problem

The purpose of this notebook is to gain some experience finding the distance and azimuth between two points on a spherical Earth.

Statement of Problem.  What is the azimuth from Neenach in southern California (34°44’24”N, 118°37’24”W) in the direction of the shortest straight-line path to Pinnacles in west-central California (36°29’13”N, 121°10’01”W).  The azimuth of a bearing is measured in a clockwise direction relative to true north.  
     Write a Mathematica notebook that analyzes the input data to complete the following tasks.
     (a) Convert the given geographic coordinates of Neenach and Pinnacles to decimal geographic coordinates (see section 2.2.3).
     (b) Convert the decimal geographic coordinates to unit location vectors (locVectNeenach and locVectPinnacles), recalling that south latitudes and west longitudes are negative numbers.
     (c) Determine the circumferential distance of the shortest great-circle path from Neenach to Pinnacles.     
     (d) Determine the azimuth of the shortest great-circle path from Neenach to Pinnacles.

Input Data

The geographic coordinates of the North Pole are 90°N, 0°E.

The geographic coordinates of a given point within Pinnacles National Monument are latitude 36°29’13”N, longitude 121°10’01”W.

The geographic coordinates of a given point within the Neenach volcanic field are latitude 34°44’24”N, longitude 118°37’24”W.

User-Defined Functions and Modules

The user-defined function makeLocationVector[] acts on input geographic coordinates (decimal latitude and decimal longitude, both expressed in degrees) and returns the Cartesian-geographic coordinates of the unit location vector to that point.  This user-defined function is copied from the document “Kinematics-Chapter-2.nb.pdf” by Vince Cronin.

makeLocationVector[lat_, long_]:={Cos[lat Degree] Cos[long Degree], Cos[lat Degree] Sin[long Degree], Sin[lat Degree]};

The module findAzimuthVectInput[]) acts on unit location vectors to determine the azimuth from a reference point (location vector refPtVect) to a target point (location vector otherPtVect).  This user-defined function is copied from the document “Kinematics-Chapter-2.nb.pdf” by Vince Cronin.

findAzimuthVectInput[refPtVect_,otherPtVect_]:=Module[{northPole,vectorA,vectorB,θ1,θ2,vectorC,θ3,azimuth},northPole={0,0,1};vectorA = Cross[northPole,refPtVect];vectorB = Cross[otherPtVect,refPtVect];θ1=VectorAngle[vectorA,vectorB](180/π);θ2=VectorAngle[vectorA,otherPtVect](180/π);vectorC=Cross[refPtVect,vectorA];θ3=VectorAngle[vectorC,otherPtVect](180/π);azimuth=If[((θ2==90)∨(θ2==180)),If[(θ3<=90),0,180],If[(θ2>90),(360-θ1),θ1]];azimuth ];

The module findAzimuthGeogInput[]) acts on two sets of geographic coordinates to determine the azimuth from a reference point (refPtLat and refPtLong) to a target point (otherPtLat and otherPtLong).  This user-defined function is copied from the document “Kinematics-Chapter-2.nb.pdf” by Vince Cronin.

findAzimuthGeogInput[refPtLat_,refPtLong_,otherPtLat_,otherPtLong_]:=Module[{refPtVect,otherPtVect,northPole,vectorA,vectorB,θ1,θ2,vectorC,θ3,azimuth},refPtVect={Cos[refPtLat Degree] Cos[refPtLong Degree],Cos[refPtLat Degree] Sin[refPtLong Degree],Sin[refPtLat Degree]};otherPtVect={Cos[otherPtLat Degree] Cos[otherPtLong Degree],Cos[otherPtLat Degree] Sin[otherPtLong Degree],Sin[otherPtLat Degree]};northPole={0,0,1};vectorA = Cross[northPole,refPtVect];vectorB = Cross[otherPtVect,refPtVect];θ1=VectorAngle[vectorA,vectorB](180/π);θ2=VectorAngle[vectorA,otherPtVect](180/π);vectorC=Cross[refPtVect,vectorA];θ3=VectorAngle[vectorC,otherPtVect](180/π);azimuth=If[((θ2==90)∨(θ2==180)),If[(θ3<=90),0,180],If[(θ2>90),(360-θ1),θ1]];azimuth ];

Computation

Convert the given geographic coordinates to decimal geographic coordinates (Kinematics chapter 2, sec. 2.2.3)

The variables decimalLatPinnacles and decimalLongPinnacles are the decimal geographic coordinates associated with a point within Pinnacles National Monument in California (36°29’13”N, 121°10’01”W).  Remember that west longitudes are negative.

The variables decimalLatNeenach and decimalLongNeenach are the decimal geographic coordinates associated with a point within the Neenach volcanic field in California (34°44’24”N, 118°37’24”W).  Remember that west longitudes are negative.

Convert the decimal geographic coordinates to Cartesian geographic coordinates (Kinematics chapter 2, sec. 2.2.3)

The Code Fairy gave us a present by telling us the unit location vector locVectNorthPole.

locVectNorthPole={0,0,1};

The user-defined function makeLocationVector[] acts on the arguments decimalLatPinnacles and decimalLongPinnacles to yield the unit location vector locVectPinnacles.

The user-defined function makeLocationVector[] acts on the arguments decimalLatNeenach and decimalLongNeenach to yield the unit location vector locVectNeenach.

Determine the circumferential distance (in kilometers) of the shortest great-circle path from Neenach to Pinnacles (Kinematics chapter 2, sec. 2.3.4)

Assuming Earth has a mean radius of 6371.01 km, the built-in Mathematica function VectorAngle[] is used to provide a value for the variable circumfDist2Pinnacles.

Determine the azimuth (in degrees) of the shortest great-circle path from Neenach to Pinnacles (Kinematics chapter 2, sec. 2.4.3)

The azimuth from one point to another point on earth’s surface can be found using either of the user-defined modules findAzimuthVectInput[] or findAzimuthGeogInput[], which differ from each other in the type of input data that they operate on:  Cartesian location vectors or points described using geographic coordinates.  Use either one to provide a value for the variable azimuth2Pinnacles.

Output Data

Decimal geographic coordinates of the input points

decimalLatPinnacles

decimalLongPinnacles

decimalLatNeenach

decimalLongNeenach

Cartesian geographic coordinates of the input points

locVectPinnacles

locVectNeenach

Circumferential distance (in kilometers) of the shortest great-circle path from Neenach to Pinnacles

circumfDist2Pinnacles

Azimuth (in degrees) of the shortest great-circle path from Neenach to Pinnacles

azimuth2Pinnacles

References

Cronin, V.S., 2021, Kinematics-Chapter-2.nb:  unpublished draft, http://croninprojects.org/Vince/PlateKinematics/KinematicsCourse/Kinematics-Chapter-2.nb.pdf

Cronin, V.S., 2017, A brief primer on plate kinematics, with Mathematica:  unpublished draft, http://croninprojects.org/Vince/PlateKinematics/KinematicsPrimer/KinematicsCh2.nb