Can y(x) be Calculated from a Cubic Bezier Curve?

  • Thread starter tuoni
  • Start date
  • Tags
    Curve
In summary, the conversation discusses the possibility of converting a cubic Bezier curve to the form y = f(x) and the potential challenges that come with it. The speaker currently uses a method of finding the x value by incrementing t and then getting the corresponding y value, but is looking for a quicker and more accurate way of doing so. They are using Bezier curves to model drag constant curves and have previously used regression curves, but are now looking for better alternatives such as data interpolation or standard cubic splines.
  • #1
tuoni
61
0
Is it possible to from a cubic Bezier curve (B) first calculate t as a function of x, and then y as a function of t?

I am currently using:

[itex]B(t) = (1-t)^{3} \cdot P_{0} + 3(1-t)^{2} \cdot P_{1} + 3(1-t)^{2} \cdot P_{2} + t^{3}P_{3}[/itex]

; which works just fine to model several curves I need to use in my calculations, however, I would need to be able to calculate y as a function of x, as opposed to B as a function of t.

Is it possible? Simple rearranging doesn't seem to be possible.
 
Mathematics news on Phys.org
  • #2
If I understand correctly, you want to convert a cubic bezier to the form y = f(x). I'm curious as to what situation you have that you'd want to do this. The beauty of bezier curves is that they can easily describe complicated shapes that can't readily be done with functions of the form y = f(x).

Conversion could potentially be done, but things get messy real fast since with bezier curves x is in general a cubic function in t. If the curve is a degernate one where x is a linear function of t, the conversion is straightforward.
 
  • #3
At the moment I have to step through t in small increments until I find the x value I want, and then get the y value. I was just wondering whether there was a quicker and more accurate way of doing this.
 
  • #4
tuoni said:
At the moment I have to step through t in small increments until I find the x value I want, and then get the y value

Tell us a little more about what you are doing. Maybe there is a different approach.
 
  • #5
I am using Bezier curves to model drag constant curves.

http://enes.fi/temp/kdrag.png

Previously I divided the curve into smaller segments, then for each segment plotted a regression curve using the power function: ak^b (k is the Mach constant). The regression curves were sometimes poor approximations, so I looked for better alternatives.
 
Last edited by a moderator:
  • #6
Is data interpolation the ultimate objective? If so, I'd try standard cubic splines.
 

FAQ: Can y(x) be Calculated from a Cubic Bezier Curve?

1. What is a Cubic Bezier Curve?

A Cubic Bezier Curve is a mathematical function that describes a smooth curve between two points. It is commonly used in computer graphics and design software to create curved lines and shapes.

2. How is a Cubic Bezier Curve calculated?

A Cubic Bezier Curve is calculated using a formula that takes into account four control points: two anchor points and two control points. The positions of these points determine the shape and direction of the curve.

3. Can y(x) be calculated from a Cubic Bezier Curve?

Yes, y(x) can be calculated from a Cubic Bezier Curve by plugging in the x-coordinate value into the equation of the curve. The resulting y-coordinate value will give the corresponding point on the curve.

4. What are the advantages of using a Cubic Bezier Curve?

One of the main advantages of using a Cubic Bezier Curve is that it allows for the creation of smooth, curved lines and shapes. It also offers a high level of control over the shape of the curve by adjusting the position of the control points.

5. Are there any limitations to using a Cubic Bezier Curve?

While Cubic Bezier Curves are versatile and commonly used, they do have some limitations. One limitation is that they can only represent a limited range of curves, and more complex curves may require multiple curves to be combined. Additionally, the calculation of points on the curve can be computationally expensive, particularly for curves with many control points.

Similar threads

Back
Top