Sign in to follow this  

Bezier Curve!?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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 this post


Link to post
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?

Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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.

Share this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this