ArcObjects Library Reference (Geometry)  

IConstructAngle.ConstructThreePoint Method

Constructs the angle included in three points.

[Visual Basic .NET]
Public Function ConstructThreePoint ( _
    ByVal from As IPoint, _
    ByVal through As IPoint, _
    ByVal to As IPoint _
) As Double
[C#]
public double ConstructThreePoint (
    IPoint from,
    IPoint through,
    IPoint to
);
[C++]
HRESULT ConstructThreePoint(
  IPoint* from,
  IPoint* through,
  IPoint* to,
  double* outAngle
);
[C++]

Parameters

from

  from is a parameter of type IPoint

through

  through is a parameter of type IPoint

to

  to is a parameter of type IPoint

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

Product Availability

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

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

[C#]
// 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);
}
[Visual Basic .NET]

   ' 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

See Also

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