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


IVector3D.ConstructDifference Method (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geometry > ESRI.ArcGIS.Geometry > Interfaces > IV > IVector3D Interface > IVector3D.ConstructDifference Method
ArcGIS Developer Help

IVector3D.ConstructDifference Method

Set the vector by taking the difference of point1 and point2 (so the vector would go from point2 to point1).

[Visual Basic .NET]
Public Sub ConstructDifference ( _
    ByVal point1 As IPoint, _
    ByVal point2 As IPoint _
)
[C#]
public void ConstructDifference (
    IPoint point1,
    IPoint point2
);
[C++]
HRESULT ConstructDifference(
  IPoint* point1,
  IPoint* point2
);
[C++]
Parameters
point1 

point1 is a parameter of type IPoint* point2
point2 is a parameter of type IPoint*

Product Availability

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

Description

Constructs a Vector3D defined by the difference between the first point and the second point.  The first point and the Origin define a Vector3D, and the Origin and the second point define a second Vector3D.  Thus, the constructed difference Vector3D is the Constructed Subtract Vector between the first vector and the second vector.

Remarks

 

IVector3D ConstructDifference Example

[C#]

    public IVector3D CreateVector3DTwoPoints(IPoint fromPoint, IPoint toPoint)
    {
        if (fromPoint.Z.Equals(Double.NaN))
        {
            fromPoint.Z = 0;
        }
        if (toPoint.Z.Equals(Double.NaN))
        {
            toPoint.Z = 0;
        }
        IVector3D vector3D = new Vector3DClass();
        vector3D.ConstructDifference(fromPoint, toPoint);
        return vector3D;
    }

See Also

IVector3D Interface