Bezier curve implementation.