Week 4 Solution

Question 1

\begin{array}{rcl}B(1/2)&=&\frac18P_0 + \frac38P_1 + \frac38P_2 + \frac18P_3\\
&=&\frac18(0,0) + \frac38(0,80) + \frac38(80,80) + \frac18(80,0)\\
&=&(40,60)\end{array}

The curve looks like this:

Tangent at t=0 is vertical line through (0,0). Tangent at t=1 is vertical line through (80,0).

For the road, we need to find the tangent at t=1/2. One method is to use the equation of the curve directly:

b'_0(t) = -3t^2 + 6t - 3,\quad b'_0(1/2) = -3/4
b'_1(t) = 9t^2 - 12t + 3,\quad b'_1(1/2) = -3/4
b'_2(t) = -9t^2 + 6t,\quad b'_2(1/2) = 3/4
b'_3(t) = 3t^2,\quad b'_3(1/2) = 3/4
\begin{array}{rcl}B'(1/2) &=& -3/4P_0 - 3/4P_1 + 3/4P_2 + 3/4P_3\\
&=& -3/4(0,0) - 3/4(0,80) + 3/4(80,80) + 3/4(80,0)\\
&=& (120,0)\end{array}

We just want the direction of B’(t), so dividing by the length gives (1,0). Rotating by 90 degrees and multiplying by half the road width gives (0,10). Adding this to B(1/2)=(40,60) gives (40,70) as one side of the road.

Rotating by -90 degrees and multiplying by half the road width gives (0,-10). Adding this to B(1/2)=(40,60) gives (40,50) as the other side of the road.

Question 2

Let the control points be A,B,C,D (column matrices in homogenous coordinates with the last value 1).

If T is an affine transformation, then

\begin{array}{rcl}TB(t) &=& T((1-t)^3A + 3t(1-t)^2B + 3t^2(1-t)C + t^3D)\\
&=& (1-t)^3TA + 3t(1-t)^2TB + 3t^2(1-t)TC + t^3TD\end{array}

TA,TB,TC,TD are column matrices in homogenous coordinates with the last value 1, ie, this is Bezier curve on the transformed control points.

Question 3

For C^2 continuity: A''(1) = B''(0) i.e
2P_2 - P_3 - P_1 = 2P_4 - P_5 - P_3

We can interpret this geometrically:

P_2 - P_3 is vector from P_3 to P_2.
P_2 - P_1 is vector from P_1 to P_2.
2P_2 - P_3 - P_1 is the sum of these two vectors.

It is possible to use this to make Beziers connect with C^2 continuity, but then any change to one will affect all the others.

Question 4

\begin{array}{rcl}
P_{0123} &=& (P_{012}+P_{123})/2\\
&=&((P_{01}+P_{12})/2 + (P_{12}+P_{23})/2)/2\\
&=&(P_{01}+2P_{12} +P_{23})/4\\
&=&((P_0+P_1)/2+2(P_1+P_2)/2 +(P_2+P_3)/2)/4\\
&=&(P_0+3P_1+3P_2+P_3)/8=\\
B(1/2)&=&\frac18P_0 + \frac38P_1 + \frac38P_2 + \frac18P_3
\end{array}

Question 5

(a) Adding the functions b_0(t), b_1(t), b_2(t), b_3(t) together gives the value 1. And they are all greater than or equal to zero for t between 0 and 1. Hence the uniform B spline has the convex hull property, just like a Bezier.

(b) taking derivatives:

\begin{array}{rcl}
b'_0(t)&=& (-3t^2 + 6t -3)/6\\
b'_1(t)&=& (9t^2 - 12t)/6\\\
b'_2(t)&=& (-9t^2 + 6t +3)/6\\
b'_3(t)&=& (3t^2)/6\end{array}

So

\begin{array}{rcl}
B'_0(1)&=& b'_0(1)P_0 + b'_1(1)P_1 + b'_2(1)P_2 + b'_3(1)P_3\\
&=& (0P_0 + -3P_1 + 0P_2 + 3P_3)/6=\\
B'_1(0)&=& b'_0(0)P_1 + b'_1(0)P_2 - b'_2(0)P_3 + b'_3(0)P_4=\\
&=& (-3P_1 + 0P_2 + 3P_3 + 0P_4)/6\end{array}

(c) taking second derivatives:

\begin{array}{rcl}
b''_0(t)&=& -t + 1\\
b''_1(t)&=& 3t - 2\\
b''_2(t)&=& -3t + 1\\
b''_3(t)&=& t\end{array}

So

\begin{array}{rcl}
B''_0(1)&=& 0P_0 + P_1 - 2P_2 + P_3=\\
B''_1(0)&=& P_1 - 2P_2 + P_3 + 0P_4\end{array}

Leave a Reply

You must be logged in to post a comment.


Bad Behavior has blocked 50 access attempts in the last 7 days.