[EHPweb] Change to the bearing function in the Nearest Cities
Matthew J Donnelly
mdonnelly at usgs.gov
Fri Apr 8 20:05:12 UTC 2011
The Problem: It was found that the bearing function used in nearest
cities incorrectly calculated bearing if it required going over the 180
degree meridian. Also on further inspection, the algorithm it was using
has great distortion of the bearing when at high latitudes.
The Solution: I developed a simple methodology for determining if the
bearing crosses 180 and the way to handle bearing in that case. I also
replaced the existing algorithm that calculates bearing by using Rhumb
line (basically the planar bearing) with one that calculates it using a
Great Circle calculation. By using the Great Circle it seems to have
fixed the distortion we saw at high latitudes.
Matthew
-------------------------
Matthew J Donnelly
Information Technology Specialist
National Earthquake Information Center
US Geological Survey
Golden, CO 80401
Ph: 303-273-8590
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://geohazards.usgs.gov/pipermail/ehpweb/attachments/20110408/fd1b3089/attachment.html>
More information about the EHPweb
mailing list