This document is archived and information here might be outdated. Recommended version. |
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*
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.
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;
}