ArcGIS Enterprise SDK
ICurve.QueryPointAndDistance Method
ArcGIS Developer Help

ICurve.QueryPointAndDistance Method

Finds the point on the curve closest to inPoint, then copies that point to outPoint; optionally calculates related items.

[Visual Basic .NET]
Public Sub QueryPointAndDistance ( _
    ByVal extension As esriSegmentExtension, _
    ByVal inPoint As IPoint, _
    ByVal asRatio As Boolean, _
    ByVal outPoint As IPoint, _
    ByRef DistanceAlongCurve As Double, _
    ByRef distanceFromCurve As Double, _
    ByRef bRightSide As Boolean _
)
[C#]
public void QueryPointAndDistance (
    esriSegmentExtension extension,
    IPoint inPoint,
    bool asRatio,
    IPoint outPoint,
    ref double DistanceAlongCurve,
    ref double distanceFromCurve,
    ref bool bRightSide
);

Description

Finds the Point on the specified extended curve nearest to the input point and the distance between those points.  Also returns information about the side of the curve the input point is on as well as the distance along the curve that the nearest point occurs.

Remarks

AsRatio is an input parameter that only affects the DistanceAlongCurve

distanceFromCurve is an output parameter that represents the minimum distance between the curve and the input point.

DistanceAlongCurve is an output parameter that represents the distance between the Frompoint of the input curve and the returned point on the curve.

bRightSide is an output parameter that tells if the input point is on the right side of the curve. The direction of the curve determines the right and left sides.

Note: The output geometry must be co-created prior to the query. The output geometry is not co-created by the method; it is populated. This can be used in performance critical situations. For example, creating the geometry only once outside a loop and use the query method could improve performance.

QueryPointAndDistance Example

See Also

ICurve Interface