This document is archived and information here might be outdated.  Recommended version.

IMap.ComputeDistance Method (ArcObjects .NET 10.7 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Carto > ESRI.ArcGIS.Carto > Interfaces > IM > IMap Interface > IMap.ComputeDistance Method
ArcGIS Developer Help

IMap.ComputeDistance Method

Computes the distance between two points on the map and returns the result.

[Visual Basic .NET]
Public Function ComputeDistance ( _
    ByVal p1 As IPoint, _
    ByVal p2 As IPoint _
) As Double
public double ComputeDistance (
    IPoint p1,
    IPoint p2
HRESULT ComputeDistance(
  IPoint* p1,
  IPoint* p2
p1 [in]

p1 is a parameter of type IPoint* p2 [in]
p2 is a parameter of type IPoint*

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.


ComputeDistance computes and returns the distance between two input points.  This method calculates the distance based on the current map units (IMap::MapUnits) and reports the distance using the current distance units (IMap::DistanceUnits).

See Also

IMap Interface | IMap.MapUnits Property | IMap.DistanceUnits Property