What is the Differential of a Bezier Curve with Respect to x?

  • Thread starter Thread starter Anti-Distinctly
  • Start date Start date
  • Tags Tags
    Curve Differential
Anti-Distinctly
Messages
3
Reaction score
0
Hi guys,
I am plotting a Bezier curve in a computer program I've written. The curve is created using four control points to generate the coefficients to the following equations:

x = ax*t^3 + bx*t^2 + cx * t + dx
y = ay*t^3 + by*t^2 + cy * t + dy

Where t a value between 0 - 1 to evaluate along the Bezier curve.

However, I need to know what the differential of this curve is, not with respect to t, but with respect to x. i.e. dy/dx at a value of x that you choose.

The reason for this is that I'm plotting a Bezier through some experiemental data and I need a mathematical representation of that data so I can get a smooth differential and double differential. But I've now come across this problem.
The only way I've thought of to do this so far is to, at your given x value, involves solving the cubic for t, which is quite expensive and diffucult.

Any suggestions?
 
Physics news on Phys.org
If x= f(t) and y= g(t), then dx/dt= f'(t), dy/dt= g'(t) and, by the chain rule,
dy/dx= (dy/dt)/(dx/dt)= g'(t)/f'(t).
 
Thanks Halls, that's the stuff I was looking for.
Furthermore, in order to calculate the differentials, I need to find t. I used the method illustrated over at www.nr.com[/url] (specifically [url]http://www.nrbook.com/a/bookcpdf/c5-6.pdf[/URL]) which seems to work well. It may be quicker to solve using bisection or something, but I didnt want to enter the realm of tolerance limits and the like. Explicit is better and performance is quite reasonable.
 
Last edited by a moderator:
Anti-Distinctly said:
The reason for this is that I'm plotting a Bezier through some experiemental data and I need a mathematical representation of that data so I can get a smooth differential and double differential. But I've now come across this problem. The only way I've thought of to do this so far is to, at your given x value, involves solving the cubic for t, which is quite expensive and diffucult.

I'm also trying to fit a Bezier (cubic) to data points, but have so far not been able to figure it out. I'm trying a least squares approach but can't figure out how to formulate the problem. It is easy if the x-values of the 4 control points are already known, but in general they aren't.

Can you tell me how you are doing it?

By the way, in terms of finding the value of t for a specific x, Newton-Raphson works well (the higher derivative methods even better).
 
Last edited:
I'm taking a slightly perculiar approach to this one; the cubic Bezier fitting is all done interactively with the user. The user clicks the mouse to add/delete Bezier knots. Each knot can be moved and each knot also has handles to change the Bezier shape. Its not mathematically rigorous, but I think its the best way to do it, at least for my particular case.
 
Back
Top