Bezier curve(again): given Y, solve for X

  • Thread starter abeall
  • Start date
In summary, when given a bezier curve defined by p1, cp1, cp2, and p2, it is possible to solve for X when Y is known. However, the number of solutions may vary and it is not always possible to solve for X in all cases due to the potential for the curve to loop. This is where parametric equations are helpful.
  • #1
abeall
21
0
In a http://en.wikipedia.org/wiki/B%C3%A9zier_curve" defined by p1, cp1, cp2, p2, is it possible to solve for X when Y is known?

I can't figure out how to determine if the bezier curve intersects Y. I can conclude that the bezier curve does intersect if p1 and p2 are either side of Y. I can conclude that the bezier curve does not intersect if p1, cp1, cp2, and p2 all fall on one side of Y, but in the case that p1 and p2 fall on one side, and one or both cp1 and cp2 fall on the other side of Y, I don't know, it may or may not intersect. Additionally, it may intersect 1, 2, or 3 times.

Beyond that, I don't know how to solve X when Y is know, or even if it is possible.

Thanks for any advice.
 
Last edited by a moderator:
Mathematics news on Phys.org
  • #2
I think the situation is really the same as in your other thread - need to solve a cubic. In a cubic bezier, you have:

x = f(t,C_x)...C_x are the control points
y = g(t,C_y)...C_y are the control points

For the given y, you can solve the 2nd equation for t (0-3 solutions possible), then calculate x from the determined t.

In special cases, parametric equations can be combined (e.g. equation of a circle), but in general, it isn't possible because the curves can loop. That's what makes parametric equations so powerful.
 
  • #3


It is possible to solve for X when Y is known in a Bezier curve. Since a Bezier curve is a parametric curve, it means that the coordinates of each point on the curve can be expressed as a function of a single parameter, t. Therefore, to solve for X when Y is known, we need to find the value of t that corresponds to the given Y coordinate.

To do this, we can use the parametric equations for a Bezier curve, which are:

X = (1-t)^3*p1 + 3(1-t)^2*t*cp1 + 3(1-t)*t^2*cp2 + t^3*p2
Y = (1-t)^3*p1 + 3(1-t)^2*t*cp1 + 3(1-t)*t^2*cp2 + t^3*p2

We can rearrange these equations to solve for t:

t = (Y - (1-t)^3*p1 - 3(1-t)^2*t*cp1 - t^3*p2) / (3(1-t)*t^2*cp2)

Once we have the value of t, we can plug it back into the parametric equations to find the corresponding X coordinate. However, it's important to note that there may be multiple values of t that correspond to a given Y coordinate, meaning that the Bezier curve may intersect the Y coordinate multiple times. In this case, we would need to use the values of t to find the corresponding X coordinates for each intersection point.

In summary, it is possible to solve for X when Y is known in a Bezier curve, but it may require some additional calculations and consideration of multiple values of t. I hope this helps clarify the process for you.
 

1. What is a Bezier curve?

A Bezier curve is a mathematical curve that is commonly used in computer graphics to create smooth, curved lines. It is defined by a set of control points that determine the shape of the curve.

2. How are Bezier curves used in computer graphics?

Bezier curves are used in computer graphics to create smooth, curved lines and shapes. They are commonly used in vector graphics software, such as Adobe Illustrator, to create precise and smooth lines for illustrations and designs.

3. How do you solve for X in a Bezier curve when given Y?

To solve for X in a Bezier curve when given Y, you can use the cubic Bezier curve equation, which is: X = (1-t)^3 * P0 + 3(1-t)^2 * t * P1 + 3(1-t) * t^2 * P2 + t^3 * P3, where t is a value between 0 and 1, and P0, P1, P2, and P3 are the control points of the curve. You can plug in the given Y value and solve for t, then use that value of t to solve for X.

4. What are some common applications of Bezier curves?

Bezier curves have many applications, including computer graphics, animation, font design, and 3D modeling. They are also used in engineering and product design to create smooth curves and surfaces.

5. Are there any limitations to Bezier curves?

One limitation of Bezier curves is that they can only represent smooth curves, so they cannot accurately represent sharp corners or angles. Additionally, Bezier curves can only be used to create 2-dimensional shapes, so they may not be suitable for certain 3D modeling applications.

Similar threads

  • General Math
Replies
3
Views
874
  • General Math
Replies
11
Views
12K
  • General Math
Replies
6
Views
1K
Replies
6
Views
1K
Replies
4
Views
2K
  • Other Physics Topics
Replies
2
Views
1K
Replies
8
Views
3K
  • Classical Physics
2
Replies
39
Views
3K
  • Precalculus Mathematics Homework Help
Replies
18
Views
1K
Replies
2
Views
239
Back
Top