Show / Hide Table of Contents

    Class SloppyMath

    Math functions that trade off accuracy for speed.

    Inheritance
    System.Object
    SloppyMath
    Namespace: Lucene.Net.Util
    Assembly: Lucene.Net.dll
    Syntax
    public class SloppyMath : object

    Methods

    | Improve this Doc View Source

    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:

    • If the argument is or its absolute value is greater than 1, then the result is .

    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

    | Improve this Doc View Source

    Cos(Double)

    Returns the trigonometric cosine of an angle.

    Error is around 1E-15.

    Special cases:

    • If the argument is or an infinity, then the result is .

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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.

    • Improve this Doc
    • View Source
    Back to top Copyright © 2020 Licensed to the Apache Software Foundation (ASF)