## Bézier Curves

### Problem 363

A cubic Bézier curve is defined by four points: P_{0}, P_{1}, P_{2} and P_{3}.

The curve is constructed as follows:

On the segments P_{0}P_{1}, P_{1}P_{2} and P_{2}P_{3} the points Q_{0},Q_{1} and Q_{2} are drawn such that

P_{0}Q_{0} / P_{0}P_{1} = P_{1}Q_{1} / P_{1}P_{2} = P_{2}Q_{2} / P_{2}P_{3} = t (t in [0,1]).

On the segments Q_{0}Q_{1} and Q_{1}Q_{2} the points R_{0} and R_{1} are drawn such that

Q_{0}R_{0} / Q_{0}Q_{1} = Q_{1}R_{1} / Q_{1}Q_{2} = t for the same value of t.

On the segment R_{0}R_{1} the point B is drawn such that R_{0}B / R_{0}R_{1} = t for the same value of t.

The Bézier curve defined by the points P_{0}, P_{1}, P_{2}, P_{3} is the locus of B as Q_{0} takes all possible positions on the segment P_{0}P_{1}.

(Please note that for all points the value of t is the same.)

At this (external) web address you will find an applet that allows you to drag the points P_{0}, P_{1}, P_{2} and P_{3} to see what the Bézier curve (green curve) defined by those points looks like. You can also drag the point Q_{0} along the segment P_{0}P_{1}.

From the construction it is clear that the Bézier curve will be tangent to the segments P_{0}P_{1} in P_{0} and P_{2}P_{3} in P_{3}.

A cubic Bézier curve with P_{0}=(1,0), P_{1}=(1,`v`), P_{2}=(`v`,1) and P_{3}=(0,1) is used to approximate a quarter circle.

The value `v` > 0 is chosen such that the area enclosed by the lines OP_{0}, OP_{3} and the curve is equal to ^{π}/_{4} (the area of the quarter circle).

That is, if L is the length of the curve, calculate 100 × | L − π/2 π/2 |