A Geometrical Geodesy Mathematica Package

6 downloads 0 Views 148KB Size Report
units of radians. The purpose of the units package, GeometricalGeodesy`Units`, is to provide conversions from various commonly-used units to and from meters ...
A Geometrical Geodesy Mathematica® Package THOMAS H. MEYER Department of Natural Resources Management and Engineering, University of Connecticut, 1376 Storrs Road, Storrs, CT 06269-4087, USA. e-mail: [email protected] Tel: +1-860-486-0145 Fax: +1-860-486-5480 Abstract. Mathematica® is an interactive computing environment and programming language that is well-known for its utility with scientific programming. In the Mathematica environment, suites of related software modules and functions are called packages and this paper introduces a geometrical geodesy package. This package includes conversions for many linear and angular units, definitions of many geodetic and reference ellipsoids, functions to extract or compute all the standard ellipsoid parameters, the definition of three principle geodetic coordinate systems (geodetic, geocentric Cartesian, and local Cartesian) and the conversions between them, and functions for computations on the ellipsoid. To our knowledge, this is the most complete collection of geometrical geodesy functions available in one place. The functions have been tested by replicating published test suites and are available for download from the author’s website.

Key words: geometric geodesy

Mathematica software packages

Introduction Geometrical geodesy is a subdisicpline of geodesy, along with satellite geodesy {Seeber 2003 #6480}, physical geodesy {Heiskanen & Moritz 1967 #3140}, mathematical geodesy (e.g., differential geodesy {Joseph Zund 1991 #7030}), dynamic geodesy, and others {Vanicek & Krakiwsky 1996 #3810}, p. 45. According to {Ewing & Mitchell 1970 #1200} p. 1, „... geometrical geodesy concerns the size and shape of the earth, the intercontinental ties among the land masses of the earth, and the dermination of positions, lengths of lines, and azimuth; as the the name implies, it has to do with the geometry of the earth.“ For the purposes of this paper, we draw a primary distinction between geometrical geodesy and physical geodesy. The latter is concerned with the physics and measurements involving gravity that are reduced for computations on a geodetic or reference ellipsoid. It is these computations that are the focus of this paper.

1

The primary geometrical geodesy topics covered in our package include transforming coordinates between coordinate systems, the reduction of gravitybased measurements, the computation of angles and distances given geodetic coordinates (the inverse problem), and the computation of coordinates given angles and distances (the direct problem). We omit datum transformations because they can either be accomplished with Helmert’s transformation, which is simply a time-dependent matrix multiplication and vector addition, or they are a surface-fitting problem such as the situation with NAD27 and NAD83. The former can be represented directly in a geocentric Cartesian coordinate system with vector addition and multiplication; no special package function is needed, although we note that Helmert transformations of positions given in geodetic coordinates in one step is not obvious, requiring equations such as the Molodensky formulae {Iliffe 2000 #3350} p. 27. Transformations between datums lacking an adequate Helmert transformation are accomplished with special-purpose programs, such as NADCON {Dewhurst 1990 #7020}, which is freely distributed by the NGS; it would serve no great purpose to replicate that effort in this package. We also omit cartographic projections as not being central to the subject. There appears to be two widely distributed geometrical geodesy software packages: the NGS geodetic toolkit and the geodesy package that is delivered as a standard package with Mathematica. The NGS toolkit (http://www.ngs.noaa.gov/TOOLS/) provides stand-alone FORTRAN programs for many geometrical geodetic computations. These include 

DEFLEC99, which computes the deflection of the vertical at the surface of the Earth for the conterminous United States, Alaska, Puerto Rico, Virgin Islands, and Hawaii {Roman 2003 #7000},



INVERSE, FORWARD, INVERS3D, FORWRD3D, and XyzWin which compute geodetic azimuth, ellipsoidal distance, geodetic positions, and XYZ-to-geodetic coordinate system transformations {Frakes 2003 #7010}, and



NADCON, which transforms NAD27 geodetic coordintes to and from NAD83 {Dewhurst 1990 #7020}.

2

These programs can be downloaded either as a standalone application or used online to perform calculations on demand. The source code is available and, although the programs are written with complicated user interfaces, it would not be hard to extract the mathematically relevant portions. In addition to the NGS Toolkit, the standard distribution of Mathematica comes with a very limited geodesy package that provides spherical distances, authalic radii, and nothing else. In addition to these software packages, there are many publications about practical implementations of geometrical geodesy computations. The textbook by {Hooijberg 1997 #4940} provides a list of several linear units, a number of geodetic datums and geodetic ellipsoids including their defining parameters, offers a collection of algorithms and BASIC subroutines for geodetic arc distances and the inverse problem using Kivioja’s method {Kivioja 1971 #4640}{Jank & Kivioja 1980 #4650}, and presents many cartographic projections. Additionally, there is a large number of papers giving formula and implementations of the direct and inverse problem, spherical distance computations, and tranforming geocentric Cartesian coordinates to geodetic, to name a few. We will not summarize this literature here; see {Meyer 2002 #4020} for a review. Rather, we will reference the specific sources providing formulae that were implemented in the package in the discussion of that specific computation. These contributions of software and literature are significant and helpful. However, the package described in this paper is, to the best knowledge of the author, the most complete package of its kind, having the benefit of providing all the functionality in one place, in one language, on a computationally sophisticated and portable platform.

Overview of Mathematica and the package Mathematica is an interactive computational environment and programming language invented by Stephen Wolfram {Wolfram 1999 #7040}. Mathematica features highly-advanced computational capabilities, such as arbitrary precision arithmetic, rational number arithmetic, symbolic computations, pattern matching and rule-oriented computation, and three-dimensional graphics. For example, 3

Mathematica can compute  sin  cos  d symbolically, producing the result  1 / 2 cos 2  ,

rather than a numerical approximation. Rational arithmetic and

symbolic algebraic processing allows expressions such as 2 or  to be used in expressions exactly, not as approximations. Arbitrary precision arithmetic allows computations with as many significant digits as are necessary, a great advantage for geometical geodesy computations involving coordinates with 14 significant digits. These features make Mathematica an ideal scientific computation platform. Although Mathematica is distributed with extensive mathematical packages, it has very weak geodesy support, as mentioned above. Therefore, our package fills this need. Our package consists of five subpackages that provide unit conversions, geodetic ellipsoids and their parameters, three geodetic coordinate systems, computations on the ellipsoid, reductions of observations, and a collection of miscellaneous helper functions, each of which is described below. The package has full Mathematica-style documentation that includes examples of usage for every function.

Package Details Each subpackage will now be described in detail.

Units The package performs all computations with linear units of meters and angular units of radians. The purpose of the units package, GeometricalGeodesy`Units`, is to provide conversions from various commonly-used units to and from meters and radians. The package defines 16 linear units (excluding aliases) and 10 angular units, see Table 1. The value of each unit is the quantity to multiple a measurement in the stated units to convert it to meters/radians. For example, the value of USFt is 1200/3937 and the value of gon is π/200, both expressed as ratios so that exact arithmetic will be used whenever possible. One uses these units simply by multiplying them by the quanity in the expressed units. For example, to convert 250 US Survey feet to meters, evaluate the Mathematica expression 4

250 USFt

which yields a result of 300000/3937, exactly. Note that the space character is an alias for the mulitplication operator in Mathematica, thus making it possible to write Mathematica expressions in a manner very natural to mathematicians. This syntax allows units to be mixed freely. For example, 2430.15 USFt + 320.432 Meter + 5 Rod + 41 GuntersChain - 336 Link

yields a result of 1843.49 (meters). This syntax also allows quantities to be expressed in units other than meters simply by dividing by the desired final units. For example, (2430.15 USFt + 320.432 Meter)/StatuteMile

yields a result of 0.659362 (statute miles). Angles are always converted to radians. Conversions are implemented for degrees/minutes/seconds (DMS), decimal degrees, gons, mils, and circles. Gons, mils, and circles operate analogously to linear units. For example evaluating 5 gon

results in π/40. For another example, suppose a total station measured a slant distance of 231.45 US Survey feet and a zenith angle of 98.79 gon. The Mathematica syntax to compute the horizontal distance is 231.45 USFt*Cos[98.79 gon]

which yields a result of 1.34076 (meters). The result has units of meters and is given as a decimal because both the numeric quantities in the expression (231.45 and 98.79) were expressed as decimals instead of rational numbers, thus implying an approximate quantity, as is appropriate. Angles are expressed in DMS using the syntax DMS[d,m,s]

where d is degrees, m is minutes, and s is seconds. For example, DMS[30,30,5] is the angle 30˚ 30’ 5’’ and evaluates to 21961π/129600 radians,

the exact value. Geodetic angles are specified with the same syntax with the addition of hemispherical designators: DMS[d,m,s,h]

where d is degrees, m is minutes, and s is seconds and h is one of East, North, West, South, E, W, N, or S. For example, DMS[41,48,42.36395,N] is a northern latitude and evaluates to 0.729453

radians. Similarly, DMS[172,15,2.05113,West] is a western longitude and 5

evaluates to –3.00634 radians. Angles in decimal degrees are converted to radians using the degree operator, written in Mathematica as a ˚. For example, 90.˚ evaluates to 1.570796327.

Radians are converted to DMS with the PDMS operator as PDMS[a]

where a is an angle in radians. For example, PDMS[.055678] evaluates to the list {3,11,24.4119}, being the components of 3˚ 11’ 24.4119’’.

Ellipsoids Coordinate Systems Computations Helper Functions

Installing and Using the Package Like any package, ours is loaded with the standard Mathematica command

Suggest Documents