private IPoint ConstructPoint2(IPoint p0, double angle0, IPoint p1, double angle1) { double angle1Rad = angle0 * Deg2Rad; double angle2Rad = angle1 * Deg2Rad; IConstructPoint constructionPoint = new PointClass(); constructionPoint.ConstructAngleIntersection(p0, angle1Rad, p1, angle2Rad); return(constructionPoint as IPoint); }
//构造角度交点法 private void button4_Click(object sender, EventArgs e) { delFeature("point"); IPoint point1, point2; point1 = new PointClass(); point2 = new PointClass(); point1.PutCoords(0, 0); point2.PutCoords(10, 0); double angleRed1 = 45 * 2 * Math.PI / 360; double angleRed2 = 60 * 2 * Math.PI / 360; IConstructPoint constructPoint = new PointClass(); constructPoint.ConstructAngleIntersection(point1, angleRed1, point2, angleRed2); addFeature("point", point1); addFeature("point", point2); addFeature("point", constructPoint as IPoint); axMapControl1.Refresh(); }
private void GetSecondPoint() { INumberDialog numDialog = new NumberDialogClass(); // Set the second point equal to the active point which may have been snapped m_secondPoint = m_activePoint; // Get the angle if (numDialog.DoModal("Angle 2", -45, 2, m_editor.Display.hWnd)) { m_secondAngle = numDialog.Value * Math.PI / 180; } else { m_etoolPhase = ToolPhase.Inactive; return; } // Get the intersection point IConstructPoint constructPoint = new PointClass(); constructPoint.ConstructAngleIntersection(m_firstPoint, m_firstAngle, m_secondPoint, m_secondAngle); IPoint point = constructPoint as IPoint; if (point.IsEmpty) { m_etoolPhase = ToolPhase.Inactive; MessageBox.Show("No Point Calculated"); return; } // Draw the calculated intersection point and erase previous snap feedback m_activePoint = point; m_etoolPhase = ToolPhase.Intersection; m_snappingFeedback.Update(null, 0); DrawPoint(m_activePoint); }
private IPoint ConstructPoint2(IPoint p0, double angle0, IPoint p1, double angle1) { double angle1Rad = angle0 * Deg2Rad; double angle2Rad = angle1 * Deg2Rad; IConstructPoint constructionPoint = new PointClass(); constructionPoint.ConstructAngleIntersection(p0, angle1Rad, p1, angle2Rad); return constructionPoint as IPoint; }