如何求曲线的交点?
C#开发|冯美娟|2018-07-20 15:58
-
回答:
private void IntersectPoint() { MxDrawUtility mxUtility = new MxDrawUtility(); MxDrawPoint getPt; MxDrawEntity ent1 = mxUtility.GetEntity(out getPt, "\n 曲线1:"); if (ent1 == null) { MessageBox.Show("没有曲线1.."); return; } MxDrawEntity ent2 = mxUtility.GetEntity(out getPt, "\n 曲线2:"); if (ent2 == null) { MessageBox.Show("没有曲线2.."); return; } MxDrawPoints points = (MxDrawPoints)ent1.IntersectWith(ent2, MCAD_McExtendOption.mcExtendNone); if(points.Count == 0) { MessageBox.Show("没有求到交点"); } else { MxDrawPoint pt = points.Item(0); MessageBox.Show("交点为:" + pt.x + "," + pt.y); } }