wonderly.jeaprs.aprs.data
Class Distance

java.lang.Object
  |
  +--wonderly.jeaprs.aprs.data.Distance

public class Distance
extends java.lang.Object

This class provides geographical distance calculations using integer math with static tables. This eliminates the use of floating point, but with a loss of some precision.

Version:
1.0
Author:
Gregg Wonderly - The information contained in this document is Copyright 2001-2003, Gregg Wonderly, all rights reserved.

Field Summary
static long kiloPerDegree
           
static long onePointOneSix
           
 
Constructor Summary
Distance()
           
 
Method Summary
static long stationDistanceMiles(long lt1, long lg1, long lt2, long lg2)
          Fixed point calculation of distance between two points.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

onePointOneSix

public static final long onePointOneSix

kiloPerDegree

public static final long kiloPerDegree
Constructor Detail

Distance

public Distance()
Method Detail

stationDistanceMiles

public static long stationDistanceMiles(long lt1,
                                        long lg1,
                                        long lt2,
                                        long lg2)
Fixed point calculation of distance between two points. Error is about 1.5 miles at 15 miles distance due to rounding.