How can I intersect a line with a circle?
See the following example.
OnCircle circle = new OnCircle(OnPlane.World_xy, 5.0); OnLine line = new OnLine(new On3dPoint(0, 0, 0), new On3dPoint(10, 0, 0)); double line_t0 = 0; double line_t1 = 0; On3dPoint circle_point0 = new On3dPoint(); On3dPoint circle_point1 = new On3dPoint(); // Intersects an infinite line and a circle int rc = OnUtil.ON_Intersect(line, circle, ref line_t0, ref circle_point0, ref line_t1, ref circle_point1); if( rc > 0) { context.m_doc.AddPointObject(circle_point0); if (rc == 2) context.m_doc.AddPointObject(circle_point1); context.m_doc.Redraw(); }