• MARS Website
  • Core API
  • SmartOpenHamburg API
  • Model Components API
  • Common API
Show / Hide Table of Contents
  • Mars.Common
    • GeoHash
    • GeoHashDecoder
    • GeohashDecodeResult
    • GeoHashEncoder
    • GeoHashPrecision
    • Hyperrectangle
    • InputHashHelper
    • PositionHelper
  • Mars.Common.Collections
    • BinaryArrayHeap<T>
    • DoubleBits
    • FibonacciHeap<T, TKey>
    • FibonacciHeapDoubleKey<T>
    • FibonacciHeapNode<T, TKey>
    • FibonacciHeapNodeDoubleKey<T>
    • HeapNode
    • IntervalSize
    • K2DTree<T>
    • K2dTreeNode<T>
    • KdTree
    • KdTree<T>
    • KdTreeBase<TNode>
    • KdTreeNode
    • KdTreeNode<T>
    • KdTreeNodeBase<TNode>
    • KdTreeNodeCollection<TNode>
    • KdTreeNodeList<T>
    • Key
    • Node<T>
    • NodeBase<T>
    • NodeDataContainer<T>
    • NodeDistance<TNode>
    • QuadTree<T>
    • Root<T>
    • TreeDataContainer<T>
  • Mars.Common.Collections.CritBit
    • ICritBitTree<TValue>
  • Mars.Common.Collections.Graph
    • EdgeData
    • GraphData
    • GraphSerializer
    • ISpatialGraph
    • KeyContainer
    • NodeData
    • SpatialGraph
    • SpatialGraphHelper
  • Mars.Common.Collections.Graph.Algorithms
    • AStar
    • CompressedPathDatabase
    • ContractionSearch
    • DepthLimitedTraversal
  • Mars.Common.Collections.Graph.Helper
    • INodeFinder
    • KdTreeNodeFinder
    • RunLengthEncoder
  • Mars.Common.Collections.KNNGraph
    • DefaultRandomGenerator
    • DistanceUtils
    • EventSources
    • EventSources.GraphBuildEventSource
    • EventSources.GraphSearchEventSource
    • IProgressReporter
    • IProvideRandomValues
    • KnnGraph<TItem, TDistance>
    • KnnGraph<TItem, TDistance>.KnnSearchResult
    • KnnGraph<TItem, TDistance>.Parameters
    • Node
    • ReverseComparer<T>
    • ReverseComparerExtensions
    • SelectionKind
    • TravelingCosts<TItem, TDistance>
  • Mars.Common.Compat
    • FormatDecoderAttribute
    • FormatEncoderAttribute
    • FormatHandlerAttribute
    • IntegerAttribute
    • NegativeIntegerAttribute
    • NonnegativeIntegerAttribute
    • NonpositiveIntegerAttribute
    • PositiveIntegerAttribute
  • Mars.Common.Data
    • DomainDataImporter
  • Mars.Common.Data.Providers
    • AscDataProvider
    • GeoJsonFeatureCollectionConverter
    • GeoJsonFeatureConverter
    • GeoJsonHelper
    • GeometryDataProvider
    • GraphMlProvider
    • HttpDataProvider
    • IDataProvider<TInput>
    • JsonFileDataProvider
    • JsonTextDataProvider
    • XmlFileDataProvider
    • XmlTextDataProvider
  • Mars.Common.Exceptions
    • DimensionMismatchException
    • ParseException
  • Mars.Common.IO
    • ExtensionMethods
    • FileClientUtils
    • FileKeys
    • HttpClientUtils
    • ObjectSerialize
    • Serializer
    • SerializerCompression
    • SparseFormat
    • SparseReader
    • SparseWriter
  • Mars.Common.IO.Attributes
    • SerializationBinderAttribute
    • SurrogateSelectorAttribute
  • Mars.Common.IO.Console
    • ChildProgressBar
    • IProgressBar
    • ProgressBar
    • ProgressBarBase
    • ProgressBarHeight
    • ProgressBarOptions
    • ProgressBarSimple
  • Mars.Common.IO.Csv
    • CsvAnalyzer
    • CsvReader
    • CsvReader.RecordEnumerator
    • CsvWriter
    • MissingFieldAction
    • ParseErrorAction
    • ValueTrimmingOptions
  • Mars.Common.IO.Events
    • ParseErrorEventArgs
  • Mars.Common.IO.Exceptions
    • MalformedCsvException
    • MissingFieldCsvException
  • Mars.Common.IO.Mapped
    • Context
    • DefaultArrayFactory
    • Extensions
    • IArrayFactory
    • ISerializableToStream
    • MappedAccessor<T>
    • MemoryMap
    • MemoryMap.CreateAccessorFunc<T>
    • MemoryMap.ReadFromDelegate<T>
    • MemoryMap.WriteToDelegate<T>
    • MemoryMapDelegates
    • MemoryMapDelegates.CreateAccessorFunc<T>
    • MemoryMapStream
  • Mars.Common.IO.Mapped.Accessors
    • MappedAccessorByte
    • MappedAccessorDouble
    • MappedAccessorInt16
    • MappedAccessorInt32
    • MappedAccessorInt64
    • MappedAccessorSingle
    • MappedAccessorUInt16
    • MappedAccessorUInt32
    • MappedAccessorUInt64
    • MappedAccessorVariable<T>
  • Mars.Common.IO.Mapped.Arrays
    • Array<T>
    • ArrayBase<T>
    • ArrayProfile
    • MappedArray<TMapped, T>
    • MappedArray<TMapped, T>.MapFrom
    • MappedArray<TMapped, T>.MapTo
    • MemoryArray<T>
    • VariableArray<T>
  • Mars.Common.IO.Mapped.Collections
    • MemoryBackedDictionary<TKey, TValue>
    • MemoryBackedList<T>
  • Mars.Common.IO.Mapped.Indexes
    • Index<T>
  • Mars.Common.IO.Mapped.Streams
    • CappedStream
  • Mars.Common.Socket
    • ByteOrder
    • CloseEventArgs
    • CloseStatusCode
    • CompressionMethod
    • ErrorEventArgs
    • Ext
    • MessageEventArgs
    • WebSocket
    • WebSocketException
    • WebSocketState
  • Mars.Common.Socket.Server
    • IWebSocketSession
    • WebHeaderCollection
    • WebSocketBehavior
    • WebSocketContext
    • WebSocketServer
    • WebSocketServiceHost
    • WebSocketServiceManager
    • WebSocketSessionManager
  • Mars.Numerics
    • Classes
    • Combinatorics
    • Constants
    • Distance
    • Elementwise
    • Jagged
    • MathematicsException
    • MathHelper
    • Matrix
    • MatrixOrder
    • MatrixType
    • Norm
    • Sort
    • Sorting
    • Sparse
    • Sparse<T>
    • Tools
    • Vector
    • VectorHelper
    • VectorType
  • Mars.Numerics.Comparers
    • ArrayComparer<T>
    • ComparerDirection
    • CustomComparer<T>
    • ElementComparer
    • ElementComparer<T>
    • GeneralComparer
    • StableComparer<T>
  • Mars.Numerics.Distances
    • Angular
    • Chebyshev
    • Cosine
    • Dirac<T>
    • Euclidean
    • Hamming
    • Hamming<T>
    • Haversine
    • Jaccard
    • Jaccard<T>
    • Kulczynski
    • Levenshtein
    • Levenshtein<T>
    • Manhattan
    • Matching
    • Minkowski
    • SquareEuclidean
    • Vincenty
    • Vincenty.Ellipsoid
  • Mars.Numerics.Distances.Base
    • IDistance<T>
    • IDistance<TFirst, TSecond>
    • IMetric<T>
    • ISimilarity<T, TU>
    • ISimilarity<T>
  • Mars.Numerics.Exceptions
    • DimensionMismatchException
    • NonPositiveDefiniteMatrixException
    • SingularMatrixException
  • Mars.Numerics.Formats
    • DefaultMatrixFormatProvider
    • IMatrixFormatProvider
    • MatrixFormatProviderBase
    • MatrixFormatter
    • OctaveMatrixFormatProvider
  • Mars.Numerics.Ranges
    • ByteRange
    • DoubleRange
    • FloatRange
    • IntRange
    • IRange<T>
  • Mars.Numerics.Statistics
    • ConstValueDistribution<T>
    • Distribution<T>
    • FastGaussianDistributionD
    • FastGaussianDistributionF
    • IDistribution
    • UniformDiscreteDistribution
    • UniformDistributionD
    • UniformDistributionF
  • Mars.Numerics.Statistics.Base
    • BinarySearch
    • DistributionBase
    • ISampleableDistribution<TObservations>
    • IUnivariateDistribution
    • IUnivariateDistribution<TObservation>
    • UnivariateDiscreteDistribution

Class Distance

Static class Distance. Defines a set of methods defining distance measures.
Inheritance
System.Object
Distance
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: Mars.Numerics
Assembly: Mars.Numerics.dll
Syntax
public static class Distance

Methods

| Improve this Doc View Source

Chebyshev(Double[], Double[])

Gets the Chebyshev distance between two points.
Declaration
public static double Chebyshev(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x.
System.Double[] y The second point y.
Returns
Type Description
System.Double The Chebyshev distance between x and y.
Examples
For examples, please see Chebyshev documentation page. | Improve this Doc View Source

Cosine(Double[], Double[])

Gets the Cosine distance between two points.
Declaration
public static double Cosine(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x.
System.Double[] y The second point y.
Returns
Type Description
System.Double The Cosine distance between x and y.
Examples
For examples, please see Cosine documentation page. | Improve this Doc View Source

Euclidean(Double, Double, Double, Double)

Gets the Euclidean distance between two points.
Declaration
public static double Euclidean(double vector1X, double vector1Y, double vector2X, double vector2Y)
Parameters
Type Name Description
System.Double vector1X
System.Double vector1Y
System.Double vector2X
System.Double vector2Y
Returns
Type Description
System.Double The Euclidean distance between x and y.
Examples
For examples, please see Euclidean documentation page. | Improve this Doc View Source

Euclidean(Double[], Double[])

Gets the Euclidean distance between two points.
Declaration
public static double Euclidean(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x.
System.Double[] y The second point y.
Returns
Type Description
System.Double The Euclidean distance between x and y.
Examples
For examples, please see Euclidean documentation page. | Improve this Doc View Source

Haversine(Double, Double, Double, Double)

Gets the Haversine distance in meter between two geospatial points respecting the ellipsoid curve of the world.
Declaration
public static double Haversine(double x1, double y1, double x2, double y2)
Parameters
Type Name Description
System.Double x1 The longitude x coordinate of the source point .
System.Double y1 The latitude y coordinate of the source point .
System.Double x2 The longitude x coordinate of the target point .
System.Double y2 The latitude y coordinate of the target point .
Returns
Type Description
System.Double The Haversine distance between x and y in meter.
Examples
For examples, please see Haversine documentation page. | Improve this Doc View Source

Haversine(Double[], Double[])

Gets the Haversine distance in meter between two geospatial points respecting the ellipsoid curve of the world.
Declaration
public static double Haversine(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x/longitude.
System.Double[] y The second point y/latitude.
Returns
Type Description
System.Double The Haversine distance between x and y in meter.
Examples
For examples, please see Haversine documentation page. | Improve this Doc View Source

Levenshtein(String, String)

Gets the Levenshtein distance between two points.
Declaration
public static double Levenshtein(string x, string y)
Parameters
Type Name Description
System.String x The first point x.
System.String y The second point y.
Returns
Type Description
System.Double The Levenshtein distance between x and y.
Examples
For examples, please see Levenshtein(String, String) documentation page. | Improve this Doc View Source

Manhattan(Double[], Double[])

Gets the Manhattan distance between two points.
Declaration
public static double Manhattan(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x.
System.Double[] y The second point y.
Returns
Type Description
System.Double The Manhattan distance between x and y.
Examples
For examples, please see Manhattan documentation page. | Improve this Doc View Source

SquareEuclidean(Double, Double, Double, Double)

Gets the SquareEuclidean distance between two points.
Declaration
public static double SquareEuclidean(double x1, double y1, double x2, double y2)
Parameters
Type Name Description
System.Double x1
System.Double y1
System.Double x2
System.Double y2
Returns
Type Description
System.Double The SquareEuclidean distance between x and y.
Examples
For examples, please see SquareEuclidean documentation page. | Improve this Doc View Source

SquareEuclidean(Double[], Double[])

Gets the SquareEuclidean distance between two points.
Declaration
public static double SquareEuclidean(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x.
System.Double[] y The second point y.
Returns
Type Description
System.Double The SquareEuclidean distance between x and y.
Examples
For examples, please see SquareEuclidean documentation page. | Improve this Doc View Source

Vincenty(Double[], Double[])

Gets the Vincenty distance in meter between two geospatial points for high precision respecting the ellipsoid curve of the world with WGS83 projection.
Declaration
public static double Vincenty(double[] x, double[] y)
Parameters
Type Name Description
System.Double[] x The first point x/longitude.
System.Double[] y The second point y/latitude.
Returns
Type Description
System.Double The Vincenty distance approximation between x and y in meter.
Examples
For examples, please see Vincenty documentation page.
  • Improve this Doc
  • View Source
In This Article
Back to top Copyright © MARS GROUP. HAW Hamburg