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

In summary, the person is trying to fit a cubic Bezier curve to experimental data and has run into a problem. They are also asking for advice on how to do it.
  • #1
Anti-Distinctly
3
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
  • #2
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).
 
  • #3
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:
  • #4
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:
  • #5
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.
 

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

What is the definition of a Bezier curve?

A Bezier curve is a type of mathematical curve that is commonly used in computer graphics and modeling. It is defined by a set of control points that determine its shape and is often used to create smooth and curved lines or surfaces.

How is the differential of a Bezier curve calculated?

The differential of a Bezier curve is calculated by taking the derivative of the parametric equations that define the curve. This results in a set of differential equations that describe the rate of change of the curve at any given point.

What is the significance of the differential of a Bezier curve?

The differential of a Bezier curve is important because it can be used to determine properties of the curve, such as its curvature and tangent vectors, which are essential for creating smooth and realistic graphics.

What is the relationship between the degree of a Bezier curve and its differential?

The degree of a Bezier curve refers to the number of control points used to define the curve. The higher the degree, the more control points are used, resulting in a more complex curve and a more complicated differential equation.

Can the differential of a Bezier curve be used to approximate other types of curves?

Yes, the differential of a Bezier curve can be used to approximate other types of curves, such as circles, ellipses, and parabolas. This is achieved by manipulating the control points and adjusting the degree of the curve.

Back
Top