I need to write an OpenGL program to generate and display a piecewise quadratic Bézier curve that interpolates each set of data points:
$$(0.1, 0), (0, 0), (0, 5), (0.25, 5), (0.25, 0), (5, 0), (5, 5), (10, 5), (10, 0), (9.5, 0)$$
The curve should have continuous tangent directions, the tangent direction at each data point being a convex combination of the two adjacent chord directions.
I am not good at math, can anyone give me some suggestions about what formula I can use to calculate control point for Bézier curve if I have a starting point and an ending point.
Thanks in advance
Given the almost complete lack of constraints, you have a lot of degrees of freedom. Let's call your points $P_0$, $P_1$, ..., $P_n$, and the control points you need to add $Q_0$ to $Q_{n-1}$.
You can pick any point you want for $Q_0$. Then draw a line from $Q_0$ through $P_1$ and pick any point on the other side of $P_1$ for $Q_1$. Draw a line from $Q_1$ through $P_2$ and pick any point on the other side for $Q_2$. Etc.