可以将形成夹角的两条线简化成三个点,Point1、Point2、Point3;第一条线Point1-Point2,第二条线Point2-Point3
以Point2为起始点 构建两条ILine(pLine21、pLine23),分别计算两条ILine的角度angle1、angle2
ESRI.ArcGIS.Geometry.ILine pLine21 = new ESRI.ArcGIS.Geometry.LineClass();
pLine21.PutCoords(pPoint2.Shape as ESRI.ArcGIS.Geometry.IPoint, pPoint1.Shape as ESRI.ArcGIS.Geometry.IPoint);
double angle1 = (pLine21.Angle * 180 / Math.PI);
if (Math.Abs(angle1) > 90)
angle1 = 180 - Math.Abs(angle1);
else
angle1 = Math.Abs(angle1);
ESRI.ArcGIS.Geometry.ILine pLine23 = new ESRI.ArcGIS.Geometry.LineClass();
pLine23.PutCoords(pPoint2.Shape as ESRI.ArcGIS.Geometry.IPoint, pPoint3.Shape as ESRI.ArcGIS.Geometry.IPoint);
double angle2 = (pLine23.Angle * 180 / Math.PI);
if (Math.Abs(angle2) > 90)
angle2 = 180 - Math.Abs(angle2);
else
angle2 = Math.Abs(angle2);
pLine21、pLine23夹角
double angle = 180 - angle1 - angle2;