Class SloppyMath
Math functions that trade off accuracy for speed.
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public static class SloppyMath
Methods
Asin(double)
Returns the arc sine of a value.
The returned angle is in the range -pi/2 through pi/2. Error is around 1E-7. Special cases:Declaration
public static double Asin(double a)
Parameters
Type | Name | Description |
---|---|---|
double | a | the value whose arc sine is to be returned. |
Returns
Type | Description |
---|---|
double | arc sine of the argument |
See Also
Cos(double)
Returns the trigonometric cosine of an angle.
Error is around 1E-15. Special cases:Declaration
public static double Cos(double a)
Parameters
Type | Name | Description |
---|---|---|
double | a | An angle, in radians. |
Returns
Type | Description |
---|---|
double | The cosine of the argument. |
See Also
EarthDiameter(double)
Return an approximate value of the diameter of the earth at the given latitude, in kilometers.
Declaration
public static double EarthDiameter(double latitude)
Parameters
Type | Name | Description |
---|---|---|
double | latitude |
Returns
Type | Description |
---|---|
double |
Haversin(double, double, double, double)
Returns the distance in kilometers between two points specified in decimal degrees (latitude/longitude).
Declaration
public static double Haversin(double lat1, double lon1, double lat2, double lon2)
Parameters
Type | Name | Description |
---|---|---|
double | lat1 | Latitude of the first point. |
double | lon1 | Longitude of the first point. |
double | lat2 | Latitude of the second point. |
double | lon2 | Longitude of the second point. |
Returns
Type | Description |
---|---|
double | distance in kilometers. |