[geographiclib] 01/12: Imported Upstream version 1.38

Ross Gammon ross-guest at moszumanska.debian.org
Mon Nov 3 19:11:56 UTC 2014


This is an automated email from the git hooks/post-receive script.

ross-guest pushed a commit to branch master
in repository geographiclib.

commit cccf5cbb2b5b723feec632179ad2444c26c5ba0c
Author: Ross Gammon <rossgammon at mail.dk>
Date:   Sun Oct 5 19:48:20 2014 +0200

    Imported Upstream version 1.38
---
 CMakeLists.txt                                    |  43 +-
 Makefile.am                                       |   2 +-
 Makefile.in                                       |   2 +-
 NEWS                                              |  21 +-
 README.md                                         |   4 +
 cmake/CMakeLists.txt                              |   8 +-
 cmake/project-config.cmake.in                     |   2 +-
 config.guess                                      | 313 ++++------
 config.sub                                        |  56 +-
 configure                                         |  24 +-
 configure.ac                                      |   6 +-
 doc/GeographicLib.dox                             | 668 ++++++++++++++++------
 doc/Makefile.am                                   |  12 +
 doc/Makefile.in                                   |  12 +
 doc/NETGeographicLib.dox                          |   2 +-
 doc/scripts/GeographicLib/DMS.js                  |   3 +-
 doc/scripts/geod-calc.html                        |   6 +-
 doc/scripts/geod-google-instructions.html         |   6 +-
 dotnet/NETGeographicLib/CMakeLists.txt            |  30 +-
 dotnet/NETGeographicLib/NormalGravity.h           |   2 -
 dotnet/examples/ManagedCPP/CMakeLists.txt         |   2 +-
 dotnet/examples/ManagedCPP/example-Rhumb.cpp      |   3 +-
 dotnet/examples/ManagedCPP/example-RhumbLine.cpp  |   2 +-
 dotnet/examples/ManagedCPP/example-UTMUPS.cpp     |   2 +-
 examples/CMakeLists.txt                           |  12 -
 include/GeographicLib/AlbersEqualArea.hpp         |   2 +-
 include/GeographicLib/Config.h                    |   4 +-
 include/GeographicLib/Ellipsoid.hpp               |   4 +-
 include/GeographicLib/EllipticFunction.hpp        |   8 +-
 include/GeographicLib/GeoCoords.hpp               |   2 +
 include/GeographicLib/Geocentric.hpp              |   2 +-
 include/GeographicLib/Geodesic.hpp                |   2 +-
 include/GeographicLib/GeodesicExact.hpp           |   2 +-
 include/GeographicLib/Geoid.hpp                   |   3 +-
 include/GeographicLib/LambertConformalConic.hpp   |   2 +-
 include/GeographicLib/MGRS.hpp                    |   2 +-
 include/GeographicLib/Math.hpp                    |   2 +-
 include/GeographicLib/OSGB.hpp                    |   2 +-
 include/GeographicLib/PolarStereographic.hpp      |   2 +-
 include/GeographicLib/TransverseMercator.hpp      |   2 +-
 include/GeographicLib/TransverseMercatorExact.hpp |   2 +-
 include/GeographicLib/UTMUPS.hpp                  |   2 +-
 man/CMakeLists.txt                                |  14 +
 man/CartConvert.1                                 |   2 +-
 man/CartConvert.usage                             |   2 +-
 man/ConicProj.1                                   |   2 +-
 man/ConicProj.usage                               |   2 +-
 man/GeoConvert.1                                  |   2 +-
 man/GeoConvert.usage                              |   2 +-
 man/GeodSolve.1                                   |   2 +-
 man/GeodSolve.usage                               |   2 +-
 man/GeodesicProj.1                                |   2 +-
 man/GeodesicProj.usage                            |   2 +-
 man/GeoidEval.1                                   |   2 +-
 man/GeoidEval.usage                               |   2 +-
 man/Gravity.1                                     |   2 +-
 man/Gravity.usage                                 |   2 +-
 man/MagneticField.1                               |   2 +-
 man/MagneticField.usage                           |   2 +-
 man/Makefile.am                                   |  38 +-
 man/Makefile.in                                   | 103 +++-
 man/Planimeter.1                                  |   2 +-
 man/Planimeter.usage                              |   2 +-
 man/RhumbSolve.1                                  |   2 +-
 man/RhumbSolve.usage                              |   2 +-
 man/TransverseMercatorProj.1                      |   2 +-
 man/TransverseMercatorProj.usage                  |   2 +-
 man/dummy.usage.in                                |   2 +-
 man/script.8.in                                   |  17 +
 matlab/CMakeLists.txt                             |   2 +-
 matlab/Makefile.am                                |   5 +-
 matlab/Makefile.in                                |   5 +-
 matlab/gedistance.m                               | 108 ++++
 matlab/gedoc.m                                    | 129 +++++
 matlab/geoddoc.m                                  |   6 +-
 matlab/gereckon.m                                 | 125 ++++
 pom.xml                                           |   2 +-
 src/AlbersEqualArea.cpp                           |   2 +-
 src/CMakeLists.txt                                |  33 +-
 src/DMS.cpp                                       |   3 +-
 src/Ellipsoid.cpp                                 |   4 +-
 src/Geocentric.cpp                                |   2 +-
 src/Geodesic.cpp                                  |  11 +-
 src/GeodesicExact.cpp                             |  11 +-
 src/GravityModel.cpp                              |  14 +-
 src/LambertConformalConic.cpp                     |   2 +-
 src/MGRS.cpp                                      |   2 +-
 src/MagneticModel.cpp                             |   4 +-
 src/PolarStereographic.cpp                        |   2 +-
 src/TransverseMercator.cpp                        |   2 +-
 src/TransverseMercatorExact.cpp                   |   8 +-
 src/UTMUPS.cpp                                    |   2 +-
 tools/CMakeLists.txt                              |  18 +-
 tools/CartConvert.cpp                             |   3 +-
 tools/GeoConvert.cpp                              |   2 +-
 tools/Makefile.am                                 |   2 +-
 96 files changed, 1378 insertions(+), 637 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6c8d967..a935df2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2,7 +2,7 @@ project (GeographicLib)
 
 # Version information
 set (PROJECT_VERSION_MAJOR 1)
-set (PROJECT_VERSION_MINOR 37)
+set (PROJECT_VERSION_MINOR 38)
 set (PROJECT_VERSION_PATCH 0)
 set (PROJECT_VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
 if (PROJECT_VERSION_PATCH GREATER 0)
@@ -43,7 +43,7 @@ endif ()
 # The library version tracks the numbering given by libtool in the
 # autoconf set up.
 set (LIBVERSION 13)
-set (LIBVERSIONFULL 13.0.0)
+set (LIBVERSIONFULL 13.0.1)
 string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
 string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
 
@@ -220,8 +220,14 @@ if (NOT MSVC)
     # Use relative path so that package is relocatable
     set (CMAKE_INSTALL_RPATH "\$ORIGIN/../lib${LIB_SUFFIX}")
   else ()
-    # Need absolute path with MacOSx
-    set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+    if (CMAKE_VERSION VERSION_LESS 2.8.12)
+      # Use absolute path with MacOSx
+      set (CMAKE_INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}")
+    else ()
+      # cmake 2.8.12 introduced a way to make the package relocatable.
+      # See also INSTALL_RPATH property on the tools.
+      set (CMAKE_MACOSX_RPATH ON)
+    endif ()
   endif ()
 endif ()
 
@@ -319,12 +325,12 @@ elseif (GEOGRAPHICLIB_PRECISION EQUAL 5)
     # to abide by the terms of this license.
     #
     # For Linux, use system versions of mpfr and gmp.  For Apple, use
-    # brew install mpfr.  For Windows, download
-    # MPFR-MPIR-x86-x64-MSVC2010.zip from the MPFR C++ site and unpack
-    # in the top-level directory.  The Windows build only works with
-    # GEOGRAPHICLIB_LIB_TYPE=STATIC.  NOTE: mpfr, gmp, and mpir are
-    # covered by the LGPL; be sure to abide by the terms of this
-    # license.
+    # brew install mpfr.  Recent versions of mpfr (3.0 or later) work
+    # fine.  For Windows, download MPFR-MPIR-x86-x64-MSVC2010.zip from
+    # the MPFR C++ site and unpack in the top-level directory.  The
+    # Windows build only works with GEOGRAPHICLIB_LIB_TYPE=STATIC.
+    # NOTE: mpfr, gmp, and mpir are covered by the LGPL; be sure to
+    # abide by the terms of this license.
     if (WIN32)
       if (MSVC AND NOT MSVC_VERSION LESS 1800)
         if (CMAKE_SIZEOF_VOID_P EQUAL 8)
@@ -362,7 +368,7 @@ if (APPLE AND GEOGRAPHICLIB_PRECISION EQUAL 2)
   if (CMAKE_SYSTEM_PROCESSOR MATCHES "i.86" OR
       CMAKE_SYSTEM_PROCESSOR MATCHES "amd64" OR
       CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
-    set (CMAKE_OSX_ARCHITECTURES "i386 -arch x86_64")
+    set (CMAKE_OSX_ARCHITECTURES "i386;x86_64")
   endif ()
 endif ()
 
@@ -382,7 +388,9 @@ endif ()
 # available on an end-user's system, the creation of the final
 # documentation is therefore only done in "MAINTAINER" mode.  The
 # maintainer runs "make distrib-all" which installs the transformed
-# documentation files into the source tree.
+# documentation files into the source tree.  Skip Apple here because
+# man/makeusage.sh uses "head --lines -4" to drop the last 4 lines of a
+# file and there's no simple equivalent for MacOSX
 if (NOT WIN32 AND NOT APPLE)
   find_program (HAVE_POD2MAN pod2man)
   find_program (HAVE_POD2HTML pod2html)
@@ -442,6 +450,17 @@ if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
   set (CMAKE_BUILD_TYPE Release)
 endif ()
 
+# Set output directories for Windows so that executables and dlls are
+# put in the same place
+if (WIN32)
+  # static libaries
+  set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+  # shared libraries
+  set (CMAKE_LIBRARY_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/lib")
+  # executables and dlls
+  set (CMAKE_RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
+endif ()
+
 # The list of tools (to be installed into, e.g., /usr/local/bin)
 set (TOOLS CartConvert ConicProj GeodesicProj GeoConvert GeodSolve
   GeoidEval Gravity MagneticField Planimeter RhumbSolve TransverseMercatorProj)
diff --git a/Makefile.am b/Makefile.am
index 8accc47..84a4610 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -9,7 +9,7 @@ ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = src man tools doc include matlab python cmake examples
 
-EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL pom.xml \
+EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL README.md pom.xml \
 	Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet
 
 dist-hook:
diff --git a/Makefile.in b/Makefile.in
index 10e91cb..c4ae540 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -337,7 +337,7 @@ top_srcdir = @top_srcdir@
 AUTOMAKE_OPTIONS = foreign
 ACLOCAL_AMFLAGS = -I m4
 SUBDIRS = src man tools doc include matlab python cmake examples
-EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL pom.xml \
+EXTRA_DIST = AUTHORS 00README.txt LICENSE.txt NEWS INSTALL README.md pom.xml \
 	Makefile.mk CMakeLists.txt windows maxima doc legacy java dotnet
 
 all: all-recursive
diff --git a/NEWS b/NEWS
index aa7f78d..cccb58e 100644
--- a/NEWS
+++ b/NEWS
@@ -4,7 +4,26 @@ For more information, see
 
     http://geographiclib.sourceforge.net/
 
-The current version of the library is 1.37.
+The current version of the library is 1.38.
+
+Changes between 1.38 (released 2014-10-02) and 1.37 versions:
+
+  * On MacOSX, the installed package is relocatable (for cmake version
+     2.8.12 and later).
+
+  * On Mac OSX, GeographicLib can be installed using homebrew.
+
+  * In cmake builds under Windows, set the output directories so that
+     binaries and shared libraries are together.
+
+  * Accept the minus sign as a synomym for - in DMS.{cpp,js}.
+
+  * The cmake configuration file geographiclib-depends.cmake has been
+     renamed to geographiclib-targets.cmake.
+
+  * Matlab/Octave routines for great ellipses added.
+
+  * Provide man pages for geographiclib-get-{geoids,gravity,magnetic}.
 
 Changes between 1.37 (released 2014-08-08) and 1.36 versions:
 
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..f111c67
--- /dev/null
+++ b/README.md
@@ -0,0 +1,4 @@
+GeographicLib
+=============
+
+A C++ library for geographic projections.
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index bbb5192..1a22c8e 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -14,7 +14,7 @@ configure_file (project-config.cmake.in
 configure_file (project-config-version.cmake.in
   "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-config-version.cmake" @ONLY)
 export (TARGETS ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES} ${TOOLS}
-  FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-depends.cmake")
+  FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME_LOWER}-targets.cmake")
 
 # geographiclib-config.cmake for the install tree.  It's installed in
 # ${INSTALL_CMAKE_DIR} and @PROJECT_ROOT_DIR@ is the relative
@@ -44,12 +44,12 @@ install (FILES
   RENAME "${PROJECT_NAME_LOWER}-config-version.cmake")
 # Make information about the cmake targets (the library and the tools)
 # available.
-install (EXPORT depends
-  FILE ${PROJECT_NAME_LOWER}-depends.cmake
+install (EXPORT targets
+  FILE ${PROJECT_NAME_LOWER}-targets.cmake
   DESTINATION "${INSTALL_CMAKE_DIR}")
 
 if (MSVC AND PACKAGE_DEBUG_LIBS)
   install (FILES
-    "${PROJECT_BINARY_DIR}/cmake/CMakeFiles/Export/cmake/${PROJECT_NAME_LOWER}-depends-debug.cmake"
+    "${PROJECT_BINARY_DIR}/cmake/CMakeFiles/Export/cmake/${PROJECT_NAME_LOWER}-targets-debug.cmake"
     DESTINATION "${INSTALL_CMAKE_DIR}" CONFIGURATIONS Release)
 endif ()
diff --git a/cmake/project-config.cmake.in b/cmake/project-config.cmake.in
index d0e39f3..1f13aa1 100644
--- a/cmake/project-config.cmake.in
+++ b/cmake/project-config.cmake.in
@@ -46,7 +46,7 @@ set (@PROJECT_NAME at _STATIC_LIBRARIES @PROJECT_STATIC_LIBRARIES@)
 set (@PROJECT_NAME at _SHARED_DEFINITIONS @PROJECT_SHARED_DEFINITIONS@)
 set (@PROJECT_NAME at _STATIC_DEFINITIONS @PROJECT_STATIC_DEFINITIONS@)
 # Read in the exported definition of the library
-include ("${_DIR}/@PROJECT_NAME_LOWER at -depends.cmake")
+include ("${_DIR}/@PROJECT_NAME_LOWER at -targets.cmake")
 
 unset (_ROOT)
 unset (_DIR)
diff --git a/config.guess b/config.guess
index 1804e9f..1f5c50c 100755
--- a/config.guess
+++ b/config.guess
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Attempt to guess a canonical system name.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2012-12-29'
+timestamp='2014-03-23'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -26,7 +24,7 @@ timestamp='2012-12-29'
 # program.  This Exception is an additional permission under section 7
 # of the GNU General Public License, version 3 ("GPLv3").
 #
-# Originally written by Per Bothner. 
+# Originally written by Per Bothner.
 #
 # You can get the latest version of this script from:
 # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
@@ -52,9 +50,7 @@ version="\
 GNU config.guess ($timestamp)
 
 Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -136,6 +132,27 @@ UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
 UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
 UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
 
+case "${UNAME_SYSTEM}" in
+Linux|GNU|GNU/*)
+	# If the system lacks a compiler, then just pick glibc.
+	# We could probably try harder.
+	LIBC=gnu
+
+	eval $set_cc_for_build
+	cat <<-EOF > $dummy.c
+	#include <features.h>
+	#if defined(__UCLIBC__)
+	LIBC=uclibc
+	#elif defined(__dietlibc__)
+	LIBC=dietlibc
+	#else
+	LIBC=gnu
+	#endif
+	EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+	;;
+esac
+
 # Note: order is significant - the case branches are not exclusive.
 
 case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
@@ -809,7 +826,7 @@ EOF
     *:MINGW*:*)
 	echo ${UNAME_MACHINE}-pc-mingw32
 	exit ;;
-    i*:MSYS*:*)
+    *:MSYS*:*)
 	echo ${UNAME_MACHINE}-pc-msys
 	exit ;;
     i*:windows32*:*)
@@ -857,21 +874,21 @@ EOF
 	exit ;;
     *:GNU:*:*)
 	# the GNU system
-	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
 	exit ;;
     *:GNU/*:*:*)
 	# other systems with GNU libc and userland
-	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
 	exit ;;
     i*86:Minix:*:*)
 	echo ${UNAME_MACHINE}-pc-minix
 	exit ;;
     aarch64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     aarch64_be:Linux:*:*)
 	UNAME_MACHINE=aarch64_be
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     alpha:Linux:*:*)
 	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
@@ -884,59 +901,54 @@ EOF
 	  EV68*) UNAME_MACHINE=alphaev68 ;;
 	esac
 	objdump --private-headers /bin/sh | grep -q ld.so.1
-	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
-	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+	exit ;;
+    arc:Linux:*:* | arceb:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     arm*:Linux:*:*)
 	eval $set_cc_for_build
 	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
 	    | grep -q __ARM_EABI__
 	then
-	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	    echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	else
 	    if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
 		| grep -q __ARM_PCS_VFP
 	    then
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi
 	    else
-		echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+		echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf
 	    fi
 	fi
 	exit ;;
     avr32*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     cris:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     crisv32:Linux:*:*)
-	echo ${UNAME_MACHINE}-axis-linux-gnu
+	echo ${UNAME_MACHINE}-axis-linux-${LIBC}
 	exit ;;
     frv:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     hexagon:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:Linux:*:*)
-	LIBC=gnu
-	eval $set_cc_for_build
-	sed 's/^	//' << EOF >$dummy.c
-	#ifdef __dietlibc__
-	LIBC=dietlibc
-	#endif
-EOF
-	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
-	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	echo ${UNAME_MACHINE}-pc-linux-${LIBC}
 	exit ;;
     ia64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m32r*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     m68*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     mips:Linux:*:* | mips64:Linux:*:*)
 	eval $set_cc_for_build
@@ -955,54 +967,63 @@ EOF
 	#endif
 EOF
 	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
-	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
 	;;
-    or32:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+    openrisc*:Linux:*:*)
+	echo or1k-unknown-linux-${LIBC}
+	exit ;;
+    or32:Linux:*:* | or1k*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     padre:Linux:*:*)
-	echo sparc-unknown-linux-gnu
+	echo sparc-unknown-linux-${LIBC}
 	exit ;;
     parisc64:Linux:*:* | hppa64:Linux:*:*)
-	echo hppa64-unknown-linux-gnu
+	echo hppa64-unknown-linux-${LIBC}
 	exit ;;
     parisc:Linux:*:* | hppa:Linux:*:*)
 	# Look for CPU level
 	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
-	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
-	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
-	  *)    echo hppa-unknown-linux-gnu ;;
+	  PA7*) echo hppa1.1-unknown-linux-${LIBC} ;;
+	  PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+	  *)    echo hppa-unknown-linux-${LIBC} ;;
 	esac
 	exit ;;
     ppc64:Linux:*:*)
-	echo powerpc64-unknown-linux-gnu
+	echo powerpc64-unknown-linux-${LIBC}
 	exit ;;
     ppc:Linux:*:*)
-	echo powerpc-unknown-linux-gnu
+	echo powerpc-unknown-linux-${LIBC}
+	exit ;;
+    ppc64le:Linux:*:*)
+	echo powerpc64le-unknown-linux-${LIBC}
+	exit ;;
+    ppcle:Linux:*:*)
+	echo powerpcle-unknown-linux-${LIBC}
 	exit ;;
     s390:Linux:*:* | s390x:Linux:*:*)
-	echo ${UNAME_MACHINE}-ibm-linux
+	echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
 	exit ;;
     sh64*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sh*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     sparc:Linux:*:* | sparc64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     tile*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     vax:Linux:*:*)
-	echo ${UNAME_MACHINE}-dec-linux-gnu
+	echo ${UNAME_MACHINE}-dec-linux-${LIBC}
 	exit ;;
     x86_64:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     xtensa*:Linux:*:*)
-	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
 	exit ;;
     i*86:DYNIX/ptx:4*:*)
 	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
@@ -1235,19 +1256,31 @@ EOF
 	exit ;;
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
-	case $UNAME_PROCESSOR in
-	    i386)
-		eval $set_cc_for_build
-		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
-		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
-		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
-		      grep IS_64BIT_ARCH >/dev/null
-		  then
-		      UNAME_PROCESSOR="x86_64"
-		  fi
-		fi ;;
-	    unknown) UNAME_PROCESSOR=powerpc ;;
-	esac
+	eval $set_cc_for_build
+	if test "$UNAME_PROCESSOR" = unknown ; then
+	    UNAME_PROCESSOR=powerpc
+	fi
+	if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
+	    if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		    (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		    grep IS_64BIT_ARCH >/dev/null
+		then
+		    case $UNAME_PROCESSOR in
+			i386) UNAME_PROCESSOR=x86_64 ;;
+			powerpc) UNAME_PROCESSOR=powerpc64 ;;
+		    esac
+		fi
+	    fi
+	elif test "$UNAME_PROCESSOR" = i386 ; then
+	    # Avoid executing cc on OS X 10.9, as it ships with a stub
+	    # that puts up a graphical alert prompting to install
+	    # developer tools.  Any system running Mac OS X 10.7 or
+	    # later (Darwin 11 and later) is required to have a 64-bit
+	    # processor. This is not true of the ARM version of Darwin
+	    # that Apple uses in portable devices.
+	    UNAME_PROCESSOR=x86_64
+	fi
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
 	exit ;;
     *:procnto*:*:* | *:QNX:[0123456789]*:*)
@@ -1338,154 +1371,6 @@ EOF
 	exit ;;
 esac
 
-eval $set_cc_for_build
-cat >$dummy.c <<EOF
-#ifdef _SEQUENT_
-# include <sys/types.h>
-# include <sys/utsname.h>
-#endif
-main ()
-{
-#if defined (sony)
-#if defined (MIPSEB)
-  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
-     I don't know....  */
-  printf ("mips-sony-bsd\n"); exit (0);
-#else
-#include <sys/param.h>
-  printf ("m68k-sony-newsos%s\n",
-#ifdef NEWSOS4
-	"4"
-#else
-	""
-#endif
-	); exit (0);
-#endif
-#endif
-
-#if defined (__arm) && defined (__acorn) && defined (__unix)
-  printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
-  printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
-#if defined (NeXT)
-#if !defined (__ARCHITECTURE__)
-#define __ARCHITECTURE__ "m68k"
-#endif
-  int version;
-  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
-  if (version < 4)
-    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
-  else
-    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
-  exit (0);
-#endif
-
-#if defined (MULTIMAX) || defined (n16)
-#if defined (UMAXV)
-  printf ("ns32k-encore-sysv\n"); exit (0);
-#else
-#if defined (CMU)
-  printf ("ns32k-encore-mach\n"); exit (0);
-#else
-  printf ("ns32k-encore-bsd\n"); exit (0);
-#endif
-#endif
-#endif
-
-#if defined (__386BSD__)
-  printf ("i386-pc-bsd\n"); exit (0);
-#endif
-
-#if defined (sequent)
-#if defined (i386)
-  printf ("i386-sequent-dynix\n"); exit (0);
-#endif
-#if defined (ns32000)
-  printf ("ns32k-sequent-dynix\n"); exit (0);
-#endif
-#endif
-
-#if defined (_SEQUENT_)
-    struct utsname un;
-
-    uname(&un);
-
-    if (strncmp(un.version, "V2", 2) == 0) {
-	printf ("i386-sequent-ptx2\n"); exit (0);
-    }
-    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
-	printf ("i386-sequent-ptx1\n"); exit (0);
-    }
-    printf ("i386-sequent-ptx\n"); exit (0);
-
-#endif
-
-#if defined (vax)
-# if !defined (ultrix)
-#  include <sys/param.h>
-#  if defined (BSD)
-#   if BSD == 43
-      printf ("vax-dec-bsd4.3\n"); exit (0);
-#   else
-#    if BSD == 199006
-      printf ("vax-dec-bsd4.3reno\n"); exit (0);
-#    else
-      printf ("vax-dec-bsd\n"); exit (0);
-#    endif
-#   endif
-#  else
-    printf ("vax-dec-bsd\n"); exit (0);
-#  endif
-# else
-    printf ("vax-dec-ultrix\n"); exit (0);
-# endif
-#endif
-
-#if defined (alliant) && defined (i860)
-  printf ("i860-alliant-bsd\n"); exit (0);
-#endif
-
-  exit (1);
-}
-EOF
-
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
-	{ echo "$SYSTEM_NAME"; exit; }
-
-# Apollos put the system type in the environment.
-
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
-
-# Convex versions that predate uname can use getsysinfo(1)
-
-if [ -x /usr/convex/getsysinfo ]
-then
-    case `getsysinfo -f cpu_type` in
-    c1*)
-	echo c1-convex-bsd
-	exit ;;
-    c2*)
-	if getsysinfo -f scalar_acc
-	then echo c32-convex-bsd
-	else echo c2-convex-bsd
-	fi
-	exit ;;
-    c34*)
-	echo c34-convex-bsd
-	exit ;;
-    c38*)
-	echo c38-convex-bsd
-	exit ;;
-    c4*)
-	echo c4-convex-bsd
-	exit ;;
-    esac
-fi
-
 cat >&2 <<EOF
 $0: unable to guess system type
 
diff --git a/config.sub b/config.sub
index 52f04bc..66c5074 100755
--- a/config.sub
+++ b/config.sub
@@ -1,10 +1,8 @@
 #! /bin/sh
 # Configuration validation subroutine script.
-#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-#   2011, 2012, 2013 Free Software Foundation, Inc.
+#   Copyright 1992-2014 Free Software Foundation, Inc.
 
-timestamp='2012-12-29'
+timestamp='2014-07-28'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -70,9 +68,7 @@ Report bugs and patches to <config-patches at gnu.org>."
 version="\
 GNU config.sub ($timestamp)
 
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
-2012, 2013 Free Software Foundation, Inc.
+Copyright 1992-2014 Free Software Foundation, Inc.
 
 This is free software; see the source for copying conditions.  There is NO
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -256,12 +252,12 @@ case $basic_machine in
 	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
 	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
 	| am33_2.0 \
-	| arc \
+	| arc | arceb \
 	| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
 	| avr | avr32 \
 	| be32 | be64 \
 	| bfin \
-	| c4x | clipper \
+	| c4x | c8051 | clipper \
 	| d10v | d30v | dlx | dsp16xx \
 	| epiphany \
 	| fido | fr30 | frv \
@@ -269,6 +265,7 @@ case $basic_machine in
 	| hexagon \
 	| i370 | i860 | i960 | ia64 \
 	| ip2k | iq2000 \
+	| k1om \
 	| le32 | le64 \
 	| lm32 \
 	| m32c | m32r | m32rle | m68000 | m68k | m88k \
@@ -286,20 +283,22 @@ case $basic_machine in
 	| mips64vr5900 | mips64vr5900el \
 	| mipsisa32 | mipsisa32el \
 	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa32r6 | mipsisa32r6el \
 	| mipsisa64 | mipsisa64el \
 	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64r6 | mipsisa64r6el \
 	| mipsisa64sb1 | mipsisa64sb1el \
 	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipsr5900 | mipsr5900el \
 	| mipstx39 | mipstx39el \
 	| mn10200 | mn10300 \
 	| moxie \
 	| mt \
 	| msp430 \
 	| nds32 | nds32le | nds32be \
-	| nios | nios2 \
+	| nios | nios2 | nios2eb | nios2el \
 	| ns16k | ns32k \
-	| open8 \
-	| or32 \
+	| open8 | or1k | or1knd | or32 \
 	| pdp10 | pdp11 | pj | pjl \
 	| powerpc | powerpc64 | powerpc64le | powerpcle \
 	| pyramid \
@@ -327,7 +326,7 @@ case $basic_machine in
 	c6x)
 		basic_machine=tic6x-unknown
 		;;
-	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
+	m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
 		basic_machine=$basic_machine-unknown
 		os=-none
 		;;
@@ -369,13 +368,13 @@ case $basic_machine in
 	| aarch64-* | aarch64_be-* \
 	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
 	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
-	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
 	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
 	| avr-* | avr32-* \
 	| be32-* | be64-* \
 	| bfin-* | bs2000-* \
 	| c[123]* | c30-* | [cjt]90-* | c4x-* \
-	| clipper-* | craynv-* | cydra-* \
+	| c8051-* | clipper-* | craynv-* | cydra-* \
 	| d10v-* | d30v-* | dlx-* \
 	| elxsi-* \
 	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
@@ -384,6 +383,7 @@ case $basic_machine in
 	| hexagon-* \
 	| i*86-* | i860-* | i960-* | ia64-* \
 	| ip2k-* | iq2000-* \
+	| k1om-* \
 	| le32-* | le64-* \
 	| lm32-* \
 	| m32c-* | m32r-* | m32rle-* \
@@ -403,18 +403,22 @@ case $basic_machine in
 	| mips64vr5900-* | mips64vr5900el-* \
 	| mipsisa32-* | mipsisa32el-* \
 	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa32r6-* | mipsisa32r6el-* \
 	| mipsisa64-* | mipsisa64el-* \
 	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64r6-* | mipsisa64r6el-* \
 	| mipsisa64sb1-* | mipsisa64sb1el-* \
 	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipsr5900-* | mipsr5900el-* \
 	| mipstx39-* | mipstx39el-* \
 	| mmix-* \
 	| mt-* \
 	| msp430-* \
 	| nds32-* | nds32le-* | nds32be-* \
-	| nios-* | nios2-* \
+	| nios-* | nios2-* | nios2eb-* | nios2el-* \
 	| none-* | np1-* | ns16k-* | ns32k-* \
 	| open8-* \
+	| or1k*-* \
 	| orion-* \
 	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
 	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
@@ -796,7 +800,7 @@ case $basic_machine in
 		os=-mingw64
 		;;
 	mingw32)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-mingw32
 		;;
 	mingw32ce)
@@ -824,6 +828,10 @@ case $basic_machine in
 		basic_machine=powerpc-unknown
 		os=-morphos
 		;;
+	moxiebox)
+		basic_machine=moxie-unknown
+		os=-moxiebox
+		;;
 	msdos)
 		basic_machine=i386-pc
 		os=-msdos
@@ -832,7 +840,7 @@ case $basic_machine in
 		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
 		;;
 	msys)
-		basic_machine=i386-pc
+		basic_machine=i686-pc
 		os=-msys
 		;;
 	mvs)
@@ -1354,7 +1362,7 @@ case $os in
 	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
 	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
 	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
-	      | -sym* | -kopensolaris* \
+	      | -sym* | -kopensolaris* | -plan9* \
 	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
 	      | -aos* | -aros* \
 	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
@@ -1369,14 +1377,14 @@ case $os in
 	      | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
 	      | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
 	      | -linux-newlib* | -linux-musl* | -linux-uclibc* \
-	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
 	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
 	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
 	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
 	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
 	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
 	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
-	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
 	# Remember, each alternative MUST END IN *, to match a version number.
 		;;
 	-qnx*)
@@ -1500,9 +1508,6 @@ case $os in
 	-aros*)
 		os=-aros
 		;;
-	-kaos*)
-		os=-kaos
-		;;
 	-zvmoe)
 		os=-zvmoe
 		;;
@@ -1551,6 +1556,9 @@ case $basic_machine in
 	c4x-* | tic4x-*)
 		os=-coff
 		;;
+	c8051-*)
+		os=-elf
+		;;
 	hexagon-*)
 		os=-elf
 		;;
diff --git a/configure b/configure
index 890110b..cb530ff 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for GeographicLib 1.37.
+# Generated by GNU Autoconf 2.69 for GeographicLib 1.38.
 #
 # Report bugs to <charles at karney.com>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='GeographicLib'
 PACKAGE_TARNAME='geographiclib'
-PACKAGE_VERSION='1.37'
-PACKAGE_STRING='GeographicLib 1.37'
+PACKAGE_VERSION='1.38'
+PACKAGE_STRING='GeographicLib 1.38'
 PACKAGE_BUGREPORT='charles at karney.com'
 PACKAGE_URL=''
 
@@ -1343,7 +1343,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures GeographicLib 1.37 to adapt to many kinds of systems.
+\`configure' configures GeographicLib 1.38 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1414,7 +1414,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of GeographicLib 1.37:";;
+     short | recursive ) echo "Configuration of GeographicLib 1.38:";;
    esac
   cat <<\_ACEOF
 
@@ -1525,7 +1525,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-GeographicLib configure 1.37
+GeographicLib configure 1.38
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1966,7 +1966,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by GeographicLib $as_me 1.37, which was
+It was created by GeographicLib $as_me 1.38, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2943,7 +2943,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='geographiclib'
- VERSION='1.37'
+ VERSION='1.38'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2996,7 +2996,7 @@ am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
 
 
 GEOGRAPHICLIB_VERSION_MAJOR=1
-GEOGRAPHICLIB_VERSION_MINOR=37
+GEOGRAPHICLIB_VERSION_MINOR=38
 GEOGRAPHICLIB_VERSION_PATCH=0
 
 cat >>confdefs.h <<_ACEOF
@@ -3045,7 +3045,7 @@ ac_config_headers="$ac_config_headers include/GeographicLib/Config-ac.h"
 
 
 LT_CURRENT=13
-LT_REVISION=0
+LT_REVISION=1
 LT_AGE=0
 
 
@@ -16243,7 +16243,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by GeographicLib $as_me 1.37, which was
+This file was extended by GeographicLib $as_me 1.38, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16309,7 +16309,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-GeographicLib config.status 1.37
+GeographicLib config.status 1.38
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.ac b/configure.ac
index 379b593..3370221 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,7 @@
 dnl
 dnl Copyright (C) 2009, Francesco P. Lovergine <frankie at debian.org>
 
-AC_INIT([GeographicLib],[1.37],[charles at karney.com])
+AC_INIT([GeographicLib],[1.38],[charles at karney.com])
 AC_CANONICAL_SYSTEM
 AC_PREREQ(2.61)
 AC_CONFIG_SRCDIR(src/Geodesic.cpp)
@@ -9,7 +9,7 @@ AC_CONFIG_MACRO_DIR(m4)
 AM_INIT_AUTOMAKE
 
 GEOGRAPHICLIB_VERSION_MAJOR=1
-GEOGRAPHICLIB_VERSION_MINOR=37
+GEOGRAPHICLIB_VERSION_MINOR=38
 GEOGRAPHICLIB_VERSION_PATCH=0
 AC_DEFINE_UNQUOTED([GEOGRAPHICLIB_VERSION_MAJOR],
 	[$GEOGRAPHICLIB_VERSION_MAJOR],[major version number])
@@ -35,7 +35,7 @@ dnl Interfaces changed/added/removed:   CURRENT++ REVISION=0
 dnl Interfaces added:                   AGE++
 dnl Interfaces removed:                 AGE=0
 LT_CURRENT=13
-LT_REVISION=0
+LT_REVISION=1
 LT_AGE=0
 AC_SUBST(LT_CURRENT)
 AC_SUBST(LT_REVISION)
diff --git a/doc/GeographicLib.dox b/doc/GeographicLib.dox
index b472a39..700a45a 100644
--- a/doc/GeographicLib.dox
+++ b/doc/GeographicLib.dox
@@ -11,8 +11,8 @@ namespace GeographicLib {
 /**
 \mainpage GeographicLib library
 \author Charles F. F. Karney (charles at karney.com)
-\version 1.37
-\date 2014-08-08
+\version 1.38
+\date 2014-10-02
 
 \section abstract Abstract
 
@@ -45,24 +45,20 @@ The main project page is at
   http://sourceforge.net/projects/geographiclib </a>
 .
 The code is available for download at
-- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.37.tar.gz">
-  GeographicLib-1.37.tar.gz</a>
-- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.37.zip">
-  GeographicLib-1.37.zip</a>
+- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.38.tar.gz">
+  GeographicLib-1.38.tar.gz</a>
+- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.38.zip">
+  GeographicLib-1.38.zip</a>
 .
 as either a compressed tar file (tar.gz) or a zip file.  (The two
 archives have identical contents, except that the zip file has DOS
 line endings.)  Alternatively you can get the latest release using git
 \verbatim
-  git clone -b r1.37 git://git.code.sf.net/p/geographiclib/code geographiclib
+  git clone -b r1.38 git://git.code.sf.net/p/geographiclib/code geographiclib
 \endverbatim
-There are also binary installers for Windows available at
-- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.37-win32.exe">
-  GeographicLib-1.37-win32.exe</a>
-- <a href="http://sf.net/projects/geographiclib/files/distrib/GeographicLib-1.37-win64.exe">
-  GeographicLib-1.37-win64.exe</a>
-.
-It is licensed under the
+There are also binary installers available for some platforms.  See \ref binaryinst.
+
+GeographicLib is licensed under the
 <a href="http://www.opensource.org/licenses/MIT">MIT/X11 License</a>;
 see <a href="LICENSE.txt">LICENSE.txt</a> for the terms.
 For more information, see http://geographiclib.sourceforge.net/.
@@ -80,6 +76,7 @@ For more information, see http://geographiclib.sourceforge.net/.
  - \ref geodesic
  - \ref triaxial
  - \ref rhumb
+ - \ref greatellipse
  - \ref transversemercator
  - \ref geocentric
  - \ref highprec
@@ -183,14 +180,14 @@ GeographicLib has been developed under Linux with the g++ compiler
 2012, and 2013.  Earlier versions were tested also under Visual Studio
 2005 and 2008 and under Darwin and Solaris.  It should compile on a wide
 range of other systems.  First download either
-<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.37.tar.gz">
-GeographicLib-1.37.tar.gz</a> or
-<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.37.zip">
-GeographicLib-1.37.zip</a> (or
-<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.37-win32.exe">
-GeographicLib-1.37-win32.exe</a> or
-<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.37-win64.exe">
-GeographicLib-1.37-win64.exe</a> for binary installation under Windows).
+<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.38.tar.gz">
+GeographicLib-1.38.tar.gz</a> or
+<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.38.zip">
+GeographicLib-1.38.zip</a> (or
+<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.38-win32.exe">
+GeographicLib-1.38-win32.exe</a> or
+<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.38-win64.exe">
+GeographicLib-1.38-win64.exe</a> for binary installation under Windows).
 Then pick one of the first five options below:
 - \ref cmake.  This is the preferred installation method as it will work
   on the widest range of platforms.  However it requires that you have
@@ -201,7 +198,7 @@ Then pick one of the first five options below:
   and GNU make on Linux and many Unix platforms.
 - \ref windows.  This is a simple installation method that works with
   Visual Studio 2005, 2008, and 2010 under Windows.
-- \ref windowsbin.  Use this installation method if you only need to use
+- \ref binaryinst.  Use this installation method if you only need to use
   the \ref utilities supplied with GeographicLib.  (This method also
   installs the header files and the library for use by Visual Studio 10.)
 - \ref qt.  How to compile GeographicLib so that it can be used by Qt
@@ -266,10 +263,10 @@ work also for Visual Studio 12 Express (2013).
 
 Here are the steps to compile and install GeographicLib:
 - Unpack the source, running one of \verbatim
-  tar xfpz GeographicLib-1.37.tar.gz
-  unzip -q GeographicLib-1.37.zip \endverbatim
+  tar xfpz GeographicLib-1.38.tar.gz
+  unzip -q GeographicLib-1.38.zip \endverbatim
   then enter the directory created with one of \verbatim
-  cd GeographicLib-1.37 \endverbatim
+  cd GeographicLib-1.38 \endverbatim
 - Create a separate build directory and enter it, for example, \verbatim
   mkdir BUILD
   cd BUILD \endverbatim
@@ -277,8 +274,8 @@ Here are the steps to compile and install GeographicLib:
   and MacOSX systems, the command is \verbatim
   cmake .. \endverbatim
   For Windows, the command is typically one of \verbatim
-  cmake -G "Visual Studio 10" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10/GeographicLib-1.37 ..
-  cmake -G "Visual Studio 9 2008" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc9/GeographicLib-1.37 ..
+  cmake -G "Visual Studio 10" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10/GeographicLib-1.38 ..
+  cmake -G "Visual Studio 9 2008" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc9/GeographicLib-1.38 ..
 \endverbatim
   The definitions of CMAKE_INSTALL_PREFIX are optional (see below).  The
   settings given above are recommended to ensure that packages that use
@@ -294,7 +291,7 @@ Here are the steps to compile and install GeographicLib:
     convention.  If it is on ON (the Linux default), the installation
     is to a common directory, e.g., /usr/local.  If it is OFF (the
     Windows default), the installation directory contains the package
-    name, e.g., C:/pkg/GeographicLib-1.37.  The installation
+    name, e.g., C:/pkg/GeographicLib-1.38.  The installation
     directories for the documentation, cmake configuration, python and
     matlab interfaces all depend on the variable with deeper paths
     relative to CMAKE_INSTALL_PREFIX being used when it's ON:
@@ -309,7 +306,7 @@ Here are the steps to compile and install GeographicLib:
     For windows systems, it is recommended to use a prefix which
     includes the compiler version, as shown above (and also, possibly,
     whether this is a 64-bit build, e.g., <code>cmake -G "Visual Studio
-    10 Win64" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10-x64/GeographicLib-1.37
+    10 Win64" -D CMAKE_INSTALL_PREFIX=C:/pkg-vc10-x64/GeographicLib-1.38
     ..</code>).  If you just want to try the library to see if it suits
     your needs, pick, for example,
     <code>CMAKE_INSTALL_PREFIX</code>=/tmp/geographic.
@@ -406,9 +403,9 @@ Here are the steps to compile and install GeographicLib:
 The method works on most Unix-like systems including Linux and Mac OS X.
 Here are the steps to compile and install GeographicLib:
 - Unpack the source, running \verbatim
-  tar xfpz GeographicLib-1.37.tar.gz \endverbatim
+  tar xfpz GeographicLib-1.38.tar.gz \endverbatim
   then enter the directory created \verbatim
-  cd GeographicLib-1.37 \endverbatim
+  cd GeographicLib-1.38 \endverbatim
 - Create a separate build directory and enter it, for example, \verbatim
   mkdir BUILD
   cd BUILD \endverbatim
@@ -437,9 +434,9 @@ and g++.  This builds a static library and the examples.
 
 Here are the steps to compile and install GeographicLib:
 - Unpack the source, running \verbatim
-  tar xfpz GeographicLib-1.37.tar.gz \endverbatim
+  tar xfpz GeographicLib-1.38.tar.gz \endverbatim
   then enter the directory created \verbatim
-  cd GeographicLib-1.37 \endverbatim
+  cd GeographicLib-1.38 \endverbatim
 - Edit \verbatim
   include/GeographicLib/Config.h \endverbatim
   If your C++ compiler does not recognize the long double type
@@ -470,8 +467,8 @@ static library and the utilities.  If you only have Visual Studio 2003,
 use cmake to create the necessary solution file, see \ref cmake.  (cmake
 is needed to build the Matlab interface and to run the tests.)
 - Unpack the source, running \verbatim
-  unzip -q GeographicLib-1.37.zip \endverbatim
-- Open GeographicLib-1.37/windows/GeographicLib-vc10.sln in Visual Studio
+  unzip -q GeographicLib-1.38.zip \endverbatim
+- Open GeographicLib-1.38/windows/GeographicLib-vc10.sln in Visual Studio
   2010 (for Visual Studio 2005 and 2008, replace -vc10 by -vc8 or -vc9;
   for Visual Studio Express 2010, replace -vc10 by -vc10x).
 - Pick the build type (e.g., Release), and select "Build Solution".
@@ -489,7 +486,11 @@ is needed to build the Matlab interface and to run the tests.)
 The Visual Studio 10 solution also contains projects to build
 <a href="NET/index.html">NETGeographicLib</a> and the C# example project.
 
-\section windowsbin Using a binary installer for Windows
+\section binaryinst Using a binary installer
+
+Binary installers are available for some platforms
+
+\subsection binaryinstwin Windows
 
 Use this method if you only need to use the GeographicLib utilities.
 The header files and static and shared versions of library are also
@@ -499,14 +500,14 @@ be advisable to build it with the compiler you are using for your own
 code using either \ref cmake or \ref windows.
 
 Download and run
-<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.37-win32.exe">
-GeographicLib-1.37-win32.exe</a> or
-<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.37-win64.exe">
-GeographicLib-1.37-win64.exe</a>:
+<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.38-win32.exe">
+GeographicLib-1.38-win32.exe</a> or
+<a href="http://sourceforge.net/projects/geographiclib/files/distrib/GeographicLib-1.38-win64.exe">
+GeographicLib-1.38-win64.exe</a>:
  - read the MIT/X11 License agreement,
  - select whether you want your PATH modified,
  - select the installation folder, by default
-   C:\\pkg-vc10\\GeographicLib-1.37 or C:\\pkg-vc10-x64\\GeographicLib-1.37,
+   C:\\pkg-vc10\\GeographicLib-1.38 or C:\\pkg-vc10-x64\\GeographicLib-1.38,
  - select the start menu folder,
  - and install.
  .
@@ -514,7 +515,7 @@ GeographicLib-1.37-win64.exe</a>:
 given in \ref cmake.)  The start menu will now include links to the
 documentation for the library and for the utilities (and a link for
 uninstalling the library).  If you ask for your PATH to be modified, it
-will include C:/pkg-vc10/GeographicLib-1.37/bin where the utilities are
+will include C:/pkg-vc10/GeographicLib-1.38/bin where the utilities are
 installed.  The headers and library are installed in the
 include/GeographicLib and lib folders.  With the 64-bit installer, the
 Matlab interface is installed in the matlab folder.  Add this to your
@@ -527,6 +528,20 @@ other 64-bit versions of Matlab.
 debug) are included with the binary installers; these are linked against
 the shared library for GeographicLib.
 
+\subsection binaryinstosx MacOSX
+
+You can install using Homebrew.  Follow the directions on
+http://brew.sh/ for installing this package manager.  Then type
+\verbatim
+brew install geographiclib \endverbatim
+Now links to GeographicLib are installed under /usr/local.
+
+\subsection binaryinstlin Linux
+
+Some Linux distributions, Debian and Ubuntu, offer GeographicLib as a
+standard package.  Typically these will be one or two verions behind the
+latest.
+
 \section qt Building the library for use with Qt
 
 If Qt is using a standard compiler, then build GeographicLib with that
@@ -565,7 +580,7 @@ Check the code out of git with \verbatim
 Here the "master" branch is checked out.  There are three branches in
 the git repository:
 - <b>master</b>: the main branch for code maintainence.  Releases are
-  tagged on this branch as, e.g., v1.37.
+  tagged on this branch as, e.g., v1.38.
 - <b>devel</b>: the development branch; changes made here are merged
   into master.
 - <b>release</b>: the release branch created by unpacking the source
@@ -575,7 +590,7 @@ the git repository:
   specifying a branch).  This differs from the master branch in that
   some administrative files are excluded while some intermediate files
   are included (in order to aid building on as many platforms as
-  possible).  Releases are tagged on this branch as, e.g., r1.37.
+  possible).  Releases are tagged on this branch as, e.g., r1.38.
 .
 The autoconf configuration script and the formatted man pages are not
 checked into master branch of the repository.  In order to create the
@@ -591,8 +606,8 @@ In the case of cmake, you then run \verbatim
 which will copy the man pages from the build directory back into the
 source tree and package the resulting source tree for distribution as
 \verbatim
-  GeographicLib-1.37.tar.gz
-  GeographicLib-1.37.zip \endverbatim
+  GeographicLib-1.38.tar.gz
+  GeographicLib-1.38.zip \endverbatim
 Finally, \verbatim
   make package \endverbatim
 or building PACKAGE in Visual Studio will create a binary installer for
@@ -618,7 +633,7 @@ With configure, run \verbatim
   make dist-gzip \endverbatim
 which will create the additional files and packages the results ready
 for distribution as \verbatim
-  geographiclib-1.37.tar.gz \endverbatim
+  geographiclib-1.38.tar.gz \endverbatim
 
 <center>
 Back to \ref intro.  Forward to \ref start.  Up to \ref contents.
@@ -708,7 +723,7 @@ In order to use GeographicLib from C++ code, you will need to
 
   If GeographicLib is found, then the following cmake variables are set:
   - <code>GeographicLib_FOUND</code> = 1
-  - <code>GeographicLib_VERSION</code> = 1.37
+  - <code>GeographicLib_VERSION</code> = 1.38
   - <code>GeographicLib_INCLUDE_DIRS</code>
   - <code>GeographicLib_LIBRARIES</code> = one of the following two:
   - <code>GeographicLib_SHARED_LIBRARIES</code> = GeographicLib
@@ -1138,9 +1153,9 @@ can test the values of the macros GEOGRAPHICLIB_VERSION_MAJOR,
 GEOGRAPHICLIB_VERSION_MINOR, and GEOGRAPHICLIB_VERSION_PATCH; these
 expand to numbers (and the last one is usually 0); these macros appeared
 starting in version 1.31.  There's also a macro
-GEOGRAPHICLIB_VERSION_STRING which expands to, e.g., "1.37"; this macro
+GEOGRAPHICLIB_VERSION_STRING which expands to, e.g., "1.38"; this macro
 has been defined since version 1.9.  Since version 1.37, there's also
-been a macro GEOGRAPHICLIB_VERSION which encode the vesion as a single
+been a macro GEOGRAPHICLIB_VERSION which encode the version as a single
 number, e.g, 1003700.  The macro GEOGRAPHICLIB_VERSION_NUM allows you to
 compare versions, e.g., \code
 #if GEOGRAPHICLIB_VERSION >= GEOGRAPHICLIB_VERSION_NUM(1,36,0)
@@ -1292,13 +1307,18 @@ of the Australian Communications and Media Authority.)
 
 \section matlab Matlab and Octave implementations
 
-The <code>matlab</code> directory contains
- - Native Matlab implementations of the geodesic routines.  To use
-   these, start Matlab or Octave and run one of (for example) \verbatim
+The <code>matlab</code> directory Matlab and Octave implementations of
+some of the functions of GeographicLib.  To use
+these, start Matlab or Octave and run one of (for example) \verbatim
    addpath /usr/local/libexec/GeographicLib/matlab
-   addpath 'C:/pkg-vc10-x64/GeographicLib-1.37/libexec/GeographicLib/matlab'
+   addpath 'C:/pkg-vc10-x64/GeographicLib-1.38/libexec/GeographicLib/matlab'
    \endverbatim
-   The available functions are:
+
+The functions fall into the following groups
+ - <a href="http://www.mathworks.com/matlabcentral/fileexchange/39108">
+   Geodesics on an ellipsoid of revolution</a>, native Matlab
+   implementations of the geodesic routines.  The available functions
+   are
    - geoddoc: briefly descibe the routines
    - geodreckon: solve the direct geodesic problem
    - geoddistance: solve the inverse geodesic problem
@@ -1307,13 +1327,13 @@ The <code>matlab</code> directory contains
    Use the help function to get documentation, e.g., \code
    help geoddistance \endcode
    to obtain documentation.  These functions are also available as a
-   standalone package from
-   <a href="http://www.mathworks.com/matlabcentral/fileexchange/">
-   Matlab File Exchange</a> using the link
+   Matlab File Exchange package from
    - <a href="http://www.mathworks.com/matlabcentral/fileexchange/39108">
      http://www.mathworks.com/matlabcentral/fileexchange/39108</a>
- - Native Matlab implementations of projections which are related to
-   geodesics.  These are
+ - <a href="http://www.mathworks.com/matlabcentral/fileexchange/39366">
+   Geodesic projections for an ellipsoid</a>, native Matlab
+   implementations of projections which are related to geodesics.  These
+   are
    - geodproj: briefly descibe the routines
    - eqdazim_fwd, eqdazim_inv: azimuthal equidistant
    - cassini_fwd, cassini_inv: Cassini-Soldner
@@ -1321,16 +1341,29 @@ The <code>matlab</code> directory contains
    - gnomonic_fwd, gnomonic_inv: ellipsoidal gnomonic
    - utm_fwd, utm_inv: universal transverse Mercator
    .
-   These functions are also available as a package from
-   <a href="http://www.mathworks.com/matlabcentral/fileexchange/">
-   Matlab File Exchange</a> using the link
+   These functions are also available as a Matlab File Exchange package
+   from
    - <a href="http://www.mathworks.com/matlabcentral/fileexchange/39366">
      http://www.mathworks.com/matlabcentral/fileexchange/39366</a>
    .
    (This requires that the previous package also be installed.)
- - Interface code so that some GeographicLib classes can be accessed
-   from Matlab or Octave.  The rest of this section describes how to
-   compile and use these interfaces.
+ - <a href="http://www.mathworks.com/matlabcentral/fileexchange/47898">
+   Great ellipses</a>, implementations of solutions to the great ellipse
+   problems.  The functions are
+   - gedoc: briefly descibe the routines
+   - gereckon: solve the direct great circle problem
+   - gedistance: solve the inverse great circle problem
+   .
+   The functionality provided by these routines is <i>not</i> available
+   through GeographicLib's C++ library.  These functions are also
+   available as a Matlab File Exchange package from
+   - <a href="http://www.mathworks.com/matlabcentral/fileexchange/47898">
+     http://www.mathworks.com/matlabcentral/fileexchange/47898</a>
+   .
+   (This requires that package 39108 also be installed.)
+ - Finally, interface code so that some GeographicLib classes can be
+   accessed directly from Matlab or Octave.  The rest of this section
+   describes how to compile and use these interfaces.
 
 There are two ways of compiling the interface code: (1) using cmake and
 (2) invoking the compiler from Matlab.
@@ -1367,9 +1400,9 @@ There are two ways of compiling the interface code: (1) using cmake and
  - <b>Invoking the compiler from Matlab or Octave:</b> Start Matlab or
    Octave and run, e.g., \code
    mex -setup
-   cd 'C:/pkg-vc10-x64/GeographicLib-1.37/matlab'
+   cd 'C:/pkg-vc10-x64/GeographicLib-1.38/matlab'
    help geographiclibinterface
-   geographiclibinterface('C:/pkg-vc10/GeographicLib-1.37');
+   geographiclibinterface('C:/pkg-vc10/GeographicLib-1.38');
    addpath(pwd);
    \endcode
    The first command allows you to select the compiler to use (which
@@ -1378,7 +1411,7 @@ There are two ways of compiling the interface code: (1) using cmake and
 To use the interface routines for GeographicLib, run one of (for
 example) \verbatim
   addpath /usr/local/libexec/GeographicLib/matlab
-  addpath 'C:/pkg-vc10-x64/GeographicLib-1.37/libexec/GeographicLib/matlab'
+  addpath 'C:/pkg-vc10-x64/GeographicLib-1.38/libexec/GeographicLib/matlab'
 \endverbatim
 in Octave or Matlab.  The available functions are:
  - geodesicdirect: solve direct geodesic problem
@@ -2825,7 +2858,7 @@ Go to
 For some background information on geodesics on triaxial ellipsoids, see
 \ref triaxial.
 
-References
+References:
  - F. W. Bessel,
    <a href="http://dx.doi.org/10.1002/asna.201011352">The calculation
    of longitude and latitude from geodesic measurements (1825)</a>,
@@ -2843,7 +2876,7 @@ References
  - C. F. F. Karney,
    <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
    Algorithms for geodesics</a>,
-   J. Geodesy 87(1), 43--55 (Jan. 2013);
+   J. Geodesy 87(1), 43--55 (2013);
    DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
    10.1007/s00190-012-0578-z</a>;
    addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
@@ -2996,10 +3029,10 @@ The formula for distance is
 \f]
 where
 \f[
-\begin{aligned}
+\begin{align}
   I_1(\sigma) &= A_1\bigl(\sigma + B_1(\sigma)\bigr) \\
   B_1(\sigma) &= \sum_{j=1} C_{1j} \sin 2j\sigma
-\end{aligned}
+\end{align}
 \f]
 and
 \verbatim
@@ -3083,19 +3116,19 @@ C1'[10] = + 9303339907/2972712960 * eps^10;
 
 The reduced length is given by
 \f[
-\begin{aligned}
+\begin{align}
   \frac mb &= \sqrt{1 + k^2 \sin^2\sigma_2} \cos\sigma_1 \sin\sigma_2 \\
   &\quad {}-\sqrt{1 + k^2 \sin^2\sigma_1} \sin\sigma_1 \cos\sigma_2 \\
   &\quad {}-\cos\sigma_1 \cos\sigma_2 \bigl(J(\sigma_2) - J(\sigma_1)\bigr)
-\end{aligned}
+\end{align}
 \f]
 where
 \f[
-\begin{aligned}
+\begin{align}
  J(\sigma) &= I_1(\sigma) - I_2(\sigma) \\
  I_2(\sigma) &= A_2\bigl(\sigma + B_2(\sigma)\bigr) \\
  B_2(\sigma) &= \sum_{j=1} C_{2j} \sin 2j\sigma
-\end{aligned}
+\end{align}
 \f]
 \verbatim
 A2 = (1 + 1/4 * eps^2
@@ -3143,10 +3176,10 @@ The longitude is given in terms of the spherical longitude by
 \f]
 where
 \f[
-\begin{aligned}
+\begin{align}
  I_3(\sigma) &= A_3\bigl(\sigma + B_3(\sigma)\bigr) \\
  B_3(\sigma) &= \sum_{j=1} C_{3j} \sin 2j\sigma
-\end{aligned}
+\end{align}
 \f]
 and
 \verbatim
@@ -3299,13 +3332,13 @@ case of an imaginary modulus using real arithmetic.
 
 The key relations used by GeographicLib are
 \f[
- \begin{aligned}
+ \begin{align}
   \frac sb &= E(\sigma, ik), \\
   \lambda &= (1 - f) \sin\alpha_0  G(\sigma, \cos^2\alpha_0, ik) \\
           &= \chi
            - \frac{e'^2}{\sqrt{1+e'^2}}\sin\alpha_0 H(\sigma, -e'^2, ik), \\
   J(\sigma) &= k^2 D(\sigma, ik),
- \end{aligned}
+ \end{align}
 \f]
 where \f$ \chi \f$ is a modified spherical longitude given by
 \f[
@@ -3313,7 +3346,7 @@ where \f$ \chi \f$ is a modified spherical longitude given by
 \f]
 and
 \f[
- \begin{aligned}
+ \begin{align}
  D(\phi,k) &= \int_0^\phi
  \frac{\sin^2\theta}{\sqrt{1 - k^2\sin^2\theta}}\,d\theta\\
  &=\frac{F(\phi, k) - E(\phi, k)}{k^2},\\
@@ -3328,7 +3361,7 @@ and
  &=
  \frac1{\alpha^2} F(\phi, k) +
       \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k),
- \end{aligned}
+ \end{align}
 \f]
 and \f$F(\phi, k)\f$, \f$E(\phi, k)\f$, \f$D(\phi, k)\f$, and
 \f$\Pi(\phi, \alpha^2, k)\f$, are incomplete elliptic integrals (see
@@ -3363,30 +3396,30 @@ for geodesics, \f$\theta\f$ instead of \f$\sigma\f$, where \f$
 expressions for \f$ s \f$ and \f$ \lambda \f$ are given here for
 completeness:
 \f[
-\begin{aligned}
+\begin{align}
 \frac sb &= \sqrt{1-k'^2} \Pi(\theta, k'^2, k'), \\
 \lambda &= (1-f) \sqrt{1-k'^2} \sin\alpha_0 \Pi(\theta, k'^2/e^2, k'),
-\end{aligned}
+\end{align}
 \f]
 where \f$ k' = k/\sqrt{1 + k^2} \f$.  The expression for \f$ s \f$
 can be written in terms of elliptic integrals of the second kind and
 Cayley's technique can be used to subtract out the leading order
 behavior of \f$ \lambda \f$ to give
 \f[
-\begin{aligned}
+\begin{align}
 \frac sb &=\frac1{\sqrt{1-k'^2}}
   \biggl( E(\theta, k') -
     \frac{k'^2 \sin\theta \cos\theta}{\sqrt{1-k'^2\sin^2\theta}} \biggr), \\
 \lambda &= \psi + (1-f) \sqrt{1-k'^2} \sin\alpha_0
 \bigl( F(\theta, k') - \Pi(\theta, e^2, k') \bigr),
-\end{aligned}
+\end{align}
 \f]
 where
 \f[
-\begin{aligned}
+\begin{align}
 \tan\psi &= \sqrt{\frac{1+k^2\sin^2\sigma}{1+e'^2}}\tan\omega \\
          &= \sqrt{\frac{1-e^2}{1+k^2\cos^2\theta}}\sin\alpha_0\tan\theta.
-\end{aligned}
+\end{align}
 \f]
 The tangents of the three "longitude-like" angles are in geometric
 progression, \f$ \tan\chi/\tan\omega = \tan\omega/\tan\psi \f$.
@@ -3425,24 +3458,24 @@ and are linearly related by
 .
 The cartesian coordinates for the meridian \f$ (x, z) \f$ are given by
 \f[
-\begin{aligned}
+\begin{align}
   x &= a \cos\beta = a \cos\phi / \sqrt{1 - e^2 \sin^2\phi} \\
     &= a \sin\beta' = (a^2/b) \sin\phi' / \sqrt{1 + e'^2 \sin^2\phi'} \\
     &= a \,\mathrm{cn}(v, ie) = a \,\mathrm{cd}(u, e) \\
     &= a \,\mathrm{sn}(u', e) = (a^2/b) \,\mathrm{sd}(v', ie'),
-\end{aligned}
+\end{align}
 \f]
 \f[
-\begin{aligned}
+\begin{align}
   z &= b \sin\beta = (b^2/a) \sin\phi / \sqrt{1 - e^2 \sin^2\phi} \\
     &= b \cos\beta' = b \cos\phi' / \sqrt{1 + e'^2 \sin^2\phi'} \\
     &= b \,\mathrm{sn}(v, ie) = (b^2/a) \,\mathrm{sd}(u, e)  \\
     &= b \,\mathrm{cn}(u', e) = b \,\mathrm{cd}(v', ie').
-\end{aligned}
+\end{align}
 \f]
 The distance along the meridian can be expressed variously as
 \f[
-\begin{aligned}
+\begin{align}
   y  &=   b   \int \sqrt{1 + e'^2  \sin^2\beta}\, d\beta
      =   b E(\beta, ie') \\
      &= \frac{b^2}a \int \frac1{(1 - e^2 \sin^2\phi)^{3/2}}\, d\phi
@@ -3452,10 +3485,10 @@ The distance along the meridian can be expressed variously as
      &=  b \int \mathrm{dn}^2(v, ie')\, dv
       = \frac{b^2}a \int \mathrm{nd}^2(u, e)\, du
       = \cal E(v, ie'),
-\end{aligned}
+\end{align}
 \f]
 \f[
-\begin{aligned}
+\begin{align}
   y' &=   a   \int \sqrt{1 - e^2  \sin^2\beta'}\, d\beta'
      =   a E(\beta', e) \\
      &= \frac{a^2}b \int \frac1{(1 + e'^2 \sin^2\phi')^{3/2}}\, d\phi'
@@ -3465,7 +3498,7 @@ The distance along the meridian can be expressed variously as
      &=  a \int \mathrm{dn}^2(u', e)\, du'
       = \frac{a^2}b \int \mathrm{nd}^2(v', ie')\, dv'
       = \cal E(u', e),
-\end{aligned}
+\end{align}
 \f]
 with the quarter meridian distance given by
 \f[
@@ -3528,10 +3561,10 @@ preserved (and hence the azimuth of a line is preserved).  Let \f$
 longitude on the ellipsoid and sphere respectively.  Define isometric
 latitudes for the sphere and the ellipsoid as
 \f[
-\begin{aligned}
+\begin{align}
   \psi' &= \sinh^{-1} \tan \phi', \\
   \psi &= \sinh^{-1} \tan \phi - e \tanh^{-1}(e \sin\phi).
-\end{aligned}
+\end{align}
 \f]
 The most general conformal mapping satisfying Bowring's conditions is
 \f[
@@ -3561,11 +3594,11 @@ m(\phi_0) = 1,\quad
 i.e, \f$m\approx 1\f$ in the vicinity of \f$\phi = \phi_0\f$.
 This gives
 \f[
-\begin{aligned}
+\begin{align}
 R &= \frac{\sqrt{1 + e'^2}}{B^2} a, \\
 A &= \sqrt{1 + e'^2 \cos^4\phi_0}, \\
 \tan\phi'_0 &= \frac1B \tan\phi_0,
-\end{aligned}
+\end{align}
 \f]
 where \f$ e' = e/\sqrt{1-e^2} \f$ is the second eccentricity, \f$ B =
 \sqrt{1+e'^2\cos^2\phi_0} \f$, and \f$ K \f$ is defined implicitly by
@@ -3651,12 +3684,12 @@ been replaced by the last relation which states that \f$\phi'_0 =
 \beta_0\f$, the parametric latitude corresponding to \f$\phi_0\f$.  This
 gives
 \f[
-\begin{aligned}
+\begin{align}
 R &= B'(1-f)a, \\
 A &= \frac1{B'(1-f)}, \\
 \left.\frac{d^2m(\phi)}{d\phi^2}\right|_{\phi=\phi_0} &=
 -e^2B'^2\sin^2\phi_0.
-\end{aligned}
+\end{align}
 \f]
 
 Similar to Bowring's method, we can compute \f$\phi'_1\f$ and
@@ -3824,7 +3857,7 @@ Go to
     - C. F. F. Karney,
       <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
       Algorithms for geodesics</a>,
-      J. Geodesy 87(1), 43--55 (Jan. 2013);
+      J. Geodesy 87(1), 43--55 (2013);
       DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
       10.1007/s00190-012-0578-z</a>;
       addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
@@ -3847,16 +3880,16 @@ geographical latitude and longitude \f$(\phi, \lambda)\f$ are defined by
 The \e parametric latitude and longitude \f$(\phi', \lambda')\f$ are
 defined by
 \f[
-\begin{aligned}
+\begin{align}
  x &= a \cos\phi' \cos\lambda', \\
  y &= b \cos\phi' \sin\lambda', \\
  z &= c \sin\phi'.
-\end{aligned}
+\end{align}
 \f]
 Jacobi employed the \e ellipsoidal latitude and longitude \f$(\beta,
 \omega)\f$ defined by
 \f[
-\begin{aligned}
+\begin{align}
   x &= a \cos\omega
       \frac{\sqrt{a^2 - b^2\sin^2\beta - c^2\cos^2\beta}}
            {\sqrt{a^2 - c^2}}, \\
@@ -3864,7 +3897,7 @@ Jacobi employed the \e ellipsoidal latitude and longitude \f$(\beta,
   z &= c \sin\beta
       \frac{\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2}}
            {\sqrt{a^2 - c^2}}.
-\end{aligned}
+\end{align}
 \f]
 Grid lines of constant \f$\beta\f$ and \f$\omega\f$ are given in Fig. 1.
 
@@ -3934,7 +3967,7 @@ Here is the solution, exactly as given by Jacobi
 <a href="http://books.google.com/books?id=Rh8GAAAAYAAJ&pg=PA268"> here</a>
 (with minor changes in notation):
 \f[
-\begin{aligned}
+\begin{align}
 \delta &= \int \frac
 {\sqrt{b^2\sin^2\beta + c^2\cos^2\beta}\,d\beta}
 {\sqrt{a^2 - b^2\sin^2\beta - c^2\cos^2\beta}
@@ -3944,7 +3977,7 @@ Here is the solution, exactly as given by Jacobi
 {\sqrt{a^2\sin^2\omega + b^2\cos^2\omega}\,d\omega}
 {\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2}
  \sqrt{(a^2-b^2)\sin^2\omega + \gamma}}
-\end{aligned}
+\end{align}
 \f]
 As Jacobi notes "a function of the angle \f$\beta\f$ equals a
 function of the angle \f$\omega\f$.  These two functions are just
@@ -3967,7 +4000,7 @@ relation.  A nice derivation of Jacobi's result is given by Darboux
 (1846) for general quadratic surfaces.  In this formulation, the
 distance along the geodesic, \f$s\f$, is also found using
 \f[
-\begin{aligned}
+\begin{align}
 \frac{ds}{(b^2-c^2)\cos^2\beta + (a^2-b^2)\sin^2\omega}
 &= \frac
 {\sqrt{b^2\sin^2\beta + c^2\cos^2\beta}\,d\beta}
@@ -3977,11 +4010,11 @@ distance along the geodesic, \f$s\f$, is also found using
 {\sqrt{a^2\sin^2\omega + b^2\cos^2\omega}\,d\omega}
 {\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2}
  \sqrt{(a^2-b^2)\sin^2\omega + \gamma}}
-\end{aligned}
+\end{align}
 \f]
 An alternative expression for the distance is
 \f[
-\begin{aligned}
+\begin{align}
 ds
 &= \frac
 {\sqrt{b^2\sin^2\beta + c^2\cos^2\beta}
@@ -3991,7 +4024,7 @@ ds
 {\sqrt{a^2\sin^2\omega + b^2\cos^2\omega}
  \sqrt{(a^2-b^2)\sin^2\omega + \gamma}\,d\omega}
 {\sqrt{a^2\sin^2\omega + b^2\cos^2\omega - c^2}}
-\end{aligned}
+\end{align}
 \f]
 
 Jacobi's solution is a convenient way to compute geodesics on an
@@ -4284,7 +4317,7 @@ Back to \ref geodesic.  Forward to \ref rhumb.  Up to \ref contents.
 \page rhumb Rhumb lines
 
 <center>
-Back to \ref triaxial.  Forward to \ref transversemercator.  Up to
+Back to \ref triaxial.  Forward to \ref greatellipse.  Up to
 \ref contents.
 </center>
 
@@ -4294,9 +4327,12 @@ calculations.  A rhumb line (also called a loxodrome) is a line of
 constant azimuth on the surface of the ellipsoid.  It is important for
 historical reasons because sailing with a constant compass heading is
 simpler than sailing the shorter geodesic course; see Osborne (2013).
-My interest in this problem was piqued by Botnev and Ustinov (2014) who
-discuss various techniques to improve the accuracy of rhumb line
-calculations.  The items of interest here are:
+The formulation of the problem on an ellipsoid is covered by Smart
+(1946) and Carlton-Wippern (1992).  Computational approaches are given
+by Williams (1950) and Bennett (1996).  My interest in this problem was
+piqued by Botnev and Ustinov (2014) who discuss various techniques to
+improve the accuracy of rhumb line calculations.  The items of interest
+here are:
  - Review of accurate formulas for the auxiliary latitudes.
  - Using divided differences to compute \f$\mu_{12}/\psi_{12}\f$
    maintaining full accuracy.  Two cases are treated:
@@ -4309,13 +4345,17 @@ calculations.  The items of interest here are:
  - Extending Clenshaw summation to compute the divided difference of a
    trigonometric sum.
 
-Jump to
+Go to
  - \ref rhumbform
  - \ref rhumblat
  - \ref divideddiffs
  - \ref dividedclenshaw
 
 References:
+ - G. G. Bennett,
+   <a href="http://dx.doi.org/10.1017/S0373463300013151">
+   Practical Rhumb Line Calculations on the Spheroid</a>
+   J. Navigation 49(1), 112--119 (1996).
  - F. W. Bessel,
    <a href="http://dx.doi.org/10.1002/asna.201011352">The calculation
    of longitude and latitude from geodesic measurements (1825)</a>,
@@ -4324,10 +4364,15 @@ References:
    <a href="http://arxiv.org/abs/0908.1824">arXiv:0908.1824</a>.
  - V.A. Botnev, S.M. Ustinov,
    <a href="http://ntv.spbstu.ru/fulltext/T3.198.2014_05.PDF">
-   Metody reshenija prjamoj i obratnoj geodezicheskih zadach s vysokoj
-   tochnost'ju</a> (Methods for direct and inverse geodesic problems
+   Metody resheniya pryamoy i obratnoy geodezicheskikh zadach s vysokoy
+   tochnost'yu
+   </a> (Methods for direct and inverse geodesic problems
    solving with high precision), St. Petersburg State Polytechnical
    University Journal 3(198), 49--58 (2014).
+ - K. C. Carlton-Wippern
+   <a href="http://dx.doi.org/10.1017/S0373463300010791">
+   On Loxodromic Navigation</a>,
+   J. Navigation 45(2), 292--297 (1992).
  - K. E. Engsager and K. Poder,
    <a href="http://icaci.org/files/documents/ICC_proceedings/ICC2007/documents/doc/THEME 2/oral 1/2.1.2 A HIGHLY ACCURATE WORLD WIDE ALGORITHM FOR THE TRANSVE.doc">
    A highly accurate world wide algorithm for the
@@ -4357,7 +4402,7 @@ References:
  - C. F. F. Karney,
    <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
    Algorithms for geodesics</a>,
-   J. Geodesy 87(1), 43--55 (Jan. 2013);
+   J. Geodesy 87(1), 43--55 (2013);
    DOI: <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
    10.1007/s00190-012-0578-z</a>;
    addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
@@ -4369,12 +4414,17 @@ References:
    Abbildung des Erdellipsoids in der Ebene</a> (Conformal mapping of
    the ellipsoidal earth to the plane), Royal Prussian Geodetic Institute,
    New Series 52, 172 pp. (1912).
- - T. H. Meyer and C. M. Rollins,
-   The direct and indirect problem for loxodromes,
-   Navigation 58(1), 1--6 (2011).
  - P. Osborne,
    <a href="http://www.mercator99.webspace.virginmedia.com/">
    The Mercator Projections</a> (2013), §2.5 and §6.5.
+ - W. M. Smart
+   <a href="http://dx.doi.org/10.1093/mnras/106.2.124">
+   On a Problem in Navigation</a>
+   MNRAS 106(2), 124--127 (1946).
+ - J. E. D. Williams
+   <a href="http://dx.doi.org/10.1017/S0373463300045549">
+   Loxodromic Distances on the Terrestrial Spheroid Journal</a>,
+   J. Navigation 3(2), 133--140 (1950)
 
 \section rhumbform Formulation of the rhumb line problem
 
@@ -4385,10 +4435,10 @@ distances along rhumb lines), and the parametric latitude \f$\beta\f$
 (needed for dealing with rhumb lines that run along a parallel).  These
 are defined in terms of the geographical latitude \f$\phi\f$ by
 \f[
-\begin{aligned}
+\begin{align}
  \frac{d\psi}{d\phi} &= \frac{\rho}R, \\
  \frac{d\mu}{d\phi}  &= \frac{\pi}{2M}\rho, \\
-\end{aligned}
+\end{align}
 \f]
 where \f$\rho\f$ is the meridional radius of curvature, \f$R =
 a\cos\beta\f$ is the radius of a circle of latitude, and \f$M\f$ is the
@@ -4410,21 +4460,21 @@ typically, \f$\lambda_{12}\f$ is reduced to the range \f$[-\pi,\pi]\f$
 
 The distance is given by
 \f[
-\begin{aligned}
+\begin{align}
 s_{12} &= \frac {2M}{\pi} \mu_{12} \sec\alpha_{12} \\
   &= \frac {2M}{\pi}
 \frac{\mu_{12}}{\psi_{12}} \sqrt{\lambda_{12}^2 + \psi_{12}^2},
-\end{aligned}
+\end{align}
 \f]
 where \f$\mu_{12} = \mu_2 - \mu_1\f$.  This relation is indeterminate if
 \f$\phi_1 = \phi_2\f$, so we take the limits
 \f$\psi_{12}\rightarrow0\f$ and \f$\mu_{12}\rightarrow0\f$ and apply
 L'Hôpital's rule to yield
 \f[
-\begin{aligned}
+\begin{align}
  s_{12} &= \frac {2M}{\pi} \frac{d\mu}{d\psi} \left|\lambda_{12}\right|\\
 &=a \cos\beta \left|\lambda_{12}\right|,
-\end{aligned}
+\end{align}
 \f]
 where the last relation is given by the defining equations for
 \f$\psi\f$ and \f$\mu\f$.
@@ -4451,20 +4501,20 @@ convenient to introduce the variables \f$\tau=\tan\phi\f$ and \f$\tau' =
 \tan\chi = \sinh\psi\f$ (\f$\chi\f$ is the conformal latitude) which are
 related by (Karney, 2011)
 \f[
-\begin{aligned}
+\begin{align}
 \tau' &= \tau \sqrt{1 + \sigma^2} - \sigma \sqrt{1 + \tau^2}, \\
 \sigma &= \sinh\bigl(e \tanh^{-1}(e \tau/\sqrt{1 + \tau^2}) \bigr).
-\end{aligned}
+\end{align}
 \f]
 The equation for \f$\tau'\f$ can be inverted to give \f$\tau\f$ in terms
 of \f$\tau'\f$ using Newton's method with \f$\tau_0 = \tau'/(1-e^2)\f$
 as a starting guess; and, of course, \f$\phi\f$ and \f$\psi\f$ are then
 given by
 \f[
-\begin{aligned}
+\begin{align}
 \phi &= \tan^{-1}\tau,\\
 \psi &= \sinh^{-1}\tau'.
-\end{aligned}
+\end{align}
 \f]
 This allows conversions to and from \f$\psi\f$ to be carried out for any
 value of the flattening \f$f\f$; these conversions are implemented by
@@ -4532,17 +4582,15 @@ Despite our ability to compute latitudes accurately, the way that
 distances enter into the solution involves the ratio
 \f$\mu_{12}/\psi_{12}\f$; the numerical calculation of this term is
 subject to catastrophic round-off errors when \f$\phi_1\f$ and
-\f$\phi_2\f$ are close.  A simple solution, suggested by Meyer and
-Rollins (2011), is to extend the treatment of rhumb lines along
-parallels to this case, i.e., to replace the ratio by the derivative
-evaluated at the midpoint.  (Meyer and Rollins only offer this solution
-when dealing with the inverse problem; but it can also be applied with
-the direct problem.)  However this is not entirely satisfactory: you
-have to pick the transition point where the derivative takes over from
-the ratio of differences; and, near this transition point, many bits of
-accuracy will be lost (I estimate that about 1/3 of bits are lost,
-leading to errors on the order of 0.1 mm for double precision).  Note
-too that this problem crops up even in the spherical limit.
+\f$\phi_2\f$ are close.  A simple solution, suggested by Bennett (1996),
+is to extend the treatment of rhumb lines along parallels to this case,
+i.e., to replace the ratio by the derivative evaluated at the midpoint.
+However this is not entirely satisfactory: you have to pick the
+transition point where the derivative takes over from the ratio of
+differences; and, near this transition point, many bits of accuracy will
+be lost (I estimate that about 1/3 of bits are lost, leading to errors
+on the order of 0.1 mm for double precision).  Note too that this
+problem crops up even in the spherical limit.
 
 It turns out that we can do substantially better than this and maintain
 full double precision accuracy.  Indeed Botnev and Ustinov provide
@@ -4584,11 +4632,11 @@ particular, we can use the chain rule to write
 Kahan and Fateman catalog the divided difference formulas for all the
 elementary functions.  In this case, we need
 \f[
-\begin{aligned}
+\begin{align}
 \Delta[\tan](x,y) &= \frac{\tan(x-y)}{x-y} (1 + \tan x\tan y),\\
 \Delta[\sinh^{-1}](x,y) &= \frac1{x-y}
 \sinh^{-1}\biggl(\frac{(x-y)(x+y)}{x\sqrt{1+y^2}+y\sqrt{1+x^2}}\biggr).
-\end{aligned}
+\end{align}
 \f]
 The crucial point in these formulas is that the right hand sides can be
 evaluated accurately even if \f$x-y\f$ is small.  (I've only included
@@ -4630,13 +4678,13 @@ difference formula
 \f]
 where the angle \f$z\f$ is given by
 \f[
-\begin{aligned}
+\begin{align}
 \sin z &= \frac{2t}{1 + t^2},\quad\cos z = \frac{(1-t)(1+t)}{1 + t^2},\\
 t &=
 \frac{(x-y)\Delta[\sin](x,y)}
 {\sin x\sqrt{1 - k^2\sin^2y} + \sin y\sqrt{1 - k^2\sin^2x}}
 \frac{\sin x + \sin y}{\cos x + \cos y}.
-\end{aligned}
+\end{align}
 \f]
 We also need to apply the divided difference formulas to the conversions
 from \f$\phi\f$ to \f$\beta\f$ and \f$\phi\f$ to \f$\psi\f$; but these
@@ -4656,18 +4704,17 @@ The use of
 <a href="https://en.wikipedia.org/wiki/Clenshaw_algorithm#Geodetic_applications">
 Clenshaw summation</a> for summing series of the form,
 \f[
-g(x) = \sum_{k=1}^N c_k \sin(2kx),
+g(x) = \sum_{k=1}^N c_k \sin kx,
 \f]
 is well established.  However when computing divided differences, we are
 interested in evaluating
 \f[
-g(x)-g(y) = \sum_{k=1}^N 2 c_k \sin\bigl(k(x-y)\bigr)\cos\bigl(k(x+y)\bigr)
+g(x)-g(y) = \sum_{k=1}^N 2 c_k
+\sin\bigl({\textstyle\frac12}k(x-y)\bigr)
+\cos\bigl({\textstyle\frac12}k(x+y)\bigr).
 \f]
-and the applicability of Clenshaw summation is not so clear.  Botnev and
-Ustinov assert that the method can be used in this case (but they give
-no details).  It turns out that Clenshaw summation can be used if we
-simultaneously compute the sum \f$g(x)+g(y)\f$ and perform a matrix
-summation,
+Clenshaw summation can be used in this case if we simultaneously compute
+\f$g(x)+g(y)\f$ and perform a matrix summation,
 \f[
 \mathsf G(x,y) = \begin{bmatrix}
 (g(x) + g(y)) / 2\\
@@ -4678,40 +4725,284 @@ where
 \f[
 \mathsf F_k(x,y)=
 \begin{bmatrix}
-     \sin kp \cos kd\\
-(2/d)\sin kd \cos kp
+     \cos kd \sin kp\\
+\frac{\sin kd}d \cos kp
 \end{bmatrix},
 \f]
-and \f$p=x+y\f$ and \f$d=x-y\f$.  The first element of \f$\mathsf
-G(x,y)\f$ is the average value of \f$g\f$ and the second element, the
-divided difference, is the average slope.  \f$\mathsf F_k(x,y)\f$
-satisfies the recurrence relation
+\f$d=\frac12(x-y)\f$, \f$p=\frac12(x+y)\f$, and, in the limit
+\f$d\rightarrow0\f$, \f$(\sin kd)/d \rightarrow k\f$.  The first element
+of \f$\mathsf G(x,y)\f$ is the average value of \f$g\f$ and the second
+element, the divided difference, is the average slope.  \f$\mathsf
+F_k(x,y)\f$ satisfies the recurrence relation
 \f[
   \mathsf F_{k+1}(x,y) =
   \mathsf A(x,y) \mathsf F_k(x,y) - \mathsf F_{k-1}(x,y),
 \f]
 where
 \f[
- \mathsf A(x,y) = \begin{bmatrix}
-     2 \cos p \cos d &  -d\sin p \sin d \\
--(4/d) \sin p \sin d &  2 \cos p \cos d
-\end{bmatrix}.
+ \mathsf A(x,y) = 2\begin{bmatrix}
+  \cos d \cos p & -d\sin d \sin p \\
+- \frac{\sin d}d \sin p &   \cos d \cos p
+\end{bmatrix},
 \f]
-The standard Clenshaw algorithm can now be applied to yield
+and \f$\lim_{d\rightarrow0}(\sin d)/d = 1\f$.  The standard Clenshaw
+algorithm can now be applied to yield
 \f[
-\begin{aligned}
+\begin{align}
 \mathsf B_{N+1} &= \mathsf B_{N+2} = \mathsf 0, \\
 \mathsf B_k &= \mathsf A \mathsf B_{k+1} - \mathsf B_{k+2} +
-\mathsf c_k \mathsf I, \qquad\text{for $N\ge k \ge 1$},\\
+c_k \mathsf I, \qquad\text{for $N\ge k \ge 1$},\\
 \mathsf G(x,y) &= \mathsf B_1 \mathsf F_1(x,y),
-\end{aligned}
+\end{align}
 \f]
-where \f$B_k\f$ are \f$2\times2\f$ matrices.  The divided difference
-\f$\Delta[g](x,y)\f$ is given by the second element of \f$\mathsf
-G(x,y)\f$.
+where \f$\mathsf B_k\f$ are \f$2\times2\f$ matrices.  The divided
+difference \f$\Delta[g](x,y)\f$ is given by the second element of
+\f$\mathsf G(x,y)\f$.
 
 <center>
-Back to \ref triaxial.  Forward to \ref transversemercator.  Up to
+Back to \ref triaxial.  Forward to \ref greatellipse.  Up to
+\ref contents.
+</center>
+**********************************************************************/
+/**
+\page greatellipse Great Ellipses
+
+<center>
+Back to \ref rhumb.  Forward to \ref transversemercator.  Up to
+\ref contents.
+</center>
+
+Great ellipses are sometimes proposed (Williams, 1996; Pallikaris &
+Latsas, 2009) as alternatives to geodesics for the purposes of
+navigation.  This is predicated on the assumption that solving the
+geodesic problems is complex and costly.  These assumptions are no
+longer true, and geodesics should normally be used in place of great
+ellipses.  This is discussed in more detail in \ref gevsgeodesic.
+
+Solutions of the great ellipse problems implemented for Matlab and
+Octave are provided by
+ - gedoc: briefly descibe the routines
+ - gereckon: solve the direct great circle problem
+ - gedistance: solve the inverse great circle problem
+ .
+These functions are also available as a package
+<a href="http://www.mathworks.com/matlabcentral/fileexchange/47898">
+47898</a> on Matlab File Exchange.  This requires also the installation
+of package
+<a href="http://www.mathworks.com/matlabcentral/fileexchange/39108">
+39108</a>.  In this time, there are no C++ support in GeographicLib for
+great ellipses.
+
+References:
+ - B. R. Bowring,
+   <a href="http://dx.doi.org/10.1007/BF02521760">
+   The direct and inverse solutions for the great elliptic line on the
+   reference ellipsoid</a>, Bull. Geod. 58, 101--108 (1984).
+ - M. A. Earle,
+   A vector solution for navigation on a great ellipse,
+   J. Navigation 53(3), 473--481 (2000).
+ - M. A. Earle,
+   <a href="http://dx.doi.org/10.1017/S037346330800475X">
+   Vector solutions for azimuth</a>,
+   J. Navigation 61(3), 537--545 (2008).
+ - C. F. F. Karney,
+   <a href="http://dx.doi.org/10.1007/s00190-012-0578-z">
+   Algorithms for geodesics</a>, J. Geodesy 87(1), 43--55 (2013);
+   addenda: <a href="http://geographiclib.sf.net/geod-addenda.html">
+   geod-addenda.html</a>.
+ - A. Pallikaris & G. Latsas,
+   <a href="http://dx.doi.org/1017/S0373463309005323">
+   New algorithm for great elliptic sailing (GES)</a>,
+   J. Navigation 62(3), 493--507 (2009).
+ - A. Pallikaris, L. Tsoulos, & D. Paradissis,
+   New meridian arc formulas for sailing calculations in navigational
+   GIS, International Hydrographic Review, 24--34 (May 2009).
+ - L. E. Sjöberg,
+   <a href="http://dx.doi.org/10.2478/v10156-011-0040-9">
+   Solutions to the direct and inverse navigation problems on the great
+   ellipse</a>, J. Geodetic Science 2(3), 200--205 (2012).
+ - R. Williams,
+   <a href="http://dx.doi.org/10.1017/S0373463300013333">
+   The Great Ellipse on the Surface of the Spheroid</a>,
+   J. Navigation 49(2), 229--234 (1996).
+ - T. Vincenty,
+   <a href="http://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf">
+   Direct and Inverse Solutions of Geodesics on the Ellipsoid with
+   Application of Nested Equations</a>,
+   Survey Review 23(176), 88--93 (1975).
+
+Go to
+ - \ref geformulation
+ - \ref gevsgeodesic
+
+\section geformulation Solution of great ellipse problems
+
+Adopt the usual notation for the ellipsoid: equatorial semi-axis
+\f$a\f$, polar semi-axis \f$b\f$, flattening \f$f = (a-b)/a\f$,
+eccentricity \f$e = \sqrt{f(2-f)}\f$, second eccentricity \f$e' =
+e/(1-f)\f$.
+
+There are several ways in which an ellipsoid can be mapped into a sphere
+converting the great ellipse into a great circle.  The simplest ones
+entail scaling the ellipsoid in the \f$\hat z\f$ direction, the
+direction of the axis of rotation, scaling the ellipsoid radially, or a
+combination of the two.
+
+One such combination (scaling by \f$a^2/b\f$ in the \f$\hat z\f$
+direction, following by a radial scaling to the sphere) preserves the
+geographical latitude \f$\phi\f$.  This enables an great ellipse to be
+plotted on a chart merely by determining way points on the corresponding
+great circle and tranferring them directly on the chart.  In this
+exercise the flattening of the ellipsoid can be <i>ignored</i>!
+
+Bowring (1984), Williams (1996), Earle (2000, 2008) and Pallikaris &
+Latsas (2009), scale the ellipsoid radially onto a sphere preserving the
+geocentric latitude \f$\theta\f$.  More convenient than this is to scale
+the ellipsoid along \f$\hat z\f$ onto the sphere, as is done by
+Sjöberg (2012), thus preserving the parametric latitude
+\f$\beta\f$.  The advantage of this "parametric" mapping is that
+Bessel's rapidly converging series for meridian arc in terms of
+parametric latitude can be used (a possibility that is overlooked by
+Sjöberg).
+
+The full parametric mapping is:
+ - The geographic latitude \f$\phi\f$ on the ellipsoid maps to the
+   parametric latitude \f$\beta\f$ on the sphere,
+   where
+   \f[a\tan\beta = b\tan\phi.\f]
+ - The longitude \f$\lambda\f$ is unchanged.
+ - The azimuth \f$\alpha\f$ on the ellipsoid maps to an azimuth
+   \f$\gamma\f$ on the sphere where
+   \f[
+   \begin{align}
+   \tan\alpha &= \frac{\tan\gamma}{\sqrt{1-e^2\cos^2\beta}}, \\
+   \tan\gamma &= \frac{\tan\alpha}{\sqrt{1+e'^2\cos^2\phi}},
+   \end{align}
+   \f]
+   and the quadrants of \f$\alpha\f$ and \f$\gamma\f$ are the same.
+ - Positions on the great circle of radius \f$a\f$ are parametrized by
+   arc length \f$\sigma\f$ measured from the northward crossing of the
+   equator.  The great ellipse has a semi-axes \f$a\f$ and \f$a \sqrt{1 -
+   e^2\cos^2\gamma_0}\f$, where \f$\gamma_0\f$ is the great-circle
+   azimuth at the northward equator crossing, and \f$\sigma\f$ is the
+   parametric angle on the ellipse.
+ .
+To determine the distance along the ellipse in terms of \f$\sigma\f$ and
+vice versa, the series for distance \f$s\f$ and for \f$\tau\f$ given in
+\ref geodseries can be used.  The direct and inverse great ellipse
+problems are now simply solved by mapping the problem to the sphere,
+solving the resulting great circle problem, and mapping this back onto
+the ellipsoid.
+
+\section gevsgeodesic Great ellipses vs geodesics
+
+Some papers advocating the use of great ellipses for navigation exhibit
+a prejudice against the use of geodesics.  These excerpts from
+Pallikaris, Tsoulos, & Paradissis (2009) give the flavor
+ - ... it is required to adopt realistic accuracy standards in order not
+   only to eliminate the significant errors of the spherical model but
+   also to avoid the exaggerated and unrealistic requirements of sub
+   meter accuracy.
+ - Calculation of shortest sailings paths on the ellipsoid by a geodetic
+   inverse method involve formulas that are much too complex.
+ - Despite the fact that contemporary computers are fast enough to
+   handle more complete geodetic formulas of sub meter accuracy, a basic
+   principle for the design of navigational systems is the avoidance of
+   unnecessary consumption of computing power.
+ .
+This prejudice was probably due to the fact that the most well-known
+algorithms for geodesics, by Vincenty (1975), come with some
+"asterisks":
+ - no derivation was given (although they follow in a straightforward
+   fashion from classic 19th century methods);
+ - the accuracy is "only" 0.5 mm or so, surely good enough for most
+   applications, but still a reason for a user to worry and a spur to
+   numerous studies "validating" the algorithms;
+ - no indication is given for how to extend the series to improve the
+   accuracy;
+ - there was a belief in some quarters (erroneous!) that the Vincenty
+   algorithms could not be used to compute waypoints;
+ - the algorithm for the inverse problem fails to converge for some
+   inputs.
+ .
+These problems meant that users were reluctant to bundle the algorithms
+into a library and treat them as a part of the software infrastructure
+(much as you might regard the computation of \f$\sin x\f$ as a given).
+In particular, I regard the last issue, lack of convergence of the
+inverse solution, as fatal.  Even though the problem only arises for
+nearly antipodal points, it means all users of the library must have
+some way to handle this problem.
+
+For these reasons, substitution of a great ellipse for the geodesic
+makes some sense.  The solution of the great ellipse is, in principle,
+no more difficult than solving for the great circle and, for paths of
+less then 10000 km, the error in the distance is less than 13.5 m.
+
+Now (2014), however, the situation has reversed.  The algorithms given
+by Karney (2013)—and used in GeographicLib since
+2009—explicitly resolve the issues with Vincenty's algorithm.  The
+geodesic problem is conveniently bundled into a library.  Users can call
+this with an assurance of an accurate result much as they would when
+evaluating \f$\sin x\f$.  On the other, great ellipses come with their
+own set of asterisks:
+ - To the extent that they are regarded as approximations to geodesics,
+   the errors need to be quantified, the limits of allowable use
+   documented, etc.
+ - The user is now left with decisions on when to trust the results and
+   to find alternative solutions if necessary.
+ - Even though the great ellipse is no more that 13.5 m longer than a
+   10000 km geodesic, the path of the great ellipse can deviate from the
+   geodesic by as much as 8.3 km.  This disqualifies great ellipses from
+   use in congested air corridors where the
+   <a href="https://en.wikipedia.org/wiki/Strategic_lateral_offset_procedure">
+   strategic lateral offset procedure</a> is in effect and in any
+   situation which demands coordination in the routes of vessels.
+ - Because geodesics obey the triangle inequality, while great ellipses
+   do not, the solutions for realistic navigational problems, e.g.,
+   determining the time of closest approach of two vessels, are often
+   simpler in terms of geodesics.
+
+To address some other of the objections in the quotes from Pallikaris et
+al. given above:
+ - "exaggerated and unrealistic requirements of sub meter accuracy": The
+   geodesic algorithms allow full double precision accuracy at
+   essentially no cost.  This is because Clenshaw summation allows
+   additional terms to be added to the series without the need for
+   addition trigonometric evaluations.  Full accuracy is important to
+   maintain because it allows the results to be used reliably in more
+   complex problems (e.g., in the determination of maritime boundaries).
+ - "unnecessary consumption of computing power": The solution of the
+   inverse geodesic problem takes 2.3 μs; multiple points on a
+   geodesic can be computed at a rate of one point per 0.4 μs.  The
+   actual power consumed in these calculations is miniscule compared to
+   the power needed to drive the display of a navigational computer.
+ - "formulas that are much too complex": There's no question that the
+   solution of the geodesic problem is more complex than for great
+   ellipses.  However this complexity is only an issue when
+   <b>implementing</b> the algorithms.  For the <b>end user</b>,
+   navigational software employing geodesics is <b>less</b> complex
+   compared with that employing great ellipses.  Here is what the user
+   needs to know about the geodesic solution:
+   <blockquote>"The shortest path is found."</blockquote>
+   And here is the corresponding documentation for great ellipses:
+   <blockquote>"A path which closely approximates the shortest path is
+   found.  Provided that the distance is less than 10000 km, the error
+   in distance is no more than 14 m and the deviation the route from
+   that of the shortest path is no more than 9 km.  These bounds apply
+   to the WGS84 ellipsoid.  The deviation of the path means that it
+   should be used with caution when planning routes.  In addition, great
+   ellipses do not obey the triangle inequality; this disqualifies them
+   from use in some applications."</blockquote>
+
+Having all the geodesic functions bundled up into a reliable "black box"
+enables users to concentrate on how to solve problems using geodesics
+(instead of figuring out how to solve for the geodesics).  A wide range
+of problems (intersection of paths, the path for an interception, the
+time of closest approach, median lines, tri-points, etc.) are all
+amenable to simple and fast solutions in terms of geodesics.
+
+<center>
+Back to \ref rhumb.  Forward to \ref transversemercator.  Up to
 \ref contents.
 </center>
 **********************************************************************/
@@ -4722,10 +5013,9 @@ Back to \ref triaxial.  Forward to \ref transversemercator.  Up to
 Back to \ref rhumb.  Forward to \ref geocentric.  Up to \ref contents.
 </center>
 
-TransverseMercator and
-TransverseMercatorExact provide accurate implementations
-of the transverse Mercator projection.  The
- <a href="TransverseMercatorProj.1.html">TransverseMercatorProj</a>
+TransverseMercator and TransverseMercatorExact provide accurate
+implementations of the transverse Mercator projection.  The
+<a href="TransverseMercatorProj.1.html">TransverseMercatorProj</a>
 utility provides an interface to these classes.
 
 Go to
@@ -4733,7 +5023,7 @@ Go to
  - \ref tmseries
  - \ref tmfigures
 
-References
+References:
  - L. Krüger,
    <a href="http://dx.doi.org/10.2312/GFZ.b103-krueger28"> Konforme
    Abbildung des Erdellipsoids in der Ebene</a> (Conformal mapping of
@@ -5235,7 +5525,7 @@ Here's what you should know:
    or later) and the quadmath library (which requires the use of g++).
  - Configuring with <code>-D GEOGRAPHICLIB_PRECISION=5</code> gives
    arbitrary precision via mpfr::mpreal; this requires
-   <a href="http://www.mpfr.org"> MPFR</a> and
+   <a href="http://www.mpfr.org"> MPFR</a> (version 3.0 or later) and
    <a href="http://www.holoborodko.com/pavel/mpfr"> MPFR C++</a>
    (version 3.5.9 or later).
  - MPFR, MPFR C++, and Boost all come with their own licenses.  Be sure
@@ -5500,6 +5790,20 @@ been migrated to the archive subdirectory).  All the releases are
 available as tags “r<i>m.nn</i>” in the the "release" branch
 of the git repository for GeographicLib.
 
+ - <a href="http://geographiclib.sf.net/1.38">Version 1.38</a>
+   (released 2014-10-02)
+   - On MacOSX, the installed package is relocatable (for cmake version
+     2.8.12 and later).
+   - On Mac OSX, GeographicLib can be installed using homebrew.
+   - In cmake builds under Windows, set the output directories so that
+     binaries and shared libraries are together.
+   - Accept the minus sign as a synomym for - in DMS.{cpp,js}.
+   - The cmake configuration file geographiclib-depends.cmake has been
+     renamed to geographiclib-targets.cmake.
+   - Matlab/Octave routines for great ellipses added; see \ref
+     greatellipse.
+   - Provide man pages for geographiclib-get-{geoids,gravity,magnetic}.
+
  - <a href="http://geographiclib.sf.net/1.37">Version 1.37</a>
    (released 2014-08-08)
    - Add \ref highprec.
diff --git a/doc/Makefile.am b/doc/Makefile.am
index 84c8ccc..34bd403 100644
--- a/doc/Makefile.am
+++ b/doc/Makefile.am
@@ -147,13 +147,25 @@ maintainer-clean-local:
 install-doc: html/index.html
 	$(INSTALL) -d $(DESTDIR)$(docdir)/html
 	$(INSTALL) -m 644 `dirname $<`/*.* $(DESTDIR)$(docdir)/html
+	-test -f `dirname $<`/search/search.js && \
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/search && \
+	$(INSTALL) -m 644 `dirname $<`/search/*.* \
+	$(DESTDIR)$(docdir)/html/search
 	-test -f `dirname $<`/C/index.html && \
 	$(INSTALL) -d $(DESTDIR)$(docdir)/html/C && \
 	$(INSTALL) -m 644 `dirname $<`/C/*.* $(DESTDIR)$(docdir)/html/C
+	-test -f `dirname $<`/C/search/search.js && \
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/C/search && \
+	$(INSTALL) -m 644 `dirname $<`/C/search/*.* \
+	$(DESTDIR)$(docdir)/html/C/search
 	-test -f `dirname $<`/Fortran/index.html && \
 	$(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran && \
 	$(INSTALL) -m 644 `dirname $<`/Fortran/*.* \
 	$(DESTDIR)$(docdir)/html/Fortran
+	-test -f `dirname $<`/Fortran/search/search.js && \
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran/search && \
+	$(INSTALL) -m 644 `dirname $<`/Fortran/search/*.* \
+	$(DESTDIR)$(docdir)/html/Fortran/search
 	$(INSTALL) -d $(DESTDIR)$(docdir)/scripts
 	$(INSTALL) -m 644 $(SCRIPTDRIVERS) $(DESTDIR)$(docdir)/scripts
 	$(INSTALL) -d $(DESTDIR)$(docdir)/scripts/GeographicLib
diff --git a/doc/Makefile.in b/doc/Makefile.in
index 50e0bdd..5c83147 100644
--- a/doc/Makefile.in
+++ b/doc/Makefile.in
@@ -584,13 +584,25 @@ maintainer-clean-local:
 install-doc: html/index.html
 	$(INSTALL) -d $(DESTDIR)$(docdir)/html
 	$(INSTALL) -m 644 `dirname $<`/*.* $(DESTDIR)$(docdir)/html
+	-test -f `dirname $<`/search/search.js && \
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/search && \
+	$(INSTALL) -m 644 `dirname $<`/search/*.* \
+	$(DESTDIR)$(docdir)/html/search
 	-test -f `dirname $<`/C/index.html && \
 	$(INSTALL) -d $(DESTDIR)$(docdir)/html/C && \
 	$(INSTALL) -m 644 `dirname $<`/C/*.* $(DESTDIR)$(docdir)/html/C
+	-test -f `dirname $<`/C/search/search.js && \
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/C/search && \
+	$(INSTALL) -m 644 `dirname $<`/C/search/*.* \
+	$(DESTDIR)$(docdir)/html/C/search
 	-test -f `dirname $<`/Fortran/index.html && \
 	$(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran && \
 	$(INSTALL) -m 644 `dirname $<`/Fortran/*.* \
 	$(DESTDIR)$(docdir)/html/Fortran
+	-test -f `dirname $<`/Fortran/search/search.js && \
+	$(INSTALL) -d $(DESTDIR)$(docdir)/html/Fortran/search && \
+	$(INSTALL) -m 644 `dirname $<`/Fortran/search/*.* \
+	$(DESTDIR)$(docdir)/html/Fortran/search
 	$(INSTALL) -d $(DESTDIR)$(docdir)/scripts
 	$(INSTALL) -m 644 $(SCRIPTDRIVERS) $(DESTDIR)$(docdir)/scripts
 	$(INSTALL) -d $(DESTDIR)$(docdir)/scripts/GeographicLib
diff --git a/doc/NETGeographicLib.dox b/doc/NETGeographicLib.dox
index 9ebab98..d0fe26d 100644
--- a/doc/NETGeographicLib.dox
+++ b/doc/NETGeographicLib.dox
@@ -175,7 +175,7 @@ two ways:
   application.  You can build %GeographicLib as a shared library using
   <code>-D GEOGRAPHICLIB_LIB_TYPE=SHARED</code> or <code>BOTH</code>.
 - you have installed %GeographicLib using one of the binary installers (see
-  \ref windowsbin "Using a binary installer for Windows" in the
+  \ref binaryinstwin "Using a binary installer for Windows" in the
   %GeographicLib documentation).  In this case, you are restricted to using
   Visual Studio 10.
 
diff --git a/doc/scripts/GeographicLib/DMS.js b/doc/scripts/GeographicLib/DMS.js
index e2f339f..0be8dfa 100644
--- a/doc/scripts/GeographicLib/DMS.js
+++ b/doc/scripts/GeographicLib/DMS.js
@@ -5,7 +5,7 @@
  * See the documentation for the C++ class.  The conversion is a literal
  * conversion from C++.
  *
- * Copyright (c) Charles Karney (2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2011-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
@@ -52,6 +52,7 @@ GeographicLib.DMS = {};
     dmsa = dmsa.replace(/\u2019/g, '\'');
     dmsa = dmsa.replace(/\u2033/g, '"');
     dmsa = dmsa.replace(/\u201d/g, '"');
+    dmsa = dmsa.replace(/\u2212/g, '-');
     dmsa = dmsa.replace(/''/g, '"');
     dmsa = dmsa.replace(/^\s+/, "");
     dmsa = dmsa.replace(/\s+$/, "");
diff --git a/doc/scripts/geod-calc.html b/doc/scripts/geod-calc.html
index a6e0b09..d126275 100644
--- a/doc/scripts/geod-calc.html
+++ b/doc/scripts/geod-calc.html
@@ -462,10 +462,6 @@ function GeodesicArea(input, polyline) {
       <a href="mailto:charles at karney.com"><charles at karney.com></a>
       (2011-08-04)</address>
     <br>
-    <a href="http://geographiclib.sourceforge.net">
-      <img
-	 src="http://sourceforge.net/sflogo.php?group_id=283628&type=9"
-	 border="0" height="15" width="80" alt="SourceForge.net" />
-    </a>
+    <a href="http://geographiclib.sourceforge.net">Geographiclib Sourceforge</a>
   </body>
 </html>
diff --git a/doc/scripts/geod-google-instructions.html b/doc/scripts/geod-google-instructions.html
index 89c2e56..a93d2b6 100644
--- a/doc/scripts/geod-google-instructions.html
+++ b/doc/scripts/geod-google-instructions.html
@@ -109,10 +109,6 @@
       <a href="mailto:charles at karney.com"><charles at karney.com></a>
       (2011-08-02)</address>
     <br>
-    <a href="http://geographiclib.sourceforge.net">
-      <img
-	 src="http://sourceforge.net/sflogo.php?group_id=283628&type=9"
-	 border="0" height="15" width="80" alt="SourceForge.net" />
-    </a>
+    <a href="http://geographiclib.sourceforge.net">Geographiclib Sourceforge</a>
   </body>
 </html>
diff --git a/dotnet/NETGeographicLib/CMakeLists.txt b/dotnet/NETGeographicLib/CMakeLists.txt
index 664b1bc..64e5ed2 100644
--- a/dotnet/NETGeographicLib/CMakeLists.txt
+++ b/dotnet/NETGeographicLib/CMakeLists.txt
@@ -16,27 +16,33 @@ target_link_libraries (${NETGEOGRAPHICLIB_LIBRARIES} ${PROJECT_LIBRARIES})
 
 # Set the version number on the library
 set_target_properties (${NETGEOGRAPHICLIB_LIBRARIES} PROPERTIES
-  VERSION "${LIBVERSIONFULL}" OUTPUT_NAME ${NETLIBNAME}
-  PDB_NAME ${NETLIBNAME}${CMAKE_DEBUG_POSTFIX})
+  VERSION "${LIBVERSIONFULL}" OUTPUT_NAME ${NETLIBNAME})
 
-# Specify where the library is installed, adding it to the export depends
+# Specify where the library is installed, adding it to the export targets
 install (TARGETS ${NETGEOGRAPHICLIB_LIBRARIES}
-  EXPORT depends
+  EXPORT targets
   RUNTIME DESTINATION bin)
 
 if (PACKAGE_DEBUG_LIBS)
   install (PROGRAMS
-    "${CMAKE_CURRENT_BINARY_DIR}/Debug/${NETLIBNAME}${CMAKE_DEBUG_POSTFIX}.dll"
+    "${PROJECT_BINARY_DIR}/bin/Debug/${NETLIBNAME}${CMAKE_DEBUG_POSTFIX}.dll"
     DESTINATION bin CONFIGURATIONS Release)
 endif ()
 
-# Install pdb file in debug mode.
-get_target_property (_P ${NETGEOGRAPHICLIB_LIBRARIES} LOCATION_DEBUG)
-get_filename_component (_P ${_P} PATH)
-get_target_property (_N ${NETGEOGRAPHICLIB_LIBRARIES} PDB_NAME)
-set (_PDB ${_P}/${_N}.pdb)
-install (FILES ${_PDB} DESTINATION bin
-  RENAME ${NETLIBNAME}${CMAKE_DEBUG_POSTFIX}.pdb CONFIGURATIONS Debug)
+if (NOT CMAKE_VERSION VERSION_LESS 3.0)
+  # Suppress 3.0 warnings about use of the LOCATION target property
+  cmake_policy (SET CMP0026 OLD)
+endif()
+
+# Install pdb file.
+foreach (_c ${CMAKE_CONFIGURATION_TYPES})
+  string (TOUPPER ${_c} _C)
+  get_target_property (_P ${NETGEOGRAPHICLIB_LIBRARIES} LOCATION_${_C})
+  get_filename_component (_D ${_P} PATH)
+  get_filename_component (_N ${_P} NAME_WE)
+  set (_PDB ${_D}/${_N}.pdb)
+  install (FILES ${_PDB} DESTINATION bin CONFIGURATIONS ${_c} OPTIONAL)
+endforeach ()
 
 # Put all the library into a folder in the IDE
 set_property (TARGET ${NETGEOGRAPHICLIB_LIBRARIES} PROPERTY FOLDER library)
diff --git a/dotnet/NETGeographicLib/NormalGravity.h b/dotnet/NETGeographicLib/NormalGravity.h
index 34cd6a6..e034e75 100644
--- a/dotnet/NETGeographicLib/NormalGravity.h
+++ b/dotnet/NETGeographicLib/NormalGravity.h
@@ -77,14 +77,12 @@ namespace NETGeographicLib
         // the finalizer frees the unmanaged memory when the object is destroyed.
         !NormalGravity(void);
     public:
-        /// \cond SKIP
         //! The enumerated standard gravity models.
         enum class StandardModels
         {
             WGS84,  //!< WGS84 gravity model.
             GRS80   //!< GRS80 gravity model.
         };
-        /// \endcond
 
         /** \name Setting up the normal gravity
          **********************************************************************/
diff --git a/dotnet/examples/ManagedCPP/CMakeLists.txt b/dotnet/examples/ManagedCPP/CMakeLists.txt
index ceee57c..00c3fcf 100644
--- a/dotnet/examples/ManagedCPP/CMakeLists.txt
+++ b/dotnet/examples/ManagedCPP/CMakeLists.txt
@@ -17,7 +17,7 @@ foreach (EXAMPLE_SOURCE ${EXAMPLE_SOURCES})
   # Release/NETGeographic.dll to Debug/NETGeographic_d.dll for Debug
   # builds.
   set_target_properties (${EXAMPLE} PROPERTIES VS_DOTNET_REFERENCES
-    "${CMAKE_CURRENT_BINARY_DIR}/../../NETGeographicLib/Release/NETGeographic.dll")
+    "${PROJECT_BINARY_DIR}/bin/Release/NETGeographic.dll")
 endforeach ()
 
 string (REPLACE "/RTC1" "" CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}")
diff --git a/dotnet/examples/ManagedCPP/example-Rhumb.cpp b/dotnet/examples/ManagedCPP/example-Rhumb.cpp
index 1be7d23..c8d08c9 100644
--- a/dotnet/examples/ManagedCPP/example-Rhumb.cpp
+++ b/dotnet/examples/ManagedCPP/example-Rhumb.cpp
@@ -1,7 +1,8 @@
 using namespace System;
 using namespace NETGeographicLib;
 
-int main(array<System::String ^> ^args)
+int main(array<System::String ^> ^/*args*/
+)
 {
   try {
     Rhumb^ rhumb = gcnew Rhumb(Constants::WGS84::MajorRadius, Constants::WGS84::Flattening, true);
diff --git a/dotnet/examples/ManagedCPP/example-RhumbLine.cpp b/dotnet/examples/ManagedCPP/example-RhumbLine.cpp
index cd7bf66..50e2c83 100644
--- a/dotnet/examples/ManagedCPP/example-RhumbLine.cpp
+++ b/dotnet/examples/ManagedCPP/example-RhumbLine.cpp
@@ -1,7 +1,7 @@
 using namespace System;
 using namespace NETGeographicLib;
 
-int main(array<System::String ^> ^args)
+int main(array<System::String ^> ^/*args*/)
 {
   try {
     // Print waypoints between JFK and SIN
diff --git a/dotnet/examples/ManagedCPP/example-UTMUPS.cpp b/dotnet/examples/ManagedCPP/example-UTMUPS.cpp
index a256d0d..c0b62ac 100644
--- a/dotnet/examples/ManagedCPP/example-UTMUPS.cpp
+++ b/dotnet/examples/ManagedCPP/example-UTMUPS.cpp
@@ -1,7 +1,7 @@
 using namespace System;
 using namespace NETGeographicLib;
 
-int main(array<System::String ^> ^args)
+int main(array<System::String ^> ^/*args*/)
 {
     try {
         // See also example-GeoCoords.cpp
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt
index d4b1a5b..8b9cbf5 100644
--- a/examples/CMakeLists.txt
+++ b/examples/CMakeLists.txt
@@ -36,17 +36,5 @@ endif ()
 
 add_custom_target (exampleprograms DEPENDS ${EXAMPLES})
 
-if (MSVC)
-  get_target_property (_LIBTYPE ${PROJECT_LIBRARIES} TYPE)
-  if (_LIBTYPE STREQUAL "SHARED_LIBRARY")
-    # Copy the shared library on Windows systems to this directory
-    # (examples) so that the tests can be run.
-    add_custom_command (TARGET exampleprograms POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E
-      copy $<TARGET_FILE:${PROJECT_LIBRARIES}> ${CMAKE_CFG_INTDIR}
-      COMMENT "Copying shared library to examples directory")
-  endif ()
-endif ()
-
 # Put all the examples into a folder in the IDE
 set_property (TARGET exampleprograms ${EXAMPLES} PROPERTY FOLDER examples)
diff --git a/include/GeographicLib/AlbersEqualArea.hpp b/include/GeographicLib/AlbersEqualArea.hpp
index 1c50e0c..c0b7474 100644
--- a/include/GeographicLib/AlbersEqualArea.hpp
+++ b/include/GeographicLib/AlbersEqualArea.hpp
@@ -2,7 +2,7 @@
  * \file AlbersEqualArea.hpp
  * \brief Header for GeographicLib::AlbersEqualArea class
  *
- * Copyright (c) Charles Karney (2010-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2010-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/Config.h b/include/GeographicLib/Config.h
index 716130b..c2eaf69 100644
--- a/include/GeographicLib/Config.h
+++ b/include/GeographicLib/Config.h
@@ -1,8 +1,8 @@
 // This will be overwritten by ./configure
 
-#define GEOGRAPHICLIB_VERSION_STRING "1.37"
+#define GEOGRAPHICLIB_VERSION_STRING "1.38"
 #define GEOGRAPHICLIB_VERSION_MAJOR 1
-#define GEOGRAPHICLIB_VERSION_MINOR 37
+#define GEOGRAPHICLIB_VERSION_MINOR 38
 #define GEOGRAPHICLIB_VERSION_PATCH 0
 
 // Undefine HAVE_LONG_DOUBLE if this type is unknown to the compiler
diff --git a/include/GeographicLib/Ellipsoid.hpp b/include/GeographicLib/Ellipsoid.hpp
index 0467e65..5b2e644 100644
--- a/include/GeographicLib/Ellipsoid.hpp
+++ b/include/GeographicLib/Ellipsoid.hpp
@@ -2,8 +2,8 @@
  * \file Ellipsoid.hpp
  * \brief Header for GeographicLib::Ellipsoid class
  *
- * Copyright (c) Charles Karney (2012) <charles at karney.com> and licensed under
- * the MIT/X11 License.  For more information, see
+ * Copyright (c) Charles Karney (2012-2014) <charles at karney.com> and licensed
+ * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
 
diff --git a/include/GeographicLib/EllipticFunction.hpp b/include/GeographicLib/EllipticFunction.hpp
index 7a5f42e..e6654d3 100644
--- a/include/GeographicLib/EllipticFunction.hpp
+++ b/include/GeographicLib/EllipticFunction.hpp
@@ -357,13 +357,13 @@ namespace GeographicLib {
      *
      * \e G(φ, α<sup>2</sup>, \e k) is defined by
      * \f[
-     *   \begin{aligned}
+     *   \begin{align}
      *   G(\phi, \alpha^2, k) &=
      *   \frac{k^2}{\alpha^2} F(\phi, k) +
      *      \biggl(1 - \frac{k^2}{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\
      *    &= \int_0^\phi
      *     \frac{\sqrt{1-k^2\sin^2\theta}}{1 - \alpha^2\sin^2\theta}\,d\theta.
-     *   \end{aligned}
+     *   \end{align}
      * \f]
      *
      * Legendre expresses the longitude of a point on the geodesic in terms of
@@ -384,14 +384,14 @@ namespace GeographicLib {
      *
      * \e H(φ, α<sup>2</sup>, \e k) is defined by
      * \f[
-     *   \begin{aligned}
+     *   \begin{align}
      *   H(\phi, \alpha^2, k) &=
      *   \frac1{\alpha^2} F(\phi, k) +
      *        \biggl(1 - \frac1{\alpha^2}\biggr) \Pi(\phi, \alpha^2, k) \\
      *   &= \int_0^\phi
      *     \frac{\cos^2\theta}{(1-\alpha^2\sin^2\theta)\sqrt{1-k^2\sin^2\theta}}
      *     \,d\theta.
-     *   \end{aligned}
+     *   \end{align}
      * \f]
      *
      * Cayley expresses the longitude difference of a point on the geodesic in
diff --git a/include/GeographicLib/GeoCoords.hpp b/include/GeographicLib/GeoCoords.hpp
index 19f2de4..ac20165 100644
--- a/include/GeographicLib/GeoCoords.hpp
+++ b/include/GeographicLib/GeoCoords.hpp
@@ -80,6 +80,8 @@ namespace GeographicLib {
       , _long(0)
       , _easting(2000000)
       , _northing(2000000)
+      , _gamma(0)
+      , _k(Constants::UPS_k0())
       , _northp(true)
       , _zone(0)
     { CopyToAlt(); }
diff --git a/include/GeographicLib/Geocentric.hpp b/include/GeographicLib/Geocentric.hpp
index d358445..ed75203 100644
--- a/include/GeographicLib/Geocentric.hpp
+++ b/include/GeographicLib/Geocentric.hpp
@@ -2,7 +2,7 @@
  * \file Geocentric.hpp
  * \brief Header for GeographicLib::Geocentric class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/Geodesic.hpp b/include/GeographicLib/Geodesic.hpp
index 5c95166..71507a9 100644
--- a/include/GeographicLib/Geodesic.hpp
+++ b/include/GeographicLib/Geodesic.hpp
@@ -2,7 +2,7 @@
  * \file Geodesic.hpp
  * \brief Header for GeographicLib::Geodesic class
  *
- * Copyright (c) Charles Karney (2009-2013) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2009-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/GeodesicExact.hpp b/include/GeographicLib/GeodesicExact.hpp
index e23f1a4..c60adfe 100644
--- a/include/GeographicLib/GeodesicExact.hpp
+++ b/include/GeographicLib/GeodesicExact.hpp
@@ -2,7 +2,7 @@
  * \file GeodesicExact.hpp
  * \brief Header for GeographicLib::GeodesicExact class
  *
- * Copyright (c) Charles Karney (2012-2013) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2012-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/Geoid.hpp b/include/GeographicLib/Geoid.hpp
index 9bd4727..4617bc6 100644
--- a/include/GeographicLib/Geoid.hpp
+++ b/include/GeographicLib/Geoid.hpp
@@ -146,7 +146,8 @@ namespace GeographicLib {
         }
         try {
           filepos(ix, iy);
-          char a, b;
+          // initial values to suppress warnings in case get fails
+          char a = 0, b = 0;
           _file.get(a);
           _file.get(b);
           unsigned r = ((unsigned char)(a) << 8) | (unsigned char)(b);
diff --git a/include/GeographicLib/LambertConformalConic.hpp b/include/GeographicLib/LambertConformalConic.hpp
index 7d93076..99ecb33 100644
--- a/include/GeographicLib/LambertConformalConic.hpp
+++ b/include/GeographicLib/LambertConformalConic.hpp
@@ -2,7 +2,7 @@
  * \file LambertConformalConic.hpp
  * \brief Header for GeographicLib::LambertConformalConic class
  *
- * Copyright (c) Charles Karney (2010-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2010-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/MGRS.hpp b/include/GeographicLib/MGRS.hpp
index f71908b..498ce9a 100644
--- a/include/GeographicLib/MGRS.hpp
+++ b/include/GeographicLib/MGRS.hpp
@@ -2,7 +2,7 @@
  * \file MGRS.hpp
  * \brief Header for GeographicLib::MGRS class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/Math.hpp b/include/GeographicLib/Math.hpp
index 12e0ea9..5df7715 100644
--- a/include/GeographicLib/Math.hpp
+++ b/include/GeographicLib/Math.hpp
@@ -2,7 +2,7 @@
  * \file Math.hpp
  * \brief Header for GeographicLib::Math class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/OSGB.hpp b/include/GeographicLib/OSGB.hpp
index a7cb8d6..a33cf37 100644
--- a/include/GeographicLib/OSGB.hpp
+++ b/include/GeographicLib/OSGB.hpp
@@ -2,7 +2,7 @@
  * \file OSGB.hpp
  * \brief Header for GeographicLib::OSGB class
  *
- * Copyright (c) Charles Karney (2010-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2010-2013) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/PolarStereographic.hpp b/include/GeographicLib/PolarStereographic.hpp
index a8b70ca..f25dd17 100644
--- a/include/GeographicLib/PolarStereographic.hpp
+++ b/include/GeographicLib/PolarStereographic.hpp
@@ -2,7 +2,7 @@
  * \file PolarStereographic.hpp
  * \brief Header for GeographicLib::PolarStereographic class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/TransverseMercator.hpp b/include/GeographicLib/TransverseMercator.hpp
index cf82faf..459dba4 100644
--- a/include/GeographicLib/TransverseMercator.hpp
+++ b/include/GeographicLib/TransverseMercator.hpp
@@ -2,7 +2,7 @@
  * \file TransverseMercator.hpp
  * \brief Header for GeographicLib::TransverseMercator class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/TransverseMercatorExact.hpp b/include/GeographicLib/TransverseMercatorExact.hpp
index c8b1c5a..55302b4 100644
--- a/include/GeographicLib/TransverseMercatorExact.hpp
+++ b/include/GeographicLib/TransverseMercatorExact.hpp
@@ -2,7 +2,7 @@
  * \file TransverseMercatorExact.hpp
  * \brief Header for GeographicLib::TransverseMercatorExact class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/include/GeographicLib/UTMUPS.hpp b/include/GeographicLib/UTMUPS.hpp
index cdf8c96..aa53621 100644
--- a/include/GeographicLib/UTMUPS.hpp
+++ b/include/GeographicLib/UTMUPS.hpp
@@ -2,7 +2,7 @@
  * \file UTMUPS.hpp
  * \brief Header for GeographicLib::UTMUPS class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/man/CMakeLists.txt b/man/CMakeLists.txt
index ccdf213..70fd897 100644
--- a/man/CMakeLists.txt
+++ b/man/CMakeLists.txt
@@ -15,6 +15,7 @@ endif ()
 set (MANPAGES)
 set (USAGE)
 set (HTMLMAN)
+set (SYSMANPAGES)
 
 # Loop over the tools building up lists of the derived files.  Also in
 # maintainer mode, specify how the derived files are created.  The sed
@@ -69,6 +70,14 @@ foreach (TOOL ${TOOLS})
   endif ()
 endforeach ()
 
+if (NOT WIN32)
+  foreach (SCRIPT ${SCRIPTS})
+    string (REPLACE geographiclib-get- "" DATA ${SCRIPT})
+    set (SYSMANPAGES ${SYSMANPAGES} ${CMAKE_CURRENT_BINARY_DIR}/${SCRIPT}.8)
+    configure_file (script.8.in ${SCRIPT}.8 @ONLY)
+  endforeach ()
+endif()
+
 # Add the extra maintainer tasks into the dependency list.  The
 # distrib-man target copies the derived documentation files into the
 # source tree.
@@ -88,7 +97,12 @@ if (MAINTAINER)
         >/dev/null 2>&1 ||
         install -m 644 "$$f" ${CMAKE_CURRENT_SOURCE_DIR}\; done
     COMMENT "Installing man documentation page in source tree")
+else ()
+  add_custom_target (htmlman ALL DEPENDS ${HTMLMAN})
 endif ()
 
 # Install the man pages.
 install (FILES ${MANPAGES} DESTINATION share/man/man1)
+if (NOT WIN32)
+  install (FILES ${SYSMANPAGES} DESTINATION share/man/man8)
+endif ()
diff --git a/man/CartConvert.1 b/man/CartConvert.1
index 60bbb5f..3fa227a 100644
--- a/man/CartConvert.1
+++ b/man/CartConvert.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "CARTCONVERT 1"
-.TH CARTCONVERT 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH CARTCONVERT 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/CartConvert.usage b/man/CartConvert.usage
index 1075478..324111a 100644
--- a/man/CartConvert.usage
+++ b/man/CartConvert.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    CartConvert --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/CartConvert.1.html\n";
+"    http://geographiclib.sf.net/1.38/CartConvert.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/ConicProj.1 b/man/ConicProj.1
index 189aa9b..e4b8024 100644
--- a/man/ConicProj.1
+++ b/man/ConicProj.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "CONICPROJ 1"
-.TH CONICPROJ 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH CONICPROJ 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/ConicProj.usage b/man/ConicProj.usage
index e140e7e..ed6a03f 100644
--- a/man/ConicProj.usage
+++ b/man/ConicProj.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    ConicProj --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/ConicProj.1.html\n";
+"    http://geographiclib.sf.net/1.38/ConicProj.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/GeoConvert.1 b/man/GeoConvert.1
index 6d07163..7582022 100644
--- a/man/GeoConvert.1
+++ b/man/GeoConvert.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "GEOCONVERT 1"
-.TH GEOCONVERT 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH GEOCONVERT 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/GeoConvert.usage b/man/GeoConvert.usage
index 66a2ae3..b2a8449 100644
--- a/man/GeoConvert.usage
+++ b/man/GeoConvert.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    GeoConvert --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/GeoConvert.1.html\n";
+"    http://geographiclib.sf.net/1.38/GeoConvert.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/GeodSolve.1 b/man/GeodSolve.1
index 994bd79..22c180d 100644
--- a/man/GeodSolve.1
+++ b/man/GeodSolve.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "GEODSOLVE 1"
-.TH GEODSOLVE 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH GEODSOLVE 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/GeodSolve.usage b/man/GeodSolve.usage
index 3f1676a..3d46fd1 100644
--- a/man/GeodSolve.usage
+++ b/man/GeodSolve.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    GeodSolve --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/GeodSolve.1.html\n";
+"    http://geographiclib.sf.net/1.38/GeodSolve.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/GeodesicProj.1 b/man/GeodesicProj.1
index 487066c..61c7430 100644
--- a/man/GeodesicProj.1
+++ b/man/GeodesicProj.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "GEODESICPROJ 1"
-.TH GEODESICPROJ 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH GEODESICPROJ 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/GeodesicProj.usage b/man/GeodesicProj.usage
index c5aaeb5..30f8358 100644
--- a/man/GeodesicProj.usage
+++ b/man/GeodesicProj.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    GeodesicProj --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/GeodesicProj.1.html\n";
+"    http://geographiclib.sf.net/1.38/GeodesicProj.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/GeoidEval.1 b/man/GeoidEval.1
index 9c34f27..2f78343 100644
--- a/man/GeoidEval.1
+++ b/man/GeoidEval.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "GEOIDEVAL 1"
-.TH GEOIDEVAL 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH GEOIDEVAL 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/GeoidEval.usage b/man/GeoidEval.usage
index f6c474c..af0b387 100644
--- a/man/GeoidEval.usage
+++ b/man/GeoidEval.usage
@@ -10,7 +10,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    GeoidEval --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/GeoidEval.1.html\n";
+"    http://geographiclib.sf.net/1.38/GeoidEval.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/Gravity.1 b/man/Gravity.1
index 77d65ea..7435190 100644
--- a/man/Gravity.1
+++ b/man/Gravity.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "GRAVITY 1"
-.TH GRAVITY 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH GRAVITY 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/Gravity.usage b/man/Gravity.usage
index 367a351..014214a 100644
--- a/man/Gravity.usage
+++ b/man/Gravity.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    Gravity --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/Gravity.1.html\n";
+"    http://geographiclib.sf.net/1.38/Gravity.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/MagneticField.1 b/man/MagneticField.1
index 5f92ff3..9d183d9 100644
--- a/man/MagneticField.1
+++ b/man/MagneticField.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "MAGNETICFIELD 1"
-.TH MAGNETICFIELD 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH MAGNETICFIELD 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/MagneticField.usage b/man/MagneticField.usage
index c394b31..1ffd044 100644
--- a/man/MagneticField.usage
+++ b/man/MagneticField.usage
@@ -10,7 +10,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    MagneticField --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/MagneticField.1.html\n";
+"    http://geographiclib.sf.net/1.38/MagneticField.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/Makefile.am b/man/Makefile.am
index cb9b7bd..d0c3638 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -42,19 +42,25 @@ HTMLMAN = \
 	RhumbSolve.1.html \
 	TransverseMercatorProj.1.html
 
+SYSMANPAGES = geographiclib-get-geoids.8 \
+	geographiclib-get-gravity.8 \
+	geographiclib-get-magnetic.8
+
 POD2MAN = pod2man --center="GeographicLib Utilities" \
 	--release="$(PACKAGE_STRING)"
-PODFIX= sed -e 's%<head>%<head><link href="http://search.cpan.org/s/style.css" rel="stylesheet" type="text/css">%' -e 's%<code>\([^<>]*\)(\(.\))</code>%<a href="\1.\2.html">&</a>%'g
+PODFIX = sed -e 's%<head>%<head><link href="http://search.cpan.org/s/style.css" rel="stylesheet" type="text/css">%' -e 's%<code>\([^<>]*\)(\(.\))</code>%<a href="\1.\2.html">&</a>%'g
 man1_MANS = $(MANPAGES)
+man8_MANS = $(SYSMANPAGES)
 
-SUFFIXES = .pod .1 .usage .1.html
+SUFFIXES = .pod .1 .usage .1.html .8
 
 all: man
-man: manpages usage htmlman
+man: manpages usage htmlman sysmanpages
 
 manpages: $(MANPAGES)
 usage: $(USAGE)
 htmlman: $(HTMLMAN)
+sysmanpages: $(SYSMANPAGES)
 
 if HAVE_PODPROGS
 
@@ -70,11 +76,14 @@ if HAVE_PODPROGS
 else
 
 USAGECMD = cat $(srcdir)/$@ 2> /dev/null || \
-	sed "s/@TOOL@/$*/g" $(srcdir)/dummy.usage.in > $@
+	sed -e "s/@TOOL@/$*/g" -e "s/@PROJECT_VERSION@/$(VERSION)/g" \
+	$(srcdir)/dummy.usage.in > $@
 MANCMD = cat $(srcdir)/$@ 2> /dev/null || \
-	sed "s/@TOOL@/$*/g" $(srcdir)/dummy.1.in > $@
+	sed -e "s/@TOOL@/$*/g" -e "s/@PROJECT_VERSION@/$(VERSION)/g" \
+	$(srcdir)/dummy.1.in > $@
 HTMLCMD = cat $(srcdir)/$@ 2> /dev/null || \
-	sed "s/@TOOL@/$*/g" $(srcdir)/dummy.1.html.in > $@
+	sed -e "s/@TOOL@/$*/g" -e "s/@PROJECT_VERSION@/$(VERSION)/g" \
+	$(srcdir)/dummy.1.html.in > $@
 
 CartConvert.usage:
 	$(USAGECMD)
@@ -147,12 +156,25 @@ TransverseMercatorProj.1.html:
 
 endif
 
+geographiclib_data = $(datadir)/GeographicLib
+SCRIPTMANCMD = sed -e "s/@SCRIPT@/$*/g" \
+	-e "s/@DATA@/`echo $* | cut -f3 -d-`/g" \
+	-e "s%@GEOGRAPHICLIB_DATA@%$(geographiclib_data)%g" \
+	$(srcdir)/script.8.in > $@
+
+geographiclib-get-geoids.8:
+	$(SCRIPTMANCMD)
+geographiclib-get-gravity.8:
+	$(SCRIPTMANCMD)
+geographiclib-get-magnetic.8:
+	$(SCRIPTMANCMD)
+
 EXTRA_DIST = Makefile.mk CMakeLists.txt makeusage.sh \
 	GeoConvert.pod TransverseMercatorProj.pod \
 	CartConvert.pod ConicProj.pod GeodSolve.pod GeodesicProj.pod \
 	GeoidEval.pod Gravity.pod MagneticField.pod Planimeter.pod \
 	RhumbSolve.pod $(MANPAGES) $(USAGE) $(HTMLMAN) \
-	dummy.usage.in dummy.1.in dummy.1.html.in
+	dummy.usage.in dummy.1.in dummy.1.html.in script.8.in
 
 maintainer-clean-local:
-	rm -rf *.usage *.1.html *.1
+	rm -rf *.usage *.1.html *.1 *.8
diff --git a/man/Makefile.in b/man/Makefile.in
index 90d6e16..eeb1ddc 100644
--- a/man/Makefile.in
+++ b/man/Makefile.in
@@ -143,9 +143,10 @@ am__uninstall_files_from_dir = { \
          $(am__cd) "$$dir" && rm -f $$files; }; \
   }
 man1dir = $(mandir)/man1
-am__installdirs = "$(DESTDIR)$(man1dir)"
+am__installdirs = "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"
+man8dir = $(mandir)/man8
 NROFF = nroff
-MANS = $(man1_MANS)
+MANS = $(man1_MANS) $(man8_MANS)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
@@ -323,29 +324,43 @@ HTMLMAN = \
 	RhumbSolve.1.html \
 	TransverseMercatorProj.1.html
 
+SYSMANPAGES = geographiclib-get-geoids.8 \
+	geographiclib-get-gravity.8 \
+	geographiclib-get-magnetic.8
+
 PODFIX = sed -e 's%<head>%<head><link href="http://search.cpan.org/s/style.css" rel="stylesheet" type="text/css">%' -e 's%<code>\([^<>]*\)(\(.\))</code>%<a href="\1.\2.html">&</a>%'g
 man1_MANS = $(MANPAGES)
-SUFFIXES = .pod .1 .usage .1.html
+man8_MANS = $(SYSMANPAGES)
+SUFFIXES = .pod .1 .usage .1.html .8
 @HAVE_PODPROGS_FALSE at USAGECMD = cat $(srcdir)/$@ 2> /dev/null || \
- at HAVE_PODPROGS_FALSE@	sed "s/@TOOL@/$*/g" $(srcdir)/dummy.usage.in > $@
+ at HAVE_PODPROGS_FALSE@	sed -e "s/@TOOL@/$*/g" -e "s/@PROJECT_VERSION@/$(VERSION)/g" \
+ at HAVE_PODPROGS_FALSE@	$(srcdir)/dummy.usage.in > $@
 
 @HAVE_PODPROGS_FALSE at MANCMD = cat $(srcdir)/$@ 2> /dev/null || \
- at HAVE_PODPROGS_FALSE@	sed "s/@TOOL@/$*/g" $(srcdir)/dummy.1.in > $@
+ at HAVE_PODPROGS_FALSE@	sed -e "s/@TOOL@/$*/g" -e "s/@PROJECT_VERSION@/$(VERSION)/g" \
+ at HAVE_PODPROGS_FALSE@	$(srcdir)/dummy.1.in > $@
 
 @HAVE_PODPROGS_FALSE at HTMLCMD = cat $(srcdir)/$@ 2> /dev/null || \
- at HAVE_PODPROGS_FALSE@	sed "s/@TOOL@/$*/g" $(srcdir)/dummy.1.html.in > $@
+ at HAVE_PODPROGS_FALSE@	sed -e "s/@TOOL@/$*/g" -e "s/@PROJECT_VERSION@/$(VERSION)/g" \
+ at HAVE_PODPROGS_FALSE@	$(srcdir)/dummy.1.html.in > $@
+
+geographiclib_data = $(datadir)/GeographicLib
+SCRIPTMANCMD = sed -e "s/@SCRIPT@/$*/g" \
+	-e "s/@DATA@/`echo $* | cut -f3 -d-`/g" \
+	-e "s%@GEOGRAPHICLIB_DATA@%$(geographiclib_data)%g" \
+	$(srcdir)/script.8.in > $@
 
 EXTRA_DIST = Makefile.mk CMakeLists.txt makeusage.sh \
 	GeoConvert.pod TransverseMercatorProj.pod \
 	CartConvert.pod ConicProj.pod GeodSolve.pod GeodesicProj.pod \
 	GeoidEval.pod Gravity.pod MagneticField.pod Planimeter.pod \
 	RhumbSolve.pod $(MANPAGES) $(USAGE) $(HTMLMAN) \
-	dummy.usage.in dummy.1.in dummy.1.html.in
+	dummy.usage.in dummy.1.in dummy.1.html.in script.8.in
 
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .pod .1 .usage .1.html
+.SUFFIXES: .pod .1 .usage .1.html .8
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
 	@for dep in $?; do \
 	  case '$(am__configure_deps)' in \
@@ -423,6 +438,47 @@ uninstall-man1:
 	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
 	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
 	dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+install-man8: $(man8_MANS)
+	@$(NORMAL_INSTALL)
+	@list1='$(man8_MANS)'; \
+	list2=''; \
+	test -n "$(man8dir)" \
+	  && test -n "`echo $$list1$$list2`" \
+	  || exit 0; \
+	echo " $(MKDIR_P) '$(DESTDIR)$(man8dir)'"; \
+	$(MKDIR_P) "$(DESTDIR)$(man8dir)" || exit 1; \
+	{ for i in $$list1; do echo "$$i"; done;  \
+	if test -n "$$list2"; then \
+	  for i in $$list2; do echo "$$i"; done \
+	    | sed -n '/\.8[a-z]*$$/p'; \
+	fi; \
+	} | while read p; do \
+	  if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; echo "$$p"; \
+	done | \
+	sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+	sed 'N;N;s,\n, ,g' | { \
+	list=; while read file base inst; do \
+	  if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+	    echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \
+	    $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst" || exit $$?; \
+	  fi; \
+	done; \
+	for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+	while read files; do \
+	  test -z "$$files" || { \
+	    echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man8dir)'"; \
+	    $(INSTALL_DATA) $$files "$(DESTDIR)$(man8dir)" || exit $$?; }; \
+	done; }
+
+uninstall-man8:
+	@$(NORMAL_UNINSTALL)
+	@list='$(man8_MANS)'; test -n "$(man8dir)" || exit 0; \
+	files=`{ for i in $$list; do echo "$$i"; done; \
+	} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^8][0-9a-z]*$$,8,;x' \
+	      -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+	dir='$(DESTDIR)$(man8dir)'; $(am__uninstall_files_from_dir)
 tags TAGS:
 
 ctags CTAGS:
@@ -464,7 +520,7 @@ check-am: all-am
 check: check-am
 all-am: Makefile $(MANS)
 installdirs:
-	for dir in "$(DESTDIR)$(man1dir)"; do \
+	for dir in "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)"; do \
 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
 	done
 install: install-am
@@ -533,7 +589,7 @@ install-info: install-info-am
 
 install-info-am:
 
-install-man: install-man1
+install-man: install-man1 install-man8
 
 install-pdf: install-pdf-am
 
@@ -564,7 +620,7 @@ ps-am:
 
 uninstall-am: uninstall-man
 
-uninstall-man: uninstall-man1
+uninstall-man: uninstall-man1 uninstall-man8
 
 .MAKE: install-am install-strip
 
@@ -574,20 +630,22 @@ uninstall-man: uninstall-man1
 	install install-am install-data install-data-am install-dvi \
 	install-dvi-am install-exec install-exec-am install-html \
 	install-html-am install-info install-info-am install-man \
-	install-man1 install-pdf install-pdf-am install-ps \
-	install-ps-am install-strip installcheck installcheck-am \
-	installdirs maintainer-clean maintainer-clean-generic \
-	maintainer-clean-local mostlyclean mostlyclean-generic \
-	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
-	uninstall-am uninstall-man uninstall-man1
+	install-man1 install-man8 install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic maintainer-clean-local mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags-am uninstall uninstall-am uninstall-man uninstall-man1 \
+	uninstall-man8
 
 
 all: man
-man: manpages usage htmlman
+man: manpages usage htmlman sysmanpages
 
 manpages: $(MANPAGES)
 usage: $(USAGE)
 htmlman: $(HTMLMAN)
+sysmanpages: $(SYSMANPAGES)
 
 @HAVE_PODPROGS_TRUE at .pod.usage:
 @HAVE_PODPROGS_TRUE@	sh $(srcdir)/makeusage.sh $< $(VERSION) > $@
@@ -667,8 +725,15 @@ htmlman: $(HTMLMAN)
 @HAVE_PODPROGS_FALSE at TransverseMercatorProj.1.html:
 @HAVE_PODPROGS_FALSE@	$(HTMLCMD)
 
+geographiclib-get-geoids.8:
+	$(SCRIPTMANCMD)
+geographiclib-get-gravity.8:
+	$(SCRIPTMANCMD)
+geographiclib-get-magnetic.8:
+	$(SCRIPTMANCMD)
+
 maintainer-clean-local:
-	rm -rf *.usage *.1.html *.1
+	rm -rf *.usage *.1.html *.1 *.8
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/man/Planimeter.1 b/man/Planimeter.1
index 38a3f32..167112d 100644
--- a/man/Planimeter.1
+++ b/man/Planimeter.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "PLANIMETER 1"
-.TH PLANIMETER 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH PLANIMETER 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/Planimeter.usage b/man/Planimeter.usage
index f4961d3..f874241 100644
--- a/man/Planimeter.usage
+++ b/man/Planimeter.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    Planimeter --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/Planimeter.1.html\n";
+"    http://geographiclib.sf.net/1.38/Planimeter.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/RhumbSolve.1 b/man/RhumbSolve.1
index 377bd37..699cbca 100644
--- a/man/RhumbSolve.1
+++ b/man/RhumbSolve.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "RHUMBSOLVE 1"
-.TH RHUMBSOLVE 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH RHUMBSOLVE 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/RhumbSolve.usage b/man/RhumbSolve.usage
index 4c7317f..b2d40e4 100644
--- a/man/RhumbSolve.usage
+++ b/man/RhumbSolve.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    RhumbSolve --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/RhumbSolve.1.html\n";
+"    http://geographiclib.sf.net/1.38/RhumbSolve.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/TransverseMercatorProj.1 b/man/TransverseMercatorProj.1
index c71a8c1..79db8ef 100644
--- a/man/TransverseMercatorProj.1
+++ b/man/TransverseMercatorProj.1
@@ -133,7 +133,7 @@
 .\" ========================================================================
 .\"
 .IX Title "TRANSVERSEMERCATORPROJ 1"
-.TH TRANSVERSEMERCATORPROJ 1 "2014-08-08" "GeographicLib 1.37" "GeographicLib Utilities"
+.TH TRANSVERSEMERCATORPROJ 1 "2014-10-02" "GeographicLib 1.38" "GeographicLib Utilities"
 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
 .\" way too many mistakes in technical documents.
 .if n .ad l
diff --git a/man/TransverseMercatorProj.usage b/man/TransverseMercatorProj.usage
index 2be47fd..2076b91 100644
--- a/man/TransverseMercatorProj.usage
+++ b/man/TransverseMercatorProj.usage
@@ -9,7 +9,7 @@ int usage(int retval, bool brief) {
 "For full documentation type:\n"
 "    TransverseMercatorProj --help\n"
 "or visit:\n"
-"    http://geographiclib.sf.net/1.37/TransverseMercatorProj.1.html\n";
+"    http://geographiclib.sf.net/1.38/TransverseMercatorProj.1.html\n";
   else
     ( retval ? std::cerr : std::cout ) << "Man page:\n"
 "NAME\n"
diff --git a/man/dummy.usage.in b/man/dummy.usage.in
index 0177501..24ef2dd 100644
--- a/man/dummy.usage.in
+++ b/man/dummy.usage.in
@@ -2,7 +2,7 @@
 
 int usage(int retval, bool /* brief */) {
   ( retval ? std::cerr : std::cout )
-    << "For full documentation visit on @TOOL@, see\n"
+    << "For full documentation on @TOOL@, see\n"
     << "    http://geographiclib.sf.net/@PROJECT_VERSION@/@TOOL@.1.html\n";
   return retval;
 }
diff --git a/man/script.8.in b/man/script.8.in
new file mode 100644
index 0000000..e31974b
--- /dev/null
+++ b/man/script.8.in
@@ -0,0 +1,17 @@
+.IX Title "@DATA@ 8"
+.TH @SCRIPT@ 8 "" "GeographicLib" "GeographicLib"
+.SH "NAME"
+ at SCRIPT@ \-\- a GeographicLib administrative tool
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+\&\fB at SCRIPT@\fR downloads and installs the @DATA@ datasets used by
+GeographicLib, <http://geographiclib.sf.net>.  For documentation, supply
+the \fB-h\fR option:
+.PP
+.Vb 2
+\&   @SCRIPT@ -h
+.Ve
+.PP
+By default, the datasets are installed in
+\&\f(CW\*(C`@GEOGRAPHICLIB_DATA@/@DATA@\*(C'\fR and
+the script requires write access to this directory.
diff --git a/matlab/CMakeLists.txt b/matlab/CMakeLists.txt
index 7d50a50..d9d03c8 100644
--- a/matlab/CMakeLists.txt
+++ b/matlab/CMakeLists.txt
@@ -46,7 +46,7 @@ if (MEX)
         COMMAND
           ${MEX} ${MEXOPTIONS} ${PROJECT_DEFINITIONS}
             -I${PROJECT_BINARY_DIR}/include -I${PROJECT_SOURCE_DIR}/include
-            -L${PROJECT_BINARY_DIR}/src/Release -l${_LIB}
+            -L${PROJECT_BINARY_DIR}/lib/Release -l${_LIB}
             ${INTERFACE}
         COMMENT "Building matlab interface for ${TARGET}"
         DEPENDS ${INTERFACE} ${PROJECT_LIBRARIES})
diff --git a/matlab/Makefile.am b/matlab/Makefile.am
index 456ed2b..ef345de 100644
--- a/matlab/Makefile.am
+++ b/matlab/Makefile.am
@@ -53,7 +53,10 @@ $(srcdir)/tranmerc_inv.m \
 $(srcdir)/gnomonic_fwd.m \
 $(srcdir)/gnomonic_inv.m \
 $(srcdir)/utm_fwd.m \
-$(srcdir)/utm_inv.m
+$(srcdir)/utm_inv.m \
+$(srcdir)/gedoc.m \
+$(srcdir)/gereckon.m \
+$(srcdir)/gedistance.m
 
 MATLAB_GEOD_PRIVATE = \
 $(srcdir)/private/A1m1f.m \
diff --git a/matlab/Makefile.in b/matlab/Makefile.in
index e5e3fa6..8fe4b49 100644
--- a/matlab/Makefile.in
+++ b/matlab/Makefile.in
@@ -300,7 +300,10 @@ $(srcdir)/tranmerc_inv.m \
 $(srcdir)/gnomonic_fwd.m \
 $(srcdir)/gnomonic_inv.m \
 $(srcdir)/utm_fwd.m \
-$(srcdir)/utm_inv.m
+$(srcdir)/utm_inv.m \
+$(srcdir)/gedoc.m \
+$(srcdir)/gereckon.m \
+$(srcdir)/gedistance.m
 
 MATLAB_GEOD_PRIVATE = \
 $(srcdir)/private/A1m1f.m \
diff --git a/matlab/gedistance.m b/matlab/gedistance.m
new file mode 100644
index 0000000..aba7b1c
--- /dev/null
+++ b/matlab/gedistance.m
@@ -0,0 +1,108 @@
+function [s12, azi1, azi2] = gedistance(lat1, lon1, lat2, lon2, ellipsoid)
+%GEDISTANCE  Great ellipse distance between points on an ellipsoid
+%
+%   [s12, azi1, azi2] = GEDISTANCE(lat1, lon1, lat2, lon2)
+%   [s12, azi1, azi2] = GEDISTANCE(lat1, lon1, lat2, lon2, ellipsoid)
+%
+%   solves the inverse great ellipse problem of finding of length and
+%   azimuths of the great ellipse between points specified by lat1, lon1,
+%   lat2, lon2.  The input latitudes and longitudes, lat1, lon1, lat2,
+%   lon2, can be scalars or arrays of equal size and must be expressed in
+%   degrees.  The ellipsoid vector is of the form [a, e], where a is the
+%   equatorial radius in meters, e is the eccentricity.  If ellipsoid is
+%   omitted, the WGS84 ellipsoid (more precisely, the value returned by
+%   DEFAULTELLIPSOID) is used.  The output s12 is the distance in meters
+%   and azi1 and azi2 are the forward azimuths at the end points in
+%   degrees.  GEDOC gives an example and provides additional background
+%   information.  GEDOC also gives the restrictions on the allowed ranges
+%   of the arguments.
+%
+%   When given a combination of scalar and array inputs, the scalar inputs
+%   are automatically expanded to match the size of the arrays.
+%
+%   GEODDISTANCE solves the equivalent geodesic problem and usually this is
+%   preferable to using GEDISTANCE.
+%
+%   This routine depends on the MATLAB File Exchange package "Geodesics on
+%   an ellipsoid of revolution":
+%
+%     http://www.mathworks.com/matlabcentral/fileexchange/39108
+%
+%   This routine should be installed in the SAME DIRECTORY as package
+%   39108.
+%
+%   See also GEDOC, GERECKON, DEFAULTELLIPSOID, ECC2FLAT, FLAT2ECC,
+%     GEODDISTANCE, GEODRECKON.
+
+% Copyright (c) Charles Karney (2014) <charles at karney.com>.
+%
+% This file was distributed with GeographicLib 1.38.
+
+  if nargin < 4, error('Too few input arguments'), end
+  if nargin < 5, ellipsoid = defaultellipsoid; end
+  try
+    Z = lat1 + lon1 + lat2 + lon2;
+    S = size(Z);
+    Z = zeros(S);
+    lat1 = lat1 + Z; lon1 = lon1 + Z;
+    lat2 = lat2 + Z; lon2 = lon2 + Z;
+  catch err
+    error('lat1, lon1, s12, azi1 have incompatible sizes')
+  end
+  if length(ellipsoid(:)) ~= 2
+    error('ellipsoid must be a vector of size 2')
+  end
+
+  degree = pi/180;
+  tiny = sqrt(realmin);
+
+  a = ellipsoid(1);
+  e2 = ellipsoid(2)^2;
+  f = e2 / (1 + sqrt(1 - e2));
+
+  f1 = 1 - f;
+
+  lon12 = AngDiff(AngNormalize(lon1(:)), AngNormalize(lon2(:)));
+  lon12 = AngRound(lon12);
+
+  phi = lat1 * degree;
+  sbet1 = f1 * sin(phi); cbet1 = cos(phi); cbet1(lat1 == -90) = tiny;
+  [sbet1, cbet1] = SinCosNorm(sbet1, cbet1);
+
+  phi = lat2 * degree;
+  sbet2 = f1 * sin(phi); cbet2 = cos(phi); cbet2(abs(lat2) == 90) = tiny;
+  [sbet2, cbet2] = SinCosNorm(sbet2, cbet2);
+
+  lam12 = lon12 * degree;
+  slam12 = sin(lam12); slam12(lon12 == 180) = 0; clam12 = cos(lam12);
+
+  % Solve great circle
+  salp1 = cbet2 .* slam12; calp1 = +cbet1 .* sbet2 - sbet1 .* cbet2 .* clam12;
+  salp2 = cbet1 .* slam12; calp2 = -sbet1 .* cbet2 + cbet1 .* sbet2 .* clam12;
+  ssig12 = hypot(salp1, calp1);
+  csig12 = sbet1 .* sbet2 + cbet1 .* cbet2 .* clam12;
+  [salp1, calp1] = SinCosNorm(salp1, calp1);
+  [salp2, calp2] = SinCosNorm(salp2, calp2);
+  % no need to normalize [ssig12, csig12]
+
+  calp0 = hypot(calp1, salp1 .* sbet1);
+
+  ssig1 = sbet1; csig1 = cbet1 .* calp1;
+  [ssig1, csig1] = SinCosNorm(ssig1, csig1);
+  ssig2 = ssig1 .* csig12 + csig1 .* ssig12;
+  csig2 = csig1 .* csig12 - ssig1 .* ssig12;
+
+  k2 = e2 * calp0.^2;
+  n = k2 ./ (2 * (1 + sqrt(1 - k2)) - k2);
+  C1a = C1f(n);
+  A1 = a * (1 + A1m1f(n)) .* (1 - n)./(1 + n);
+  s12 = A1 .* (atan2(ssig12, csig12) + ...
+               (SinCosSeries(true, ssig2, csig2, C1a) - ...
+                SinCosSeries(true, ssig1, csig1, C1a)));
+  calp1 = calp1 .* sqrt(1 - e2 * cbet1.^2);
+  calp2 = calp2 .* sqrt(1 - e2 * cbet2.^2);
+  azi1 = atan2(salp1, calp1) / degree;
+  azi2 = atan2(salp2, calp2) / degree;
+
+  s12 = reshape(s12, S); azi1 = reshape(azi1, S); azi2 = reshape(azi2, S);
+end
diff --git a/matlab/gedoc.m b/matlab/gedoc.m
new file mode 100644
index 0000000..7eefba9
--- /dev/null
+++ b/matlab/gedoc.m
@@ -0,0 +1,129 @@
+function gedoc
+%GEDOC  Great ellipses on an ellipsoid of revolution
+%
+%   This package includes two routines GEDISTANCE and GERECKON which solve
+%   the inverse and direct problems for great ellipses on the surface of an
+%   ellipsoid of revolution.  For more information, see
+%
+%     http://geographiclib.sf.net/1.38/greatellipse.html
+%
+%   Great ellipses are sometimes proposed as alternatives to computing
+%   ellipsoidal geodesics.  However geodesic calculations are easy to
+%   perform using GEODDISTANCE and GEODRECKON, and these should normally be
+%   used instead of GEDISTANCE and GERECKON.  For a discussion, see
+%
+%     http://geographiclib.sf.net/html/greatellipse.html#gevsgeodesic
+%
+%   The method involves stretching the ellipse along the axis until it
+%   becomes a sphere, solving the corresponding great circle problem on the
+%   sphere and mapping the results back to the ellipsoid.  For details,
+%   see
+%
+%     http://geographiclib.sf.net/html/greatellipse.html#geformulation
+%
+%   Finding the distance involves computing the arc length of an ellipse
+%   and this package uses the rapidly converging series employed by MATLAB
+%   File Exchange package "Geodesics on an ellipsoid of revolution" (which
+%   provides GEODDISTANCE and GEODRECKON):
+%
+%     http://www.mathworks.com/matlabcentral/fileexchange/39108
+%
+%   gedistance.m and gereckon.m should be installed in the SAME DIRECTORY
+%   as package 39108 because these routines require access to its private
+%   utility routines.
+%
+%   Consider two points on the ellipsoid at (lat1, lon1) and (lat2, lon2).
+%   The plane containing these points and the center of the ellipsoid
+%   intersects the ellipsoid on a great ellipse.  The length of the shorter
+%   portion of the great ellipse between the two points is s12 and the
+%   great ellipse from point 1 to point 2 has forward azimuths azi1 and
+%   azi2 at the two end points.
+%
+%   Two great ellipse problems can be considered:
+%     * the direct problem -- given lat1, lon1, s12, and azi1, determine
+%       lat2, lon2, and azi2.  This is solved by GERECKON.
+%     * the inverse problem -- given lat1, lon1, lat2, lon2, determine s12,
+%       azi1, and azi2.  This is solved by GEDISTANCE.
+%
+%   The parameters of the ellipsoid are specified by the optional ELLIPSOID
+%   argument to the routines.  This is a two-element vector of the form
+%   [a,e], where a is the equatorial radius, e is the eccentricity e =
+%   sqrt(a^2-b^2)/a, and b is the polar semi-axis.  Typically, a and b are
+%   measured in meters and the distances returned by the routines are then
+%   in meters.  However, other units can be employed.  If ELLIPSOID is
+%   omitted, then the WGS84 ellipsoid (more precisely, the value returned
+%   by DEFAULTELLIPSOID) is assumed [6378137, 0.0818191908426215]
+%   corresponding to a = 6378137 meters and a flattening f = (a-b)/a =
+%   1/298.257223563.  The flattening and eccentricity are related by
+%
+%       e = sqrt(f * (2 - f))
+%       f = e^2 / (1 + sqrt(1 - e^2))
+%
+%   (The functions ECC2FLAT and FLAT2ECC implement these conversions.)  For
+%   a sphere, set e = 0; for a prolate ellipsoid (b > a), specify e as a
+%   pure imaginary number.
+%
+%   All angles (latitude, longitude, azimuth) are measured in degrees with
+%   latitudes increasing northwards, longitudes increasing eastwards, and
+%   azimuths measured clockwise from north.  For a point at a pole, the
+%   azimuth is defined by keeping the longitude fixed, writing lat =
+%   +/-(90-eps), and taking the limit eps -> 0+.
+%
+%   Restrictions on the inputs:
+%     * All latitudes must lie in [-90, 90].
+%     * All longitudes and azimuths must lie in [-540, 540).  On output,
+%       these quantities lie in [-180, 180).
+%     * The distance s12 is unrestricted.  This allows great ellipses to wrap
+%       around the ellipsoid.
+%     * The equatorial radius, a, must be positive.
+%     * The eccentricity, e, should be satisfy abs(e) < 0.2 in order to
+%       retain full accuracy (this corresponds to flattenings satisfying
+%       abs(f) <= 1/50, approximately).  This condition holds for most
+%       applications in geodesy.
+%
+%    Larger values of e can be used with a corresponding drop in accuracy.
+%    The following table gives the approximate maximum error in GEDISTANCE
+%    and GERECKON (expressed as a distance) for an ellipsoid with the same
+%    major radius as the WGS84 ellipsoid and different values of the
+%    flattening (nm means nanometer and um means micrometer).
+%
+%         |f|     error
+%         0.01    25 nm
+%         0.02    30 nm
+%         0.05    10 um
+%         0.1    1.5 mm
+%         0.2    300 mm
+%
+%   In order to compute intermediate points on a great ellipse, proceed as
+%   in the following example which plots the track from Sydney to
+%   Valparaiso and computes the deviation from the corresponding geodesic.
+%
+%       % 1 = Sydney, 2 = Valparaiso
+%       lat1 = -33.83; lon1 = 151.29;
+%       lat2 = -33.02; lon2 = -71.64;
+%       [s12g, azi1g] = geoddistance(lat1, lon1, lat2, lon2);
+%       [s12e, azi1e] =   gedistance(lat1, lon1, lat2, lon2);
+%       fprintf('Difference in lengths = %.1f m\n', s12e - s12g);
+%       [latg, long] = geodreckon(lat1, lon1, s12g * [0:100]/100, azi1g);
+%       [late, lone] =   gereckon(lat1, lon1, s12e * [0:100]/100, azi1e);
+%       plot(long+360*(long<0), latg, lone+360*(lone<0), late);
+%       legend('geodesic', 'great ellipse', 'Location', 'SouthEast');
+%       title('Sydney to Valparaiso');
+%       xlabel('longitude'); ylabel('latitude');
+%       fprintf('Maximum separation = %.1f km\n', ...
+%               max(geoddistance(latg, long, late, lone))/1000);
+%
+%   The restriction on e above arises because the meridian distance is
+%   given as a series expansion in the third flattening.  The exact
+%   distance (valid for any e) can be expressed in terms of the elliptic
+%   integral of the second kind .
+%
+%   See also GEDISTANCE, GERECKON, DEFAULTELLIPSOID, ECC2FLAT, FLAT2ECC,
+%     GEODDISTANCE, GEODRECKON.
+
+% Copyright (c) Charles Karney (2014) <charles at karney.com>.
+%
+% This file was distributed with GeographicLib 1.38.
+
+  help gedoc
+end
diff --git a/matlab/geoddoc.m b/matlab/geoddoc.m
index 27165b3..234938e 100644
--- a/matlab/geoddoc.m
+++ b/matlab/geoddoc.m
@@ -105,7 +105,7 @@ function geoddoc
 %    The following table gives the approximate maximum error in
 %    GEODDISTANCE and GEODRECKON (expressed as a distance) for an ellipsoid
 %    with the same major radius as the WGS84 ellipsoid and different values
-%    of the flattening.
+%    of the flattening (nm means nanometer and um means micrometer).
 %
 %         |f|     error
 %         0.01    25 nm
@@ -190,9 +190,9 @@ function geoddoc
 %     DEFAULTELLIPSOID, ECC2FLAT, FLAT2ECC,
 %     GEODESICDIRECT, GEODESICLINE, GEODESICINVERSE, POLYGONAREA.
 
-% Copyright (c) Charles Karney (2012) <charles at karney.com>.
+% Copyright (c) Charles Karney (2012-2014) <charles at karney.com>.
 %
-% This file was distributed with GeographicLib 1.31.
+% This file was distributed with GeographicLib 1.38.
 
   help geoddoc
 end
diff --git a/matlab/gereckon.m b/matlab/gereckon.m
new file mode 100644
index 0000000..2ee0df2
--- /dev/null
+++ b/matlab/gereckon.m
@@ -0,0 +1,125 @@
+function [lat2, lon2, azi2] = gereckon(lat1, lon1, s12, azi1, ellipsoid)
+%GERECKON  Point along great ellipse at specified azimuth and range
+%
+%   [lat2, lon2, azi2] = GERECKON(lat1, lon1, s12, azi1)
+%   [lat2, lon2, azi2] = GERECKON(lat1, lon1, s12, azi1, ellipsoid)
+%
+%   solves the direct great ellipse problem of finding the final point and
+%   azimuth given lat1, lon1, s12, and azi1.  The input arguments lat1,
+%   lon1, s12, azi1, can be scalars or arrays of equal size.  lat1, lon1,
+%   azi1 are given in degrees and s12 in meters.  The ellipsoid vector is
+%   of the form [a, e], where a is the equatorial radius in meters, e is
+%   the eccentricity.  If ellipsoid is omitted, the WGS84 ellipsoid (more
+%   precisely, the value returned by DEFAULTELLIPSOID) is used.  lat2,
+%   lon2, and azi2 give the position and forward azimuths at the end point
+%   in degrees.  GEDOC gives an example and provides additional background
+%   information.  GEDOC also gives the restrictions on the allowed ranges
+%   of the arguments.
+%
+%   When given a combination of scalar and array inputs, GERECKON behaves
+%   as though the inputs were expanded to match the size of the arrays.
+%   However, in the particular case where LAT1 and AZI1 are the same for
+%   all the input points, they should be specified as scalars since this
+%   will considerably speed up the calculations.  (In particular a series
+%   of points along a single geodesic is efficiently computed by specifying
+%   an array for S12 only.)
+%
+%   GEODRECKON solves the equivalent geodesic problem and usually this is
+%   preferable to using GERECKON.
+%
+%   This routine depends on the MATLAB File Exchange package "Geodesics on
+%   an ellipsoid of revolution":
+%
+%     http://www.mathworks.com/matlabcentral/fileexchange/39108
+%
+%   This routine should be installed in the SAME DIRECTORY as package
+%   39108.
+%
+%   See also GEDOC, GEDISTANCE, DEFAULTELLIPSOID, ECC2FLAT, FLAT2ECC,
+%     GEODDISTANCE, GEODRECKON.
+
+% Copyright (c) Charles Karney (2014) <charles at karney.com>.
+%
+% This file was distributed with GeographicLib 1.38.
+
+  if nargin < 4, error('Too few input arguments'), end
+  if nargin < 5, ellipsoid = defaultellipsoid; end
+  try
+    S = size(lat1 + lon1 + s12 + azi1);
+  catch err
+    error('lat1, lon1, s12, azi1 have incompatible sizes')
+  end
+  if length(ellipsoid) ~= 2
+    error('ellipsoid must be a vector of size 2')
+  end
+
+  degree = pi/180;
+  tiny = sqrt(realmin);
+
+  a = ellipsoid(1);
+  e2 = ellipsoid(2)^2;
+  f = e2 / (1 + sqrt(1 - e2));
+  f1 = 1 - f;
+
+  lat1 = lat1(:);
+  lon1 = AngNormalize(lon1(:));
+  azi1 = AngRound(AngNormalize(azi1(:)));
+  s12 = s12(:);
+
+  alp1 = azi1 * degree;
+  salp1 = sin(alp1); salp1(azi1 == -180) = 0;
+  calp1 = cos(alp1); calp1(abs(azi1) == 90) = 0;
+  phi = lat1 * degree;
+  sbet1 = f1 * sin(phi);
+  cbet1 = cos(phi); cbet1(abs(lat1) == 90) = tiny;
+  [sbet1, cbet1] = SinCosNorm(sbet1, cbet1);
+  [salp1, calp1] = SinCosNorm(salp1 .* sqrt(1 - e2 * cbet1.^2), calp1);
+  salp0 = salp1 .* cbet1; calp0 = hypot(calp1, salp1 .* sbet1);
+  ssig1 = sbet1; slam1 = salp0 .* sbet1;
+  csig1 = cbet1 .* calp1; csig1(sbet1 == 0 & calp1 == 0) = 1; clam1 = csig1;
+  [ssig1, csig1] = SinCosNorm(ssig1, csig1);
+
+  k2 = e2 * calp0.^2;
+  n = k2 ./ (2 * (1 + sqrt(1 - k2)) - k2);
+  A1 = a * (1 + A1m1f(n)) .* (1 - n)./(1 + n);
+  C1a = C1f(n);
+  B11 = SinCosSeries(true, ssig1, csig1, C1a);
+  s = sin(B11); c = cos(B11);
+  stau1 = ssig1 .* c + csig1 .* s; ctau1 = csig1 .* c - ssig1 .* s;
+
+  C1pa = C1pf(n);
+  tau12 = s12 ./ A1;
+  s = sin(tau12); c = cos(tau12);
+  B12 = - SinCosSeries(true,  stau1 .* c + ctau1 .* s, ...
+                       ctau1 .* c - stau1 .* s, C1pa);
+  sig12 = tau12 - (B12 - B11);
+  ssig12 = sin(sig12); csig12 = cos(sig12);
+  if abs(f) > 0.01
+    ssig2 = ssig1 .* csig12 + csig1 .* ssig12;
+    csig2 = csig1 .* csig12 - ssig1 .* ssig12;
+    B12 =  SinCosSeries(true, ssig2, csig2, C1a);
+    serr = A1 .* (sig12 + (B12 - B11)) - s12;
+    sig12 = sig12 - serr ./ (a * sqrt(1 - k2 + k2 .* ssig2.^2));
+    ssig12 = sin(sig12); csig12 = cos(sig12);
+  end
+
+  ssig2 = ssig1 .* csig12 + csig1 .* ssig12;
+  csig2 = csig1 .* csig12 - ssig1 .* ssig12;
+  sbet2 = calp0 .* ssig2;
+  cbet2 = hypot(salp0, calp0 .* csig2);
+  cbet2(cbet2 == 0) = tiny;
+  slam2 = salp0 .* ssig2; clam2 = csig2;
+  salp2 = salp0; calp2 = calp0 .* csig2  .* sqrt(1 - e2 * cbet2.^2);
+  lam12 = atan2(slam2 .* clam1 - clam2 .* slam1, ...
+                clam2 .* clam1 + slam2 .* slam1);
+  lon12 = lam12 / degree;
+  lon12 = AngNormalize2(lon12);
+  lon2 = AngNormalize(lon1 + lon12);
+  lat2 = atan2(sbet2, f1 * cbet2) / degree;
+  azi2 = 0 - atan2(-salp2, calp2) / degree;
+
+  lat2 = reshape(lat2, S);
+  lon2 = reshape(lon2, S);
+  azi2 = reshape(azi2, S);
+
+end
diff --git a/pom.xml b/pom.xml
index e4516a3..1fd3287 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
 
   <groupId>com.sri.vt</groupId>
   <artifactId>geographiclib</artifactId>
-  <version>1.37-001-SNAPSHOT</version>
+  <version>1.38-SNAPSHOT</version>
   <packaging>majic-cmake</packaging>
   <name>GeographicLib</name>
 
diff --git a/src/AlbersEqualArea.cpp b/src/AlbersEqualArea.cpp
index d99e3de..aedde93 100644
--- a/src/AlbersEqualArea.cpp
+++ b/src/AlbersEqualArea.cpp
@@ -2,7 +2,7 @@
  * \file AlbersEqualArea.cpp
  * \brief Implementation for GeographicLib::AlbersEqualArea class
  *
- * Copyright (c) Charles Karney (2010-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2010-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 6ea0e36..43afb2b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -19,8 +19,7 @@ endif ()
 if (MSVC)
   if (GEOGRAPHICLIB_SHARED_LIB)
     set_target_properties (${PROJECT_SHARED_LIBRARIES} PROPERTIES
-      VERSION "${LIBVERSIONFULL}" OUTPUT_NAME ${LIBNAME} IMPORT_SUFFIX -i.lib
-      PDB_NAME ${LIBNAME}${CMAKE_DEBUG_POSTFIX})
+      VERSION "${LIBVERSIONFULL}" OUTPUT_NAME ${LIBNAME} IMPORT_SUFFIX -i.lib)
     if (CMAKE_VERSION VERSION_LESS 2.8.11)
       set_target_properties (${PROJECT_SHARED_LIBRARIES} PROPERTIES
         COMPILE_DEFINITIONS GEOGRAPHICLIB_SHARED_LIB=1)
@@ -55,9 +54,9 @@ else ()
   endif ()
 endif ()
 
-# Specify where the library is installed, adding it to the export depends
+# Specify where the library is installed, adding it to the export targets
 install (TARGETS ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES}
-  EXPORT depends
+  EXPORT targets
   RUNTIME DESTINATION bin
   LIBRARY DESTINATION lib${LIB_SUFFIX}
   ARCHIVE DESTINATION lib${LIB_SUFFIX})
@@ -65,27 +64,33 @@ install (TARGETS ${PROJECT_SHARED_LIBRARIES} ${PROJECT_STATIC_LIBRARIES}
 if (MSVC AND PACKAGE_DEBUG_LIBS)
   if (GEOGRAPHICLIB_SHARED_LIB)
     install (FILES
-      "${CMAKE_CURRENT_BINARY_DIR}/Debug/${LIBNAME}${CMAKE_DEBUG_POSTFIX}-i.lib"
+      "${PROJECT_BINARY_DIR}/lib/Debug/${LIBNAME}${CMAKE_DEBUG_POSTFIX}-i.lib"
       DESTINATION lib${LIB_SUFFIX} CONFIGURATIONS Release)
     install (PROGRAMS
-      "${CMAKE_CURRENT_BINARY_DIR}/Debug/${LIBNAME}${CMAKE_DEBUG_POSTFIX}.dll"
+      "${PROJECT_BINARY_DIR}/bin/Debug/${LIBNAME}${CMAKE_DEBUG_POSTFIX}.dll"
       DESTINATION bin CONFIGURATIONS Release)
   endif ()
   if (GEOGRAPHICLIB_STATIC_LIB)
     install (FILES
-      "${CMAKE_CURRENT_BINARY_DIR}/Debug/${LIBNAME}${CMAKE_DEBUG_POSTFIX}.lib"
+      "${PROJECT_BINARY_DIR}/lib/Debug/${LIBNAME}${CMAKE_DEBUG_POSTFIX}.lib"
       DESTINATION lib${LIB_SUFFIX} CONFIGURATIONS Release)
   endif ()
 endif ()
 
 if (MSVC AND GEOGRAPHICLIB_SHARED_LIB)
-  # Install pdb file for shared library in debug mode.
-  get_target_property (_P ${PROJECT_SHARED_LIBRARIES} LOCATION_DEBUG)
-  get_filename_component (_P ${_P} PATH)
-  get_target_property (_N ${PROJECT_SHARED_LIBRARIES} PDB_NAME)
-  set (_PDB ${_P}/${_N}.pdb)
-  install (FILES ${_PDB} DESTINATION bin
-    RENAME ${LIBNAME}${CMAKE_DEBUG_POSTFIX}.pdb CONFIGURATIONS Debug)
+  if (NOT CMAKE_VERSION VERSION_LESS 3.0)
+    # Suppress 3.0 warnings about use of the LOCATION target property
+    cmake_policy (SET CMP0026 OLD)
+  endif ()
+  # Install pdb file for shared library.
+  foreach (_c ${CMAKE_CONFIGURATION_TYPES})
+    string (TOUPPER ${_c} _C)
+    get_target_property (_P ${PROJECT_SHARED_LIBRARIES} LOCATION_${_C})
+    get_filename_component (_D ${_P} PATH)
+    get_filename_component (_N ${_P} NAME_WE)
+    set (_PDB ${_D}/${_N}.pdb)
+    install (FILES ${_PDB} DESTINATION bin CONFIGURATIONS ${_c} OPTIONAL)
+  endforeach ()
 endif ()
 
 # Put the library into a folder in the IDE
diff --git a/src/DMS.cpp b/src/DMS.cpp
index 06ce5be..4c29543 100644
--- a/src/DMS.cpp
+++ b/src/DMS.cpp
@@ -2,7 +2,7 @@
  * \file DMS.cpp
  * \brief Implementation for GeographicLib::DMS class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
@@ -37,6 +37,7 @@ namespace GeographicLib {
     replace(dmsa, "\xe2\x80\x99", '\''); // U+2019 right single quote
     replace(dmsa, "\xe2\x80\xb3", '"');  // U+2033 double prime
     replace(dmsa, "\xe2\x80\x9d", '"');  // U+201d right double quote
+    replace(dmsa, "\xe2\x88\x92", '-');  // U+2212 minus sign
     replace(dmsa, "\xb0", 'd');          // 0xb0 bare degree symbol
     replace(dmsa, "\xba", 'd');          // 0xba bare alt symbol
     replace(dmsa, "\xb4", '\'');         // 0xb4 bare acute accent
diff --git a/src/Ellipsoid.cpp b/src/Ellipsoid.cpp
index a2119b2..fef90c5 100644
--- a/src/Ellipsoid.cpp
+++ b/src/Ellipsoid.cpp
@@ -2,8 +2,8 @@
  * \file Ellipsoid.cpp
  * \brief Implementation for GeographicLib::Ellipsoid class
  *
- * Copyright (c) Charles Karney (2012) <charles at karney.com> and licensed under
- * the MIT/X11 License.  For more information, see
+ * Copyright (c) Charles Karney (2012-2014) <charles at karney.com> and licensed
+ * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
 
diff --git a/src/Geocentric.cpp b/src/Geocentric.cpp
index 634cede..8eda571 100644
--- a/src/Geocentric.cpp
+++ b/src/Geocentric.cpp
@@ -2,7 +2,7 @@
  * \file Geocentric.cpp
  * \brief Implementation for GeographicLib::Geocentric class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/src/Geodesic.cpp b/src/Geodesic.cpp
index c0482e2..732da0b 100644
--- a/src/Geodesic.cpp
+++ b/src/Geodesic.cpp
@@ -2,7 +2,7 @@
  * \file Geodesic.cpp
  * \brief Implementation for GeographicLib::Geodesic class
  *
- * Copyright (c) Charles Karney (2009-2013) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2009-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  *
@@ -214,7 +214,8 @@ namespace GeographicLib {
       slam12 = abs(lon12) == 180 ? 0 : sin(lam12),
       clam12 = cos(lam12);      // lon12 == 90 isn't interesting
 
-    real a12, sig12, calp1, salp1, calp2, salp2;
+    // initial values to suppress warning
+    real a12, sig12, calp1, salp1, calp2 = 0, salp2 = 0;
     // index zero elements of these arrays are unused
     real C1a[nC1_ + 1], C2a[nC2_ + 1], C3a[nC3_];
 
@@ -258,7 +259,7 @@ namespace GeographicLib {
         meridian = false;
     }
 
-    real omg12;
+    real omg12 = 0;             // initial value to suppress warning
     if (!meridian &&
         sbet1 == 0 &&   // and sbet2 == 0
         // Mimic the way Lambda12 works with calp1 = 0
@@ -306,7 +307,9 @@ namespace GeographicLib {
         // value of alp1 is then further from the solution) or if the new
         // estimate of alp1 lies outside (0,pi); in this case, the new starting
         // guess is taken to be (alp1a + alp1b) / 2.
-        real ssig1, csig1, ssig2, csig2, eps;
+        //
+        // initial values to suppress warnings (if loop is executed 0 times)
+        real ssig1 = 0, csig1 = 0, ssig2 = 0, csig2 = 0, eps = 0;
         unsigned numit = 0;
         // Bracketing range
         real salp1a = tiny_, calp1a = 1, salp1b = tiny_, calp1b = -1;
diff --git a/src/GeodesicExact.cpp b/src/GeodesicExact.cpp
index d7c1ddd..47479e7 100644
--- a/src/GeodesicExact.cpp
+++ b/src/GeodesicExact.cpp
@@ -217,7 +217,8 @@ namespace GeographicLib {
       slam12 = abs(lon12) == 180 ? 0 : sin(lam12),
       clam12 = cos(lam12);      // lon12 == 90 isn't interesting
 
-    real a12, sig12, calp1, salp1, calp2, salp2;
+    // initial values to suppress warning
+    real a12, sig12, calp1, salp1, calp2 = 0, salp2 = 0;
 
     bool meridian = lat1 == -90 || slam12 == 0;
 
@@ -259,7 +260,7 @@ namespace GeographicLib {
         meridian = false;
     }
 
-    real omg12;
+    real omg12 = 0;             // initial value to suppress warning
     if (!meridian &&
         sbet1 == 0 &&   // and sbet2 == 0
         // Mimic the way Lambda12 works with calp1 = 0
@@ -306,7 +307,9 @@ namespace GeographicLib {
         // value of alp1 is then further from the solution) or if the new
         // estimate of alp1 lies outside (0,pi); in this case, the new starting
         // guess is taken to be (alp1a + alp1b) / 2.
-        real ssig1, csig1, ssig2, csig2;
+        //
+        // initial values to suppress warnings (if loop is executed 0 times)
+        real ssig1 = 0, csig1 = 0, ssig2 = 0, csig2 = 0;
         unsigned numit = 0;
         // Bracketing range
         real salp1a = tiny_, calp1a = 1, salp1b = tiny_, calp1b = -1;
@@ -338,7 +341,7 @@ namespace GeographicLib {
           real v = Lambda12(sbet1, cbet1, dn1, sbet2, cbet2, dn2, salp1, calp1,
                             salp2, calp2, sig12, ssig1, csig1, ssig2, csig2,
                             E, omg12, numit < maxit1_, dv) - lam12;
-         // 2 * tol0 is approximately 1 ulp for a number in [0, pi].
+          // 2 * tol0 is approximately 1 ulp for a number in [0, pi].
           // Reversed test to allow escape with NaNs
           if (tripb || !(abs(v) >= (tripn ? 8 : 2) * tol0_)) break;
           // Update bracketing values
diff --git a/src/GravityModel.cpp b/src/GravityModel.cpp
index eed7724..0523924 100644
--- a/src/GravityModel.cpp
+++ b/src/GravityModel.cpp
@@ -199,13 +199,11 @@ namespace GeographicLib {
     if (_dzonal0 == 0)
       // No need to do the correction
       correct = false;
-    real
-      invR = correct ? 1 / Math::hypot(Math::hypot(X, Y), Z) : 1,
-      T = (gradp
-           ? _disturbing(-1, X, Y, Z, deltaX, deltaY, deltaZ)
-           : _disturbing(-1, X, Y, Z));
-    T = (T / _amodel - (correct ? _dzonal0 : 0) * invR) * _GMmodel;
+    real T, invR = correct ? 1 / Math::hypot(Math::hypot(X, Y), Z) : 1;
     if (gradp) {
+      // initial values to suppress warnings
+      deltaX = deltaY = deltaZ = 0;
+      T = _disturbing(-1, X, Y, Z, deltaX, deltaY, deltaZ);
       real f = _GMmodel / _amodel;
       deltaX *= f;
       deltaY *= f;
@@ -216,7 +214,9 @@ namespace GeographicLib {
         deltaY += Y * invR;
         deltaZ += Z * invR;
       }
-    }
+    } else
+      T = _disturbing(-1, X, Y, Z);
+    T = (T / _amodel - (correct ? _dzonal0 : 0) * invR) * _GMmodel;
     return T;
   }
 
diff --git a/src/LambertConformalConic.cpp b/src/LambertConformalConic.cpp
index ec11b74..d5c4613 100644
--- a/src/LambertConformalConic.cpp
+++ b/src/LambertConformalConic.cpp
@@ -2,7 +2,7 @@
  * \file LambertConformalConic.cpp
  * \brief Implementation for GeographicLib::LambertConformalConic class
  *
- * Copyright (c) Charles Karney (2010-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2010-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/src/MGRS.cpp b/src/MGRS.cpp
index 8fca631..213d46c 100644
--- a/src/MGRS.cpp
+++ b/src/MGRS.cpp
@@ -2,7 +2,7 @@
  * \file MGRS.cpp
  * \brief Implementation for GeographicLib::MGRS class
  *
- * Copyright (c) Charles Karney (2008-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/src/MagneticModel.cpp b/src/MagneticModel.cpp
index 84d5119..e50c381 100644
--- a/src/MagneticModel.cpp
+++ b/src/MagneticModel.cpp
@@ -173,7 +173,9 @@ namespace GeographicLib {
     real X, Y, Z;
     real M[Geocentric::dim2_];
     _earth.IntForward(lat, lon, h, X, Y, Z, M);
-    real BX0, BY0, BZ0, BX1, BY1, BZ1; // Components in geocentric basis
+    // Components in geocentric basis
+    // initial values to suppress warning
+    real BX0 = 0, BY0 = 0, BZ0 = 0, BX1 = 0, BY1 = 0, BZ1 = 0;
     _harm[n](X, Y, Z, BX0, BY0, BZ0);
     _harm[n + 1](X, Y, Z, BX1, BY1, BZ1);
     if (interpolate) {
diff --git a/src/PolarStereographic.cpp b/src/PolarStereographic.cpp
index cef6b13..ce4409c 100644
--- a/src/PolarStereographic.cpp
+++ b/src/PolarStereographic.cpp
@@ -2,7 +2,7 @@
  * \file PolarStereographic.cpp
  * \brief Implementation for GeographicLib::PolarStereographic class
  *
- * Copyright (c) Charles Karney (2008-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/src/TransverseMercator.cpp b/src/TransverseMercator.cpp
index 5f46aa8..ee91d5e 100644
--- a/src/TransverseMercator.cpp
+++ b/src/TransverseMercator.cpp
@@ -2,7 +2,7 @@
  * \file TransverseMercator.cpp
  * \brief Implementation for GeographicLib::TransverseMercator class
  *
- * Copyright (c) Charles Karney (2008-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  *
diff --git a/src/TransverseMercatorExact.cpp b/src/TransverseMercatorExact.cpp
index 382285f..a69ee68 100644
--- a/src/TransverseMercatorExact.cpp
+++ b/src/TransverseMercatorExact.cpp
@@ -2,7 +2,7 @@
  * \file TransverseMercatorExact.cpp
  * \brief Implementation for GeographicLib::TransverseMercatorExact class
  *
- * Copyright (c) Charles Karney (2008-2011) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  *
@@ -469,8 +469,6 @@ namespace GeographicLib {
       Scale(tau, lam, snu, cnu, dnu, snv, cnv, dnv, gamma, k);
       gamma /= Math::degree();
     } else {
-      tau = overflow();
-      phi = Math::pi()/2;
       lat = 90;
       lon = lam = gamma = 0;
       k = 1;
@@ -482,10 +480,6 @@ namespace GeographicLib {
     lon = Math::AngNormalize(lon + Math::AngNormalize(lon0));
     lat *= latsign;
     if (backside)
-      y = 2 * _Eu.E() - y;
-    y *= _a * _k0 * latsign;
-    x *= _a * _k0 * lonsign;
-    if (backside)
       gamma = 180 - gamma;
     gamma *= latsign * lonsign;
     k *= _k0;
diff --git a/src/UTMUPS.cpp b/src/UTMUPS.cpp
index 06b9f3b..de1f45a 100644
--- a/src/UTMUPS.cpp
+++ b/src/UTMUPS.cpp
@@ -2,7 +2,7 @@
  * \file UTMUPS.cpp
  * \brief Implementation for GeographicLib::UTMUPS class
  *
- * Copyright (c) Charles Karney (2008-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  **********************************************************************/
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt
index 3b80bf5..319ef1e 100644
--- a/tools/CMakeLists.txt
+++ b/tools/CMakeLists.txt
@@ -29,20 +29,14 @@ if (MSVC OR CMAKE_CONFIGURATION_TYPES)
     DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX})
 endif ()
 
-if (MSVC)
-  get_target_property (_LIBTYPE ${PROJECT_LIBRARIES} TYPE)
-  if (_LIBTYPE STREQUAL "SHARED_LIBRARY")
-    # Copy the shared library on Windows systems to this directory
-    # (examples) so that the tests can be run.
-    add_custom_command (TARGET tools POST_BUILD
-      COMMAND ${CMAKE_COMMAND} -E
-      copy $<TARGET_FILE:${PROJECT_LIBRARIES}> ${CMAKE_CFG_INTDIR}
-      COMMENT "Copying shared library to tools directory")
-  endif ()
+if (APPLE AND NOT CMAKE_VERSION VERSION_LESS 2.8.12)
+  # Ensure that the package is relocatable
+  set_target_properties (${TOOLS} PROPERTIES
+    INSTALL_RPATH "@loader_path/../lib${LIB_SUFFIX}")
 endif ()
 
-# Specify where the tools are installed
-install (TARGETS ${TOOLS} EXPORT depends DESTINATION bin)
+# Specify where the tools are installed, adding them to the export targets
+install (TARGETS ${TOOLS} EXPORT targets DESTINATION bin)
 
 # Put all the tools into a folder in the IDE
 set_property (TARGET tools ${TOOLS} PROPERTY FOLDER tools)
diff --git a/tools/CartConvert.cpp b/tools/CartConvert.cpp
index ba59173..f2d90b7 100644
--- a/tools/CartConvert.cpp
+++ b/tools/CartConvert.cpp
@@ -157,7 +157,8 @@ int main(int argc, char* argv[]) {
           }
         }
         std::istringstream str(s);
-        real lat, lon, h, x, y, z;
+        // initial values to suppress warnings
+        real lat, lon, h, x = 0, y = 0, z = 0;
         std::string stra, strb, strc;
         if (!(str >> stra >> strb >> strc))
           throw GeographicErr("Incomplete input: " + s);
diff --git a/tools/GeoConvert.cpp b/tools/GeoConvert.cpp
index 5f69916..b6a8dde 100644
--- a/tools/GeoConvert.cpp
+++ b/tools/GeoConvert.cpp
@@ -2,7 +2,7 @@
  * \file GeoConvert.cpp
  * \brief Command line utility for geographic coordinate conversions
  *
- * Copyright (c) Charles Karney (2008-2012) <charles at karney.com> and licensed
+ * Copyright (c) Charles Karney (2008-2014) <charles at karney.com> and licensed
  * under the MIT/X11 License.  For more information, see
  * http://geographiclib.sourceforge.net/
  *
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 9b90a5e..cf53fc9 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -145,7 +145,7 @@ sbin_SCRIPTS = geographiclib-get-geoids \
 	geographiclib-get-gravity \
 	geographiclib-get-magnetic
 
-geographiclib_data=$(datadir)/GeographicLib
+geographiclib_data = $(datadir)/GeographicLib
 geographiclib-get-geoids: geographiclib-get-geoids.sh
 	sed -e "s%@GEOGRAPHICLIB_DATA@%$(geographiclib_data)%" $< > $@
 	chmod +x $@

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/geographiclib.git



More information about the Pkg-grass-devel mailing list