|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.util.SloppyMath
public class SloppyMath
Math functions that trade off accuracy for speed.
Constructor Summary | |
---|---|
SloppyMath()
|
Method Summary | |
---|---|
static double |
asin(double a)
Returns the arc sine of a value. |
static double |
cos(double a)
Returns the trigonometric cosine of an angle. |
static double |
earthDiameter(double latitude)
Return an approximate value of the diameter of the earth at the given latitude, in kilometers. |
static double |
haversin(double lat1,
double lon1,
double lat2,
double lon2)
Returns the distance in kilometers between two points specified in decimal degrees (latitude/longitude). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SloppyMath()
Method Detail |
---|
public static double haversin(double lat1, double lon1, double lat2, double lon2)
lat1
- Latitude of the first point.lon1
- Longitude of the first point.lat2
- Latitude of the second point.lon2
- Longitude of the second point.
public static double cos(double a)
Error is around 1E-15.
Special cases:
NaN
or an infinity, then the result is NaN
.
a
- an angle, in radians.
Math.cos(double)
public static double asin(double a)
The returned angle is in the range -pi/2 through pi/2. Error is around 1E-7.
Special cases:
NaN
or its absolute value is greater than 1, then the result is NaN
.
a
- the value whose arc sine is to be returned.
Math.asin(double)
public static double earthDiameter(double latitude)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |