Interface IConstructPoint

Namespace
ESRI.ArcGIS.Geometry
Assembly
ESRI.Server.Geometry.dll

Provides access to members that construct a point using other geometries and measures.

[Guid("EAF5D48C-C666-11D0-8307-0000F8034032")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IConstructPoint

Methods

ConstructAlong(ICurve, esriSegmentExtension, double, bool)

Constructs a point distance units along the input curve.

void ConstructAlong(ICurve curve, esriSegmentExtension extension, double distance, bool asRatio)

Parameters

curve ICurve
extension esriSegmentExtension
distance double
asRatio bool

Remarks

If the Distance parameter is less than zero, or greater than the length of the curve (when asRatio is false), or greater than one (when asRatio is true), then the value of the Extension parameter is used to determine the coordinates of the constructed point.  In these cases, the point can be placed somewhere along an embedding geometry, or somewhere along a tangent geometry.

The embedding geometry of a straight line segment is a straight line extending infinitely in both directions.  The embedding geometry of a circular arc is a complete circle.  The embedding geometry of an elliptic arc is a complete ellipse.  A bezier curve has no embedding geometry.

A tangent geometry is always a ray (a straight line extending infinitely in one direction) tangent to the input curve at either its from (start) or to (end) points.

Possible values for the Extension parameter are: 
-------------------------------------------------

esriNoExtension                      The constructed point will always be on the input curve.  A distance < 0 will pin the constructed point to the location of the input curve's from point. A distance > the curve length (or > 1 when asRatio is true) will pin the location to the curve's to point.

esriExtendTangentAtFrom        If the distance parameter is < 0 then the point is constructed along a ray tangent to the start point of the curve, in a direction away from the curve.

esriExtendTangentAtTo            If the distance parameter is greater than the length of the input curve (or > 1 when asRatio is true), then the constructed point is placed along a ray tangent to the end point of the curve, in a direction away from the curve.

esriExtendEmbeddedAtFrom   Similar to the tangent option, but uses the embedding geometry instead of the tangent lines.

esriExtendEmbeddedAtTo        Similar to the tangent option, but uses the embedding geometry instead of the tangent lines.

esriExtendEmbedded               The point is constructed based on either the start or end points of the curve.

esriExtendTangents                  The point is tangential extended from the start or endpoint of the curve.

These values can be combined using the VB Or operator, or the C++ bitwise OR operator.

Example 1: 

esriExtendTangentAtFrom Or
esriExtendTangentAtTo

Instead of using

esriExtendTangents
 you could use
esriExtendTangentAtFrom Or
esriExtendTangentAtTo.
This would allow the point to be constructed anywhere along infinte straight lines, beginning from either the start or end of the curve, regardless of whether the distance parameter was less than 0, or greater than the length of the input curve (or > 1 when asRatio is true).


ConstructPoint ConstructAlong Example



[C#]

        //Select a polyline in ArcMap and calculate a point along the line
        // at 100 distance units from the start point.
        public void ConstructPointAlongLine(IPolyline pl)
        {

ICurve polyLine = pl;

IPoint point1 = ConstructPointAlong(100, polyLine, esriSegmentExtension.esriNoExtension, false);

System.Windows.Forms.MessageBox.Show("x,y = " + point1.X + "," + point1.Y);

IPoint point2 = ConstructPointAlong(0.5, polyLine, esriSegmentExtension.esriNoExtension, true);

System.Windows.Forms.MessageBox.Show("x,y = " + point2.X + "," + point2.Y);
}









        public IPoint ConstructPointAlong(double distance, ICurve curve, esriSegmentExtension extension, bool asRatio)
        {

IConstructPoint contructionPoint = new PointClass();

contructionPoint.ConstructAlong(curve, extension, distance, asRatio);

return contructionPoint as IPoint;
}






[Visual Basic .NET]

    '+++ Calculate a point along a polyline
    '+++ at 100 distance units from the start point.

    Public Sub t_ConstructAlong(ByRef pPolyLine As ESRI.ArcGIS.Geometry.IPolyline)
        On Error GoTo Errorhandler
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint

        Dim pCrv As ESRI.ArcGIS.Geometry.ICurve
        pCrv = pPolyLine
        pPoint = PtConstructAlong(100, pCrv, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, False)
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)


        pPoint = PtConstructAlong(0.5, pPolyLine, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, True) ' Midpoint
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)

        Exit Sub

Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub

    End Sub

    Public Function PtConstructAlong(ByVal dDist As Double, ByVal pCurve As ESRI.ArcGIS.Geometry.ICurve, ByVal extension As ESRI.ArcGIS.Geometry.esriSegmentExtension, ByVal asRatio As Boolean) As ESRI.ArcGIS.Geometry.IPoint
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point

pCPoint.ConstructAlong(pCurve, extension, dDist, asRatio)
PtConstructAlong = pCPoint
End Function





ConstructAngleBisector(IPoint, IPoint, IPoint, double, bool)

Constructs a point on the bisector of the angle (from, through, to). When useAcuteAngle is false, the sign of distance will select a point right or left of (from, through, to). Otherwise, the sign of distance will select the acute/obtuse point.

void ConstructAngleBisector(IPoint from, IPoint through, IPoint to, double distance, bool useAcuteAngle)

Parameters

from IPoint
through IPoint
to IPoint
distance double
useAcuteAngle bool

Remarks


The method uses a vector geometry to calculate the point. The Smaller Angle is the angle less than PI.

If From , To and Through points are all on a straight line , the point is calculated perpendicular (to the right) of the line.



Construct Angle Bisector

[C#]

        private void ConstructAngleBisector()
        {
            IPoint fromPoint = new PointClass();
            fromPoint.PutCoords(0, 0);
            IPoint throughPoint = new PointClass();
            throughPoint.PutCoords(10, 0);
            IPoint toPoint = new PointClass();
            toPoint.PutCoords(0, 10);
            IConstructPoint constructionPoint = new PointClass();
            constructionPoint.ConstructAngleBisector(fromPoint, throughPoint, toPoint, 10, true);
            IPoint outPutPoint = constructionPoint as IPoint;
            System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint.X + " , " + outPutPoint.Y);
        }












[Visual Basic .NET]

   Public Sub ConstructAngleBisector()
        Dim ptTr As ESRI.ArcGIS.Geometry.IPoint
        Dim ptTo As ESRI.ArcGIS.Geometry.IPoint
        Dim ptFrom As ESRI.ArcGIS.Geometry.IPoint
        Dim pConstructLine As ESRI.ArcGIS.Geometry.IConstructLine
        Dim pOutPutLine As ESRI.ArcGIS.Geometry.ILine
        Dim Pi As Double
        Pi = 4 * Math.Atan(1)
        ptTr = New ESRI.ArcGIS.Geometry.Point
        ptTo = New ESRI.ArcGIS.Geometry.Point
        ptFrom = New ESRI.ArcGIS.Geometry.Point
        pConstructLine = New ESRI.ArcGIS.Geometry.Line
        ptTr.PutCoords(0, 0)
        ptTo.PutCoords(0, 10)
        ptFrom.PutCoords(10, 0)
        pConstructLine.ConstructAngleBisector(ptFrom, ptTr, ptTo, 10, True)
        pOutPutLine = pConstructLine 'QI
        Debug.Print(pOutPutLine.Length)
        'Angle from the XAxis
        Debug.Print((180 * pOutPutLine.Angle) / Pi)
    End Sub




















ConstructAngleDistance(IPoint, double, double)

Constructs a point at a specified angle (in radians) from the horizontal axis and a specified distance away from the input point.

void ConstructAngleDistance(IPoint p, double inAngle, double distance)

Parameters

p IPoint
inAngle double
distance double

Remarks

Angle in radians and distance in map units. The angle is measured counter-clockwise from the horizontal line and can be negative. If the distance is negative then the opposite direction is assumed (same as angle + PI). 

[C#]

        // select a point in ArcMap and calculate a new point with the
        // angle of 45 degrees and distance on 250 map units.
        public void ConstructAngleDistance()
        {
            IMxDocument mxDocument = m_application.Document as IMxDocument;
            IMap map = mxDocument.FocusMap;
            ISelection featureSelection = map.FeatureSelection;
            IEnumFeature featureEnumerator = featureSelection as IEnumFeature;
            featureEnumerator.Reset();
            IFeature currentFeature = featureEnumerator.Next();
            double distance = 250;
            double angle = 45;
            while (currentFeature != null)
            {
                if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
                {
                    IPoint startPoint = currentFeature.Shape as IPoint;
                    System.Windows.Forms.MessageBox.Show("Start Point: " + startPoint.X + ", " + startPoint.Y + "\n" +
                               "Angle: " + angle + "\n" + "Distance: " + distance);
                    IPoint point = _ConstructAngleDistance(startPoint, angle, distance);
                    System.Windows.Forms.MessageBox.Show("x,y = " + point.X + "," + point.Y);



















                }
                currentFeature = featureEnumerator.Next();
            }
        }


        private IPoint _ConstructAngleDistance(IPoint point, double angle, double distance)
        {
            //Convert the angle degrees to radians
            double angleRad = angle * 2 * Math.PI / 360;
            IConstructPoint construcionPoint = new PointClass();
            construcionPoint.ConstructAngleDistance(point, angleRad, distance);
            return construcionPoint as IPoint;
        }







[Visual Basic .NET]

    '+++ select a point in ArcMap and calculate a new point with the
    '+++ angle of 45 degrees and distance on 100 map units.

    Public Sub t_ConstructAngleDistance(ByRef pMXDoc As ESRI.ArcGIS.ArcMapUI.IMxDocument)
        On Error GoTo Errorhandler
        Dim pEnumFeat As ESRI.ArcGIS.Geodatabase.IEnumFeature
        Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
        Dim pSelection As ESRI.ArcGIS.Carto.ISelection
        Dim pMap As ESRI.ArcGIS.Carto.IMap
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pStart As ESRI.ArcGIS.Geometry.IPoint
        Dim dDist As Long
        Dim dAngle As Long








        pMap = pMXDoc.FocusMap

        pSelection = pMap.FeatureSelection
        pEnumFeat = pSelection

        pEnumFeat.Reset()
        pFeature = pEnumFeat.Next

        dDist = 250
        dAngle = 45

        While Not pFeature Is Nothing
            If pFeature.Shape.GeometryType = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPoint Then
                pStart = pFeature.Shape
                Debug.Print(1, "Start Point:" & pStart.X & "," & pStart.Y & vbCrLf & _
                   "Angle:" & dAngle & vbCrLf & "Distance:" & dDist)



                pPoint = PtConstructAngleDistance(pStart, dAngle, dDist)
                Debug.Print(1, "x,y = " & pPoint.X & "," & pPoint.Y & vbCrLf)

            End If
            pFeature = pEnumFeat.Next
        End While
        Exit Sub


Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub

    End Sub

    Public Function PtConstructAngleDistance(ByVal pPoint As ESRI.ArcGIS.Geometry.IPoint, ByVal dAngle As Long, ByVal dDist As Long) As ESRI.ArcGIS.Geometry.IPoint
        Const PI = 3.14159265358979
        Dim dAngleRad As Double
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point



        dAngleRad = dAngle * 2 * PI / 360 'Convert the angle degrees to radians

        pCPoint.ConstructAngleDistance(pPoint, dAngleRad, dDist)
        PtConstructAngleDistance = pCPoint
    End Function


ConstructAngleIntersection(IPoint, double, IPoint, double)

Constructs the point of intersection between two lines defined by the input points and angles (in radians).

void ConstructAngleIntersection(IPoint p1, double angle1, IPoint p2, double angle2)

Parameters

p1 IPoint
angle1 double
p2 IPoint
angle2 double

Remarks


Angles are specified as geometric angles measured counterclockwise from the positive x axis of the Cartesian coordinate system. All angles are specified in radians .

ConstructAngleIntersection Example


[C#]

        //This method constructs a new point as intersection of 2 lines
        public void ConstructAngleIntersection()
        {
            IPoint fromPoint = new PointClass();
            fromPoint.PutCoords(0, 0);
            IPoint toPoint = new PointClass();
            toPoint.PutCoords(100, 0);
            double angle1Rad = 45 * 2 * Math.PI / 360;
            double angle2Rad = 135 * 2 * Math.PI / 360;
            IConstructPoint constructionPoint = new PointClass();
            constructionPoint.ConstructAngleIntersection(fromPoint, angle1Rad, toPoint, angle2Rad);
            IPoint outPutPoint = constructionPoint as IPoint;
            System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint.X + " , " + outPutPoint.Y);
        }













[Visual Basic .NET]

    '+++ Construct a new point as intersection of 2 lines

    Public Sub t_ConstructAngleIntersection()
        On Error GoTo Errorhandler
        Dim pPoint1 As ESRI.ArcGIS.Geometry.IPoint
        Dim pPoint2 As ESRI.ArcGIS.Geometry.IPoint
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim dAngle1 As Long
        Dim dAngle2 As Long





        pPoint1 = New ESRI.ArcGIS.Geometry.Point
        pPoint2 = New ESRI.ArcGIS.Geometry.Point

        pPoint1.PutCoords(0, 0)
        pPoint2.PutCoords(100, 0)

        dAngle1 = 45
        dAngle2 = 135

        pPoint = ptConstructAngleIntersection(pPoint1, dAngle1, pPoint2, dAngle2)
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)
        Exit Sub

Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub

    End Sub

    Public Function ptConstructAngleIntersection(ByVal pPt1 As ESRI.ArcGIS.Geometry.IPoint, ByVal dAngle1 As Long, ByVal pPt2 As ESRI.ArcGIS.Geometry.IPoint, ByVal dAngle2 As Long) As ESRI.ArcGIS.Geometry.IPoint
        Const PI As Double = 3.14159265358979
        Dim dAngleRad1 As Double
        Dim dAngleRad2 As Double


        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point

        dAngleRad1 = dAngle1 * 2 * PI / 360 ' Conversion degrees to radians
        dAngleRad2 = dAngle2 * 2 * PI / 360

        pCPoint.ConstructAngleIntersection(pPt1, dAngleRad1, pPt2, dAngleRad2)
        ptConstructAngleIntersection = pCPoint
    End Function


ConstructDeflection(ILine, double, double)

Constructs a point in the polar coordinate system defined by baseLine and its 'from' point. The angle is in radians.

void ConstructDeflection(ILine baseLine, double distance, double inAngle)

Parameters

baseLine ILine
distance double
inAngle double

Remarks

The point is constructed from the baseline start point using the deflection angle (the angle from the baseline to the point) and the distance. The deflection angle is given in radians the distance in map units. When distance is > 0, a positive value for angle rotates the constructed point counter-clockwise about the start point of baseline, and a negative value for angle rotates it the other way. Vice versa when distance is < 0.
ConstructDeflection Example
[C#]

//Constructs a point from the baseline from (0,0) to (1,1)
// with the deflection angle of 45 degrees (PI/4 radians).

public void ConstructDeflection()
{
    IPoint fromPoint = new PointClass();
    fromPoint.PutCoords(0, 0);
    IPoint toPoint = new PointClass();
    toPoint.PutCoords(1, 1);
    ILine line = new LineClass();
    line.PutCoords(fromPoint, toPoint);
    double distance = 1.4142135623731;
    double angle = Math.PI / 4;
    IConstructPoint constructionPoint = new PointClass();
    constructionPoint.ConstructDeflection(line, distance, angle);
    IPoint point = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("x,y = " + point.X + ", " + point.Y);
}













[Visual Basic .NET]

    '+++ Constructs a point from the baseline from (0,0) to (1,1)
    '+++ with the deflection angle of 45 degrees (PI/4 radians).
    Public Sub t_ConstructDeflection()
        On Error GoTo Errorhandler
        Dim pPointFrom As IPoint
        Dim pPointTo As IPoint
        Dim pLine As ILine
        Dim pPoint As IPoint
        Dim pCPoint As IConstructPoint
        Dim dDist As Double
        Dim dAngle As Double
        Dim pi As Double










        pPointFrom = New Point
        pPointTo = New Point
        pCPoint = New Point
        pPoint = New Point
        pLine = New Line



        pPointFrom.PutCoords(0, 0)
        pPointTo.PutCoords(1, 1)
        pLine.PutCoords(pPointFrom, pPointTo)

        dDist = 1.4142135623731
        pi = 4 * Math.Atan(1)
        dAngle = pi / 4
        pCPoint.ConstructDeflection(pLine, dDist, dAngle)
        pPoint = pCPoint
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)
        Exit Sub





Errorhandler:
        MsgBox(Err.Number & "..." & Err.Description)
        Exit Sub
    End Sub


ConstructDeflectionIntersection(ILine, double, double, bool)

Constructs the point of intersection of two rays with origins at the endpoints of the base line and the specified angles (in radians). If onRightSide is true, this work will be done to the right of the base line, otherwise to the left.

void ConstructDeflectionIntersection(ILine baseLine, double startAngle, double endAngle, bool OnRightSide)

Parameters

baseLine ILine
startAngle double
endAngle double
OnRightSide bool

Remarks


the bRightSide flag can be used to always force the constructed point to be on the right side of the baseline.

The startAngle is the angle (in radians) from the baseline's startpoint of the line to the constructed point. The endAngle is the angle (in radians) from the baseline's endpoint to the constructed point.

Both angles have to be > 0 and < 2 PI radians. Their sum must also be less than PI radians.

ConstructDeflectionIntersection Example






[C#]
//Constructs a point from the baseline from (0,0) to (1,1)
//with the deflection angle of 45 degrees (PI/4 radians).
public void ConstructDeflectionIntersection()
{
  IPoint fromPoint = new PointClass();
  fromPoint.PutCoords(0, 0);
  IPoint toPoint = new PointClass();
  toPoint.PutCoords(1, 1);
  ILine line = new LineClass();
  line.PutCoords(fromPoint, toPoint);
  double startAngle = Math.PI / 4;
  double endAngle = Math.PI / 4;
  IConstructPoint constructionPoint = new PointClass();
  constructionPoint.ConstructDeflectionIntersection(line, startAngle, endAngle, false);
  IPoint point = constructionPoint as IPoint;
  System.Windows.Forms.MessageBox.Show("x,y = " + point.X + ", " + point.Y);

}
[Visual Basic .NET]

    '+++ Constructs a point as the intersection of 2 lines with angles
    '+++ dStartAngle (from the startpoint of the line) and dEndAngle.
    '+++ The flag to force the line to the right side is turned off.

    Public Sub t_ConstructDeflectionIntersection()
        Dim pPointFrom As ESRI.ArcGIS.Geometry.IPoint
        Dim pPointTo As ESRI.ArcGIS.Geometry.IPoint
        Dim pLine As ESRI.ArcGIS.Geometry.ILine
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        Dim dStartAngle As Double
        Dim dEndAngle As Double
        Dim pi As Double







        pPointFrom = New ESRI.ArcGIS.Geometry.Point
        pPointTo = New ESRI.ArcGIS.Geometry.Point
        pCPoint = New ESRI.ArcGIS.Geometry.Point
        pPoint = New ESRI.ArcGIS.Geometry.Point
        pLine = New ESRI.ArcGIS.Geometry.Line



        pPointFrom.PutCoords(0, 0)
        pPointTo.PutCoords(1, 0)

pLine.PutCoords(pPointFrom, pPointTo)

        pi = 4 * Math.Atan(1)
        dStartAngle = pi / 4
        dEndAngle = pi / 4

        pCPoint.ConstructDeflectionIntersection(pLine, dStartAngle, dEndAngle, False)
        pPoint = pCPoint
        MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)

    End Sub

ConstructOffset(ICurve, esriSegmentExtension, double, bool, double)

Constructs a point distance units along the input curve and offset units perpendicularly away from it.

void ConstructOffset(ICurve curve, esriSegmentExtension extension, double distance, bool asRatio, double Offset)

Parameters

curve ICurve
extension esriSegmentExtension
distance double
asRatio bool
Offset double

Remarks

A positive Offset distance will create a point on the right side of the curve and a negative offset will create a point on the left side of the curve.

ConstructPoint ConstructOffset Example

Set the asRatio flag to be True if you want the distance to be a ratio of the curve length. If set to True, then a distance of 0.5 will be equal to half of the curve length (i.e. 50%).






[C#]

//This example demonstrates how to use IConstructPoint.ConstructOffset method
private void ConstructOffset()
{
    IPoint[] points = new IPoint[4];
    for (int i = 0; i < 4; i++)
    {
        points[i] = new PointClass();
    }
    points[0].PutCoords(0, 0);
    points[1].PutCoords(10, 0);
    points[2].PutCoords(20, 0);
    points[3].PutCoords(30, 0);
    IPointCollection polyline = new Polyline();
    //helper class to solve C-Style Array usage in COM classes
    IGeometryBridge geometryBride = new GeometryEnvironmentClass();
    geometryBride.AddPoints(polyline as IPointCollection4, ref points);














    IConstructPoint constructionPoint = new PointClass();
    //The spatial reference should be set on the new point here (Code skipped)

    //Example 1: Distance No ratio, Positive offset
    constructionPoint.ConstructOffset(polyline as ICurve, esriSegmentExtension.esriNoExtension, 15, false, 5);
    IPoint outPutPoint1 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint1.X + " , " + outPutPoint1.Y);
    //Output point : 15 , -5 
    //*********************************************
    //Example 2: Distance as ratio, Positive offset
    constructionPoint.ConstructOffset(polyline as ICurve, esriSegmentExtension.esriNoExtension, 0.5, true, 5);
    IPoint outPutPoint2 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint2.X + " , " + outPutPoint2.Y);
    //Output point : 15 , -5 
    //*********************************************
    //Example 3: Distance No ratio, Negative offset
    constructionPoint.ConstructOffset(polyline as ICurve, esriSegmentExtension.esriNoExtension, 15, false, -5);
    IPoint outPutPoint3 = constructionPoint as IPoint;
    System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint3.X + " , " + outPutPoint3.Y);
    //Output point : 15 , 5
}
















[Visual Basic .NET]

   'This example demonstrates how to use IConstructPoint::ConstructOffset
    Sub ConstructOffset()
        Dim ptc As IPointCollection, pt(3) As IPoint, i As Long
        Dim pconsPoint As IConstructPoint, ptout As IPoint
        ptc = New Polyline
        'The spatial reference should be set on the polyline here (Code skipped)
        For i = 0 To 3
            pt(i) = New Point
        Next
        pt(0).PutCoords(0, 0)
        pt(1).PutCoords(10, 0)
        pt(2).PutCoords(20, 0)
        pt(3).PutCoords(30, 0)
        ptc.AddPoints(4, pt(0))
        'The spatial reference should be set on the new point here (Code skipped)
        '*********************************************
        'Example 1: Distance No ratio, Positive offset
        pconsPoint = New Point
        pconsPoint.ConstructOffset(ptc, esriSegmentExtension.esriNoExtension, 15, False, 5)
        ptout = pconsPoint
        Debug.Print("Output point : " & ptout.X & " , " & ptout.Y)
        'Output point : 15 , -5
        '*********************************************
        'Example 2: Distance as ratio, Positive offset
        pconsPoint = New Point
        pconsPoint.ConstructOffset(ptc, esriSegmentExtension.esriNoExtension, 0.5, True, 5)
        ptout = pconsPoint
        Debug.Print("Output point : " & ptout.X & " , " & ptout.Y)
        'Output point : 15 , -5
        '*********************************************
        'Example 3: Distance No ratio, Negative offset
        pconsPoint = New Point
        pconsPoint.ConstructOffset(ptc, esriSegmentExtension.esriNoExtension, 15, False, -5)
        ptout = pconsPoint
        Debug.Print("Output point : " & ptout.X & " , " & ptout.Y)
        'Output point : 15 , 5
    End Sub



































ConstructParallel(ISegment, esriSegmentExtension, IPoint, double)

Constructs a point distance units from start, parallel to the tangent at the point nearest to start on the (extended) segment.

void ConstructParallel(ISegment Segment, esriSegmentExtension extension, IPoint start, double distance)

Parameters

Segment ISegment
extension esriSegmentExtension
start IPoint
distance double

Remarks

 

ConstructPoint ConstructParallel Example

[C#]

//The example shows how to construct a point parallel to the first segment
//of a selected polyline. Use ArcMap and the Object Editor to select the
//polyline.
public void ConstructPointParallelToLine(IMxDocument mxDocument)
{



    IMap map = mxDocument.FocusMap;
    IEnumFeature selectedFeatures = map.FeatureSelection as IEnumFeature;
    selectedFeatures.Reset();
    IFeature currentFeature = selectedFeatures.Next();
    IConstructPoint constructionPoint = new PointClass();
    while (currentFeature != null)
    {
        if (currentFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolyline)
        {
            IGeometryCollection geometryCollection = currentFeature.Shape as IGeometryCollection;
            ISegmentCollection segmentCollection = geometryCollection.get_Geometry(0) as ISegmentCollection;
            ISegment segment = segmentCollection.get_Segment(0);
            IPoint fromPoint = new PointClass();
            segment.QueryFromPoint(fromPoint);
            //add 10 to the x coordinate in order to get a diffrent point for this example
            fromPoint.X = fromPoint.X + 10;














            constructionPoint.ConstructParallel(segment, esriSegmentExtension.esriNoExtension, fromPoint, segment.Length / 2);
            IPoint outPutPoint = constructionPoint as IPoint;
            System.Windows.Forms.MessageBox.Show("Output point : " + outPutPoint.X + " , " + outPutPoint.Y);
        }
        currentFeature = selectedFeatures.Next();
    }
}





[Visual Basic .NET]

    ' The example shows how to construct a point parallel to the first segment
    ' of a selected polyline. Use ArcMap and the Object Editor to select the
    ' polyline.

    Public Sub t_constructParallel(ByVal pApp As ESRI.ArcGIS.Framework.IApplication)
        Dim pID As New ESRI.ArcGIS.esriSystem.UID
        pID = "esriEditor.editor"
        Dim pEditor As ESRI.ArcGIS.Editor.IEditor
        pEditor = pApp.FindExtensionByCLSID(pID)



        If pEditor.SelectionCount > 1 Then
            MsgBox("select one polyline")
            Exit Sub
        End If


        Dim pEnumFeat As ESRI.ArcGIS.Geodatabase.IEnumFeature
        Dim pFeature As ESRI.ArcGIS.Geodatabase.IFeature
        Dim i As Long

        pEnumFeat = pEditor.EditSelection

        Dim pSeg As ESRI.ArcGIS.Geometry.ISegment
        Dim pGeoColl As ESRI.ArcGIS.Geometry.IGeometryCollection
        Dim pPoint As ESRI.ArcGIS.Geometry.IPoint
        pPoint = New ESRI.ArcGIS.Geometry.Point
        Dim pCPoint As ESRI.ArcGIS.Geometry.IConstructPoint
        pCPoint = New ESRI.ArcGIS.Geometry.Point
        Dim pThroughPoint As ESRI.ArcGIS.Geometry.IPoint
        pThroughPoint = New ESRI.ArcGIS.Geometry.Point






        pFeature = pEnumFeat.Next

        While Not pFeature Is Nothing
            If pFeature.Shape.GeometryType = ESRI.ArcGIS.Geometry.esriGeometryType.esriGeometryPolyline Then
                pGeoColl = pFeature.Shape
                Dim pSegColl As ESRI.ArcGIS.Geometry.ISegmentCollection
                pSegColl = pGeoColl.Geometry(0)
                pSeg = pSegColl.Segment(0)
                pSeg.QueryFromPoint(pThroughPoint)
                pThroughPoint.X = pThroughPoint.X + 10






                pCPoint.ConstructParallel(pSeg, ESRI.ArcGIS.Geometry.esriSegmentExtension.esriNoExtension, pThroughPoint, pSeg.Length / 2)
                pPoint = pCPoint
                MsgBox(pPoint.X & "," & pPoint.Y)
            End If
            pFeature = pEnumFeat.Next
        End While
    End Sub






ConstructPerpendicular(ISegment, esriSegmentExtension, IPoint, double, bool)

Constructs a point 'distance' units from p and lying along the line normal to base and passing through p.

void ConstructPerpendicular(ISegment @base, esriSegmentExtension extension, IPoint p, double distance, bool bUseLineOrientation)

Parameters

base ISegment
extension esriSegmentExtension
p IPoint
distance double
bUseLineOrientation bool

Remarks

 

ConstructPoint ConstructPerpendicular Example

ConstructThreePointResection(IPoint, double, IPoint, double, IPoint, out double)

Constructs the point of observation from which two signed angles between three points were measured; returns an angle which can help establish the confidence of the observation location: A small angle indicates greater uncertainty in the location.

void ConstructThreePointResection(IPoint point1, double angleP1P2, IPoint point2, double angleP2P3, IPoint point3, out double arcAngle)

Parameters

point1 IPoint
angleP1P2 double
point2 IPoint
angleP2P3 double
point3 IPoint
arcAngle double

Remarks

Given three points and two angles measured from the constructed point.



Note that there is no unique solution if all three points are on the same circle.



[Visual Basic .NET]

Private Shared Sub t_ConstructThreePointResection()

     On Error GoTo Errorhandler

     Dim pPoint As IPoint

     Dim pCPoint As IConstructPoint

     Dim pPoint1 As IPoint

     Dim pPoint2 As IPoint

     Dim pPoint3 As IPoint

     Dim dAngle1 As Double

     Dim dAngle2 As Double

 

     pCPoint = New Point

     pPoint = New Point

     pPoint1 = New Point

     pPoint2 = New Point

     pPoint3 = New Point

 

     pPoint1.PutCoords(0, 1)

     pPoint2.PutCoords(2, 2)

     pPoint3.PutCoords(1, 0)

 

     dAngle1 = Math.PI / 4

     dAngle2 = Math.PI / 4

 

     pCPoint.ConstructThreePointResection(pPoint1, dAngle1, pPoint2, dAngle2, pPoint3, Math.PI / 2)

     pPoint = pCPoint

 

     MsgBox("x,y = " & pPoint.X & "," & pPoint.Y)

     Exit Sub

Errorhandler:

     MsgBox(Err.Number & "..." & Err.Description)

     Exit Sub

End Sub