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

  • Context: Graduate 
  • Thread starter Thread starter Anti-Distinctly
  • Start date Start date
  • Tags Tags
    Curve Differential
Click For Summary

Discussion Overview

The discussion revolves around the mathematical differentiation of a Bezier curve with respect to x, rather than the typical parameter t. Participants explore methods to derive dy/dx at specific x values while addressing challenges related to fitting Bezier curves to experimental data.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant describes the equations for a cubic Bezier curve and expresses the need to compute the differential dy/dx at a chosen x value.
  • Another participant suggests using the chain rule to express dy/dx in terms of derivatives with respect to t, specifically dy/dx = (dy/dt)/(dx/dt).
  • A participant mentions using the method from a numerical analysis resource to find t for a given x, considering bisection as a potential alternative but preferring explicit methods for performance reasons.
  • One participant shares their experience with fitting a cubic Bezier curve to data points using a least squares approach and expresses difficulty in formulating the problem without known x-values for control points.
  • Another participant describes an interactive approach to Bezier fitting, where users manipulate control points and handles, noting that it may lack mathematical rigor but suits their needs.

Areas of Agreement / Disagreement

Participants express various methods and challenges related to finding the differential and fitting Bezier curves, with no consensus on a single approach or solution. Multiple competing views and techniques are presented.

Contextual Notes

Participants discuss the complexity of solving the cubic equation for t and the implications of different numerical methods, highlighting the dependence on specific definitions and assumptions in their approaches.

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.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K