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


IConstructAngle.ConstructLine Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Geometry)  

IConstructAngle.ConstructLine Method

Constructs the angle between the infinite line containing the input line segment and the positive x-axis.

[Visual Basic .NET]
Public Function ConstructLine ( _
    ByVal inLine As ILine _
) As Double
[C#]
public double ConstructLine (
    ILine inLine
);
[C++]
HRESULT ConstructLine(
  ILine* inLine,
  double* outAngle
);
[C++]

Parameters inLine
inLine is a parameter of type ILine outAngle [out, retval] outAngle is a parameter of type double

Product Availability

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

Description

ConstructLine returns the Angle defined by a given Line input.  This is the same Angle returned by the ILine::Angle method.  The Angle is displacement of the Line from a baseline through the From Point extending in the positive X direction.  The returned angle is the smaller angle with measure between -Pi and Pi.

Remarks

IConstructAngle ConstructLine Example
[Visual Basic .NET]

Private Shared Sub constructLine()

     Dim pPtFrom As IPoint

     Dim pPtTo As IPoint

     pPtFrom = New Point

     pPtTo = New Point

     Dim pLine As ILine

     pLine = New Line

     pPtFrom.PutCoords(0, 0)

     pPtTo.PutCoords(1, 1)

     pLine.PutCoords(pPtFrom, pPtTo)

     Dim pCAngle As IConstructAngle

     Dim pGEnv As GeometryEnvironment

     pGEnv = New GeometryEnvironment

     pCAngle=pGEnv

     Dim dAngle As Double

     dAngle=pCAngle.ConstructLine(pLine)

     MsgBox("The angle from the x-axis to the line is " & dAngle)

End Sub

See Also

IConstructAngle Interface | IConstructAngle.ConstructThreePoint Method | IConstructAngle.ConstructLine Method