This document is archived and information here might be outdated. Recommended version. |
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.
[Visual Basic .NET] Public Sub ConstructDeflectionIntersection ( _ ByVal baseLine As ILine, _ ByVal startAngle As Double, _ ByVal endAngle As Double, _ ByVal OnRightSide As Boolean _ )
[C#] public void ConstructDeflectionIntersection ( ILine baseLine, double startAngle, double endAngle, bool OnRightSide );
[C++]
HRESULT ConstructDeflectionIntersection(
ILine* baseLine,
double startAngle,
double endAngle,
VARIANT_BOOL OnRightSide
);
[C++] Parameters baseLine
baseLine is a parameter of type ILine* startAngle
startAngle is a parameter of type double endAngle
endAngle is a parameter of type double OnRightSide
OnRightSide is a parameter of type bool
//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);
}
'+++ 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