1
2
3
4
5
6
7
// Calculate point from quadratic Bezier expression
private Vector3 QuadraticBezier(Vector3 P0, Vector3 P1, Vector3 C, float t)
{
    float x = (1 - t) * (1 - t) * P0.x + (2 - 2 * t) * t * C.x + t * t * P1.x;
    float y = (1 - t) * (1 - t) * P0.y + (2 - 2 * t) * t * C.y + t * t * P1.y;
    return new Vector3(x, y);
}

While implementing Bezier paths or creating Bezier curves you can speed up the development process by understanding the mathematical equations and then you can create your algorithm based on that. It is always suggested to draw the points, tangents or curves to debug the implementation.

Conclusion

These were the basics for the Bezier curve, In next blog we will dive into the code and implementation part, I will present Unity3D tutorial for using Bezier curve for 2D games like flight control and later on, we will proceed create a 3D example. I hope you got some ideas about Bezier applications area and implementation.