Original Post
Does anyone have a function that determines whether two Bezier curves intersect? Both of my curves are on the same two dimensional plane. Here is an example I have fro drawing one of my curves. I would like to also have a function that returns true if I pass in the parameters for two curves that intersect. If anyone has a formula or some tips about how to do this, I would really appreciate it.
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
using (Pen myPen = new Pen(Color.Black))
{
//Draw a curved line between two points.
//DrawBezier() was easier use than DrawArc()
Point start = new Point(label1.Right, label1.Bottom);
Point stop = new Point(label2.Right, label2.Top);
Point control1 = new Point(label1.Right + 30, (label1.Bottom + label2.Top) / 2);
Point control2 = new Point(label2.Right + 30, (label1.Bottom + label2.Top) / 2);
e.Graphics.DrawBezier(myPen, start, control1, control2, stop);
}
}
public bool IntersectingCurves(start1, control1, control2, stop1, start2, control2_1, control2_2, stop2);