# Bezier curvature

I'm trying to understand quadratic Bezier 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:
http://blog.avangardo.com/2010/10/acceleration-on-curve-path/
http://en.wikipedia.org/wiki/Curvature

but I also saw:
Curvature = (P1x - P2x)(P3y - P2y) - (P3x - P2x)(P1y - P2y)
where P1, P2, P3 are points defining the curve.

There problem is, 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.

-

This formula is incomplete, it evaluates a multiple of the curvature.

Let us establish it by fitting a circle to the three points, as follows: first translate the points so that $P_2$ comes to the origin, and define $U=P_1-P_2,V=P_3-P_2$.

The equation of a circle through the origin is known to be $$(x-x_C)^2+(y-y_C)^2=x_C^2+y_C^2=r^2,$$which is of the form $$2x_Cx+2y_Cy=x^2+y^2=w.$$ So we form the system $$x_Cx_U+y_Cy_U=\frac{w_U}2\\x_Cx_V+y_Cy_V=\frac{w_V}2.$$ The solution is given by Cramer's rule, $$\Delta=\left| \begin{array}{ccc}x_U&y_U\\ x_V&y_V\\ \end{array} \right|,\\ x_C=\frac{\left| \begin{array}{ccc}w_U&y_U\\w_V&y_V\\ \end{array} \right|}{2\Delta}, y_C=\frac{\left| \begin{array}{ccc}x_U&w_U\\x_V& w_V\\ \end{array} \right|}{2\Delta}.$$ Then we deduce the approximation of the radius of curvature $r$, or its inverse $\kappa$, the curvature, and

$$\kappa=\frac1{\sqrt{x_C^2+y_C^2}}=2\frac{x_Uy_V-x_Vy_U}{\sqrt{(w_Ux_V-w_Vx_U)^2+(w_Uy_V-w_Vy_U)^2}}.$$

In the numerator, you recognize the original expression.

-