# Bezier Curve!?

This topic is 4694 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello, I'm studying Computer Graphics. I'm a bit in truble with Bezier curves! I have the equation for such a curve and I know how is it constructed. But the problem is that I don't know how to find a tangent line to it!? What would be the derivative of such a curve? And what is the use of Bezier matrix? Can anybody help me with that? Thanks

##### Share on other sites
Hi,

The tangent to the curve can be found by differentiating the equation.

So given a cubic bezier curve
P(t) = P0*(1-t)^3 + P1*3t(1-t)^2 + P2*3t^2(1-t) + P3*t^3

Lets see if I can remember how to differentiate, the tangent is given by:
T(t) = P0*-3(1-t)^2 + P1*(3(1-t)^2-6t(1-t)) + P2*(6(1-t)t - 3t^2) + P3*3t^2

The bezier matrix is simply a different way of expressing the curves equation. It only really has practical use for us when using SIMD instructions (CPU or GPU) which hide many of the redudant multiplications while still performing some useful work in parallel. Even here using the simple form may still be quicker.

The tangent may also be calculated using a matrix

Hope this helps

##### Share on other sites
Thanks.

So it's only differentiating with repsect to t.

So, how can I use information given in a Bezier matrix in order to find the tangent line to the curve?

Anybody helps?

##### Share on other sites
Hi,

I've never tried this so not sure if it's correct.

A point on a cubic bezier curve can be found by multiplying 3 matrices:
[t^3, t^2, t, 1][Bezier Matrix][4 Points]

I believe that the tangent can be found like this:
[3t^2, 2t, 1, 0][Bezier Matrix][4 Points]

##### Share on other sites
I figured it out.

The first gives a point A and the second gives the direction of the tangent line. And then, we'll have

x = Ax + t X'(t)
y = Ay + t Y'(t)

And this is the parametric equation of the tanget line to the bezier curve.

##### Share on other sites
That sounds right!

##### Share on other sites
your question is easily answered by looking at the geometric interpretation of beziers (de Casteljau's algorithm). youll get the tangent for free while calculating the associated point on the curve itself.

1. 1
Rutin
37
2. 2
3. 3
4. 4
5. 5

• 11
• 12
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
633348
• Total Posts
3011462

×