This document is archived and information here might be outdated. Recommended version. |
Constructs all points of tangency to a curve from a point.
[Visual Basic .NET] Public Sub ConstructTangent ( _ ByVal inCurve As ICurve, _ ByVal p As IPoint _ )
[C#] public void ConstructTangent ( ICurve inCurve, IPoint p );
[C++]
HRESULT ConstructTangent(
ICurve* inCurve,
IPoint* p
);
Creates a Multipoint consisting of all points along the input Segment that are Tangent to the input Point.
Input must consist of a single segment and not polycurves.
private void ConstructTangent()
{
IPoint[] points=new IPoint[4];
for (int i=0; i < 4; i++)
{
points[i]=new PointClass();
}
points[0].PutCoords(150, 100);
points[1].PutCoords(200, 600);
points[2].PutCoords(400, 600);
points[3].PutCoords(450, 100);
IBezierCurveGEN bezierCurve=new BezierCurveClass();
bezierCurve.PutCoords(ref points);
IConstructMultipoint constructMultipoint=new MultipointClass();
constructMultipoint.ConstructTangent(bezierCurve as ICurve, points[1]);
IMultipoint multipoint=constructMultipoint as IMultipoint;
IPointCollection pointCollection=multipoint as IPointCollection;
//Report the points
for (int i=0; i < pointCollection.PointCount; i++)
{
System.Windows.Forms.MessageBox.Show("Point : " + pointCollection.get_Point(i).X + " , " + pointCollection.get_Point(i).Y);
}
}
Private Sub ConstructTangent()
Dim pTcoll As ESRI.ArcGIS.Geometry.IPointCollection
Dim pConstructMultipoint As ESRI.ArcGIS.Geometry.IConstructMultipoint
Dim pMultipoint As ESRI.ArcGIS.Geometry.IMultipoint
Dim i As Long
Dim pBezier As ESRI.ArcGIS.Geometry.IBezierCurve
Dim pPtCon(0 To 3) As ESRI.ArcGIS.Geometry.IPoint
For i=0 To 3
pPtCon(i)=New ESRI.ArcGIS.Geometry.Point
Next
pPtCon(0).PutCoords(150, 100)
pPtCon(1).PutCoords(200, 600)
pPtCon(2).PutCoords(400, 600)
pPtCon(3).PutCoords(450, 100)
pBezier=New ESRI.ArcGIS.Geometry.BezierCurve
pBezier.PutCoords(4, pPtCon(0))
pConstructMultipoint=New ESRI.ArcGIS.Geometry.Multipoint
pConstructMultipoint.ConstructTangent(pBezier, pPtCon(0))
pMultipoint=pConstructMultipoint
pTcoll=pMultipoint
Debug.Print("*********************************************")
Debug.Print(" Report the points")
Debug.Print("*********************************************")
For i=0 To pTcoll.PointCount - 1
Debug.Print("Point : " & pTcoll.Point(i).X & " , " & pTcoll.Point(i).Y)
Next
End Sub