|
Formula 1.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Objecthirondelle.formula.function.builtin.Distance
public final class Distance
distance(φ1, λ1, φ2, λ2): the distance in kilometres from one place to another.
Constructor Summary | |
---|---|
Distance()
|
Method Summary | |
---|---|
Decimal |
calculate(Decimal... aArgs)
Returns the distance between two points on the Earth's surface, in kilometers. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Distance()
Method Detail |
---|
public Decimal calculate(Decimal... aArgs)
This method takes 4 parameters, in the following order:
Latitude is positive north of the equator, and negative south of the equator. Longitude is positive to the east of Greenwich meridian (Asia, for example), and negative to the west of the Greenwich meridian (America, for example).
The return value usually has a large number of decimal places. That precision is spurious and without physical significance, since the underlying implementation makes the approximation that the Earth is spherical.
The caller should round the result to a reasonable number of decimal places.
This implementation uses two underlying formulas - one appropriate for large distances, and one appropriate for small distances.
calculate
in interface Function
aArgs
- 0 or more arguments to the function.
|
Formula 1.0.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |