IConstructAngle Interface

Provides access to members that construct an angle using other geometries and measures. This interface is implemented by the GeometryEnvironment object.

Description

ConstructAngle returns the angle formed either by three input points used to define the angle or an input line (and the implied baseline). The constructed angle is returned in radians and is always between -Pi and Pi.

Members

Name Description
Method ConstructLine Constructs the angle between the infinite line containing the input line segment and the positive x-axis.
Method ConstructThreePoint Constructs the angle included in three points.

IConstructAngle.ConstructLine Method

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

Public Function ConstructLine ( _
    ByVal inLine As ILine _
) As Double
public double ConstructLine (
    ILine inLine
);

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

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

IConstructAngle.ConstructThreePoint Method

Constructs the angle included in three points.

Public Function ConstructThreePoint ( _
    ByVal from As IPoint, _
    ByVal through As IPoint, _
    ByVal to As IPoint _
) As Double
public double ConstructThreePoint (
    IPoint from,
    IPoint through,
    IPoint to
);

Description

ConstructThreePoint returns the Angle formed by three input points. The returned angle is the smaller angle formed by an imaginary line from the first to the second point and the second to the third point. The measure of the constructed angle is between -Pi and Pi. The returned angle can also be thought of as the displacement angle of a line from the second point to the third point with a baseline formed by the first point and second point.

Remarks

ConstructAngle ConstructThreePoint Example

// Calculates the angle defined by the 3 points.

public void constructAngle()

{

    IPoint fromPoint = new ESRI.ArcGIS.Geometry.Point();

    IPoint throughPoint = new ESRI.ArcGIS.Geometry.Point();

    IPoint toPoint = new ESRI.ArcGIS.Geometry.Point();

    fromPoint.PutCoords(1, 0);

    toPoint.PutCoords(1, 1);

    throughPoint.PutCoords(0, 0);

    GeometryEnvironment geometryEnvironment = new GeometryEnvironment();

    IConstructAngle constructAngle = geometryEnvironment as IConstructAngle;

    double angle = constructAngle.ConstructThreePoint(fromPoint, throughPoint, toPoint);

    System.Windows.Forms.MessageBox.Show("The constructed angle is " + angle);

}
' Calculates the angle defined by the 3 points.

    Public Sub t_construct_angle()

        Dim pPtFrom As IPoint

        Dim pPtThrough As IPoint

        Dim pPtTo As IPoint

        pPtFrom = New Point

        pPtThrough = New Point

        pPtTo = New Point

        pPtFrom.PutCoords(1, 0)

        pPtTo.PutCoords(1, 1)

        pPtThrough.PutCoords(0, 0)

        Dim pCAngle As IConstructAngle

        Dim pGEnv As GeometryEnvironment

        pGEnv = New GeometryEnvironment

        pCAngle = pGEnv

        Dim dAngle As Double

        dAngle = pCAngle.ConstructThreePoint(pPtFrom, pPtThrough, pPtTo)

        MsgBox("The constructed angle is " & dAngle)

    End Sub

Classes that implement IConstructAngle

Classes Description
GeometryEnvironment Provides a way of creating geometries from different inputs and setting/getting global variables for controlling behavior of geometry methods.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.