This document is archived and information here might be outdated. Recommended version. |
Constructs an arc from a center point, a starting point, and an tangent length.
[Visual Basic .NET] Public Sub ConstructTangentDistance ( _ ByVal Center As IPoint, _ ByVal from As IPoint, _ ByVal isCCW As Boolean, _ ByVal tangentDistance As Double _ )
[C#] public void ConstructTangentDistance ( IPoint Center, IPoint from, bool isCCW, double tangentDistance );
[C++]
HRESULT ConstructTangentDistance(
IPoint* Center,
IPoint* from,
VARIANT_BOOL isCCW,
double tangentDistance
);
[C++] Parameters Center
Center is a parameter of type IPoint* from
from is a parameter of type IPoint* isCCW
isCCW is a parameter of type bool tangentDistance
tangentDistance is a parameter of type double
Constructs a CircularArc given the Center Point, From Point, the desired orientation, and the desired Tangent Distance.
-isCCW stands for "is counter clockwise"
private void ConstructTangentDistance() { IConstructCircularArc constructCircularArc = new CircularArcClass(); ICircularArc circularArc = constructCircularArc as ICircularArc; IPoint fromPoint = new PointClass(); IPoint toPoint = new PointClass(); fromPoint.PutCoords(100, 100); toPoint.PutCoords(50, 50); constructCircularArc.ConstructTangentDistance(fromPoint, toPoint, true, 100000000); String report = "Length : " + circularArc.Length + "\n" + "Radius : " + circularArc.Radius + "\n" + "Chord Height : " + circularArc.ChordHeight + "\n" + "Central Angle (Rad) : " + circularArc.CentralAngle + "\n" + "From Angle (Rad) : " + circularArc.FromAngle + "\n" + "To Angle (Rad) : " + circularArc.ToAngle + "\n" + "Center Point : " + circularArc.CenterPoint.X + " , " + circularArc.CenterPoint.Y + "\n" + "From Point : " + circularArc.FromPoint.X + " , " + circularArc.FromPoint.Y + "\n" + "To Point : " + circularArc.ToPoint.X + " , " + circularArc.ToPoint.Y; System.Windows.Forms.MessageBox.Show(report); }
Private Sub ConstructTangentDistance()
Dim pConstructCircularArc As ESRI.ArcGIS.Geometry.IConstructCircularArc
Dim pCArc As ESRI.ArcGIS.Geometry.ICircularArc
Dim Pi As Double
Dim pCenterPoint As ESRI.ArcGIS.Geometry.IPoint
Dim pStartPoint As ESRI.ArcGIS.Geometry.IPoint
pConstructCircularArc = New ESRI.ArcGIS.Geometry.CircularArc
pCArc = pConstructCircularArc
Pi = 4 * Math.Atan(1) 'Calculate the value of pi.
pCenterPoint = New ESRI.ArcGIS.Geometry.Point
pStartPoint = New ESRI.ArcGIS.Geometry.Point
pCenterPoint.PutCoords(200, 100)
pStartPoint.PutCoords(100, 100)
'The angles should be in Radians (Radians = Degrees * PI/180)
pConstructCircularArc.ConstructTangentDistance(pCenterPoint, pStartPoint, True, 100000000)
Debug.Print("Length : " & pCArc.Length)
Debug.Print("Radius : " & pCArc.Radius)
Debug.Print("Chord Height : " & pCArc.ChordHeight)
Debug.Print("Central Angle (Rad) : " & pCArc.CentralAngle)
Debug.Print("From Angle (Rad) : " & pCArc.FromAngle)
Debug.Print("To Angle (Rad) : " & pCArc.ToAngle)
Debug.Print("Center Point : " & pCArc.CenterPoint.X & " , " & pCArc.CenterPoint.Y)
Debug.Print("From Point : " & pCArc.FromPoint.X & " , " & pCArc.FromPoint.Y)
Debug.Print("To Point : " & pCArc.ToPoint.X & " , " & pCArc.ToPoint.Y)
End Sub
IConstructCircularArc Interface | IConstructCircularArc.ConstructTangentDistance Method | IConstructCircularArc.ConstructArcDistance Method | IConstructCircularArc.ConstructChordDistance Method