I'm trying to understand quadratic Bézier curves but I cannot get pass one thing. Please, what is a "curvature" and how can I calculate it?
I'm asking because I found for instance this and this.
I also saw:
$$\text{Curvature}\, = \,(P1x - P2x)(P3y - P2y) - (P3x - P2x)(P1y - P2y) $$
where $P1$, $P2$, $P3$ are points defining the curve.
There is the problem, I don't see how one could arrive to such formula. Could someone explain it to me?
Maybe it's easier to start with "radius of curvature", rather than curvature. Let's take a specific point on our curve. Think of a circle that is touching the curve at this point, and is curving by the same amount as the curve itself. This circle has a name -- it's called the "osculating" circle, derived from the latin word for "kissing". The idea is that the circle has a very intimate form of contact with the original curve. The radius of this osculating circle is called the radius of curvature of the curve at the given point. Saying it another way, the radius of curvature at a point is the radius of a "best fit" circle at that point.
Now, if you've grasped all that, curvature is easy -- curvature is just the reciprocal of radius of curvature.
Intuitively, curvature is a measure of how fast a curve turns away from its tangent line. You can get formulas for curvature and radius of curvature in terms of the derivatives of the curve equations. That's where the formula you cited comes from. You can find these formulas in any book on "differential geometry".
For a quadratic Bezier curve, curvature depends strongly on the angle between the two "legs" of the control polygon. If these two legs are collinear (which means that the three control points are collinear) then the curve will have zero curvature everywhere. This should make sense -- the curve will become straight, so it's radius of curvature is infinite, so it's curvature is zero.