# Quire in Bezier curves

• Jun 23rd 2009, 06:11 AM
vinay
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.
• Jun 24th 2009, 02:06 AM
HallsofIvy
A "Bezier curve" is a cubic spline, that is, a piecewise cubic function that fits the conditions: $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 $y= a_1x^3+ b_1x^2+ c_1x+ d_1$, for the first two points and another $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 $(x_0, y_0)$, $(x_1, y_1)$, $x_2, y2$, and that the slopes at these points are $m_0$, $m_1$, and $m_2$, respectively, then you have the equations:
values:
$a_1x_0^3+ b_1x_0^2+ c_1x_0+ d_1= y_0$
$a_1x_1^3+ b_1x_1^2+ c_1x_1+ d_1= y_1$
$a_2x_1^3+ b_2x_1^2+ c_2x_1+ d_2= y_1$
$a_2x_2^3+ b_2x_1^2+ c_2x_2+ d_2= y_2$

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

That gives eight equations to solve for the eight coefficients.
• Jun 24th 2009, 02:17 AM
vinay
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 (Thinking)
• Jun 24th 2009, 08:11 AM
aidan
Quote:

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
Quote:

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.
• Jun 24th 2009, 11:50 PM
vinay
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 ?????? (Headbang)
• Jun 25th 2009, 07:59 AM
HallsofIvy
Quote:

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!

Quote:

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 ?????? (Headbang)
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.