Class SloppyMath
Math functions that trade off accuracy for speed.
Inheritance
System.Object
SloppyMath
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
public class SloppyMath
Methods
| Improve this Doc View SourceAsin(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:
- If the argument is System.Double.NaN or its absolute value is greater than 1, then the result is System.Double.NaN.
Declaration
public static double Asin(double a)
Parameters
Type | Name | Description |
---|---|---|
System.Double | a | the value whose arc sine is to be returned. |
Returns
Type | Description |
---|---|
System.Double | arc sine of the argument |
See Also
System.Math.Asin(System.Double)
Cos(Double)
Returns the trigonometric cosine of an angle.
Error is around 1E-15.
Special cases:
- If the argument is System.Double.NaN or an infinity, then the result is System.Double.NaN.
Declaration
public static double Cos(double a)
Parameters
Type | Name | Description |
---|---|---|
System.Double | a | An angle, in radians. |
Returns
Type | Description |
---|---|
System.Double | The cosine of the argument. |
See Also
System.Math.Cos(System.Double)
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 |
---|---|---|
System.Double | latitude |
Returns
Type | Description |
---|---|
System.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 |
---|---|---|
System.Double | lat1 | Latitude of the first point. |
System.Double | lon1 | Longitude of the first point. |
System.Double | lat2 | Latitude of the second point. |
System.Double | lon2 | Longitude of the second point. |
Returns
Type | Description |
---|---|
System.Double | distance in kilometers. |