# Thread: Quire in Bezier curves

1. ## Quire in Bezier curves

I have 3 points and 3 slopes contraints at those points. Now I want to fix a single Bezier curves which passes through all the 3 points and satisfies the slope constriants at all these 3 locations.

Thanks,
Vinayender.

2. A "Bezier curve" is a cubic spline, that is, a piecewise cubic function that fits the conditions: $\displaystyle y= ax^3+ bx^2+ cx+ d$. A single cubic won't do it- you have 4 numbers to fit and have 6 conditions. If you use one cubic$\displaystyle y= a_1x^3+ b_1x^2+ c_1x+ d_1$, for the first two points and another $\displaystyle y= a_2x^3+ b_2x^2+ c_2x+ d_2$, for the second two (the middle point being used in both), you will also require that the values and the first derivative match at the middle point.

Assuming that the points are $\displaystyle (x_0, y_0)$, $\displaystyle (x_1, y_1)$, $\displaystyle x_2, y2$, and that the slopes at these points are $\displaystyle m_0$, $\displaystyle m_1$, and $\displaystyle m_2$, respectively, then you have the equations:
values:
$\displaystyle a_1x_0^3+ b_1x_0^2+ c_1x_0+ d_1= y_0$
$\displaystyle a_1x_1^3+ b_1x_1^2+ c_1x_1+ d_1= y_1$
$\displaystyle a_2x_1^3+ b_2x_1^2+ c_2x_1+ d_2= y_1$
$\displaystyle a_2x_2^3+ b_2x_1^2+ c_2x_2+ d_2= y_2$

slopes:
$\displaystyle 3a_1x_0^2+ 2b_1x_0+ d_1= m_0$
$\displaystyle 3a_1x_1^2+ 2b_1x_1+ d_1= m_1$
$\displaystyle 3a_2x_1^2+ 2b_2x_1+ d_2= m_1$
$\displaystyle 3a_2x_2^2+ 2b_2x_2+ d_2= m_2$

That gives eight equations to solve for the eight coefficients.

3. First of all Thank you very much HallsofIvy...

actually I wanted to satisy all the six boundary conditions using a single bezier curve rather than using mutiple, peice wise continues Bezier curves. I dont mind using any higher order Bezier curve. I wanted to construct the curve which should always pass through the 3 specified coordinates and also satisfying the slope constrains at these 3 coordinates using a single Bezier curve and then tamper the curve using the control points with out loosing my constriants.

I am not sure wether we can do this or not

4. Originally Posted by vinay
... I wanted to construct the curve which should always pass through the 3 specified coordinates and also satisfying the slope constrains at these 3 coordinates using a single Bezier curve ...

I am not sure wether we can do this or not

You can do it.
see this
Bézier Curve -- from Wolfram MathWorld
A desirable property of these curves is that the curve can be translated and rotated by performing these operations on the control points.

Undesirable properties of Bézier curves are their numerical instability for large numbers of control points, and the fact that moving a single control point changes the global shape of the curve. The former is sometimes avoided by smoothly patching together low-order Bézier curves.

5. ## Curvature continitivity

Thank you very much aidan.....

ok fine i the only way to do this is by using mutliple Bezier curves...
It looks so obvious from me how to maintain slope continitivity..... BUT then, can you please explain me to make curvature continutivity between two 4th order Bezier curves ??????

6. Originally Posted by vinay
Thank you very much aidan.....

ok fine i the only way to do this is by using mutliple Bezier curves...
That's what Bezier curves are: piecewise polynomials!

It looks so obvious from me how to maintain slope continitivity..... BUT then, can you please explain me to make curvature continutivity between two 4th order Bezier curves ??????
The curvature depends upon the second derivative. As long as you make the second derivates, from each side, equal at the knots, the curve will have continuous curvature.