I have two cubic bezier curve,
curve 1:- 1st anchor-point(a1x,a1y), 1st control-point(c1x,c1y), 2nd control-point(c2x,c2y), 2nd anchor-point(a2x,a2y)
curve 2:- 1st anchor-point(a3x,a3y), 1st control-point(c2x,c3y), 2nd control-point(c4x,c4y), 2nd anchor-point(a4x,a4y)
Now I want to find the intersection points between these two bezier curve;
How to do it? Any reference document with algorithm will help me;
A cubic bezier curve is just a cubic polynomial equation. If you want to find when two cubics intersect, then you want to find when the two cubics are equal, i.e.
Then that's the same as finding the roots of the cubic equation
Cubic equations, like that can be solved analytically, see e.g. Cardano's method. Alternatively, a method such as Newton–Raphson can be used to iterate to the solution. Beware, though, cubics can have up to 3 points where they're equal to zero.
There are two main methods to find a Bezier curve intersection:
Code from book Graphics Gems IV with some textual description
JS code and interactive demonstration And I think C++ code might be in Geometric Tools WildMagic library.
My suggestion may be not very efficient but it can work. You can try comparing distances between points of two curves, and the closest two points would be your cross "points".