Interpreting Complex Solutions in Cubic Bezier Curve Problems

  • Thread starter Thread starter treddie
  • Start date Start date
  • Tags Tags
    Cubic Curve
AI Thread Summary
The discussion centers on the challenges of finding corresponding y-values for given x-values on a cubic Bezier curve, particularly when complex solutions arise. Users note that while cubic equations typically yield one real solution, their implementations sometimes produce multiple roots, including complex ones. The inconsistency in obtaining real values prompts questions about the interpretation of complex results, especially since Bezier curves can cross themselves in the x-dimension. Participants suggest that the issue may stem from the inherent properties of Bezier curves, which do not guarantee a one-to-one relationship between x and y across all scenarios. Ultimately, the conversation highlights the need for a reliable method to handle these complexities in computational applications.
treddie
Messages
91
Reaction score
2
Hello.

I have a program that, given a value for (x), needs to find the corresponding y-value along a cubic Bezier curve. So long as the Bezier does not switch direction in (x), there is always one, and only one, value of (y) for every value of (x).

In solving for (y), I discovered that the solution was a cubic (not surprising, since the very name of this type of Bezier is "cubic"). Now, my experience with quadratics and what cubics I run into rarely, is that the way to find out which solution to use is to just test it...Most often, one will always work while the others will not, or in some rare cases all of them will work...Assuming that the values are always Real.

At any rate, after testing the program, I found that, indeed, none of the three solutions always offered a Real result. Sometimes all three were Real, sometimes a mix of Real and Complex, other times all Complex. So my conundrum is this: I need a scalar (Real) value for (y), but when I move one of the control points of the Bezier, I run into a majority of cases where the result for (y) is complex, and no solution reliably results in a Real, scalar value for it. Therefore, there is no way to test for which solution to use.

My question is, how am I to interpret a Complex result in this situation? It is a vector with an Imaginary component, when I need a scalar value. Proofing my math results suggests that I have the correct solutions, and whenever a Real value results, that (y) value is always correct. As far as I know, a Complex value may indicate that something is going on in a separate dimension, so I assume that since the Bezier I am using is 2-dimensional, that the Complex result is telling me that there is activity in a third, orthogonal direction. But that makes no sense as far as this Bezier is concerned.

I am stumped. :(

Any guidance would be really helpful.

Many thanks!
 
Mathematics news on Phys.org
I could use some more detail about what you are doing. Standard form for a plane curve is P=F(t), where P = (x,y), F(t) is a two dimensional cubic defined by control points, and 0≤t≤1. It is not at all surprising that you can't get solutions in some cases.
 
  • Like
Likes 1 person
If you have a cubic equation with all real coefficients, and you got "three complex roots", that is just wrong. There is always one real root, unless coefficient of ##x^3## is 0 and the equation was not really a cubic.

Find the bug in the code, and try again!
 
  • Like
Likes 1 person
Yes you are correct. I went back and plugged more values into my MathCAD solution and I always come up with at least one real solution. But it can jump from solution to solution. So in that respect, I'll need to test all three on every control point change. But what to do when you have three reel roots? Should it even happen?
 
mathman> I think you are correct. This is the first time I have ever run into the problem where one root does not suffice for all cases in a particular problem. I have instead, resorted to an approximating numerical method which works fine. Bummer, since I always like analytical solutions over numerical ones.

I'm not sure but I think the problem has its source in that a Bezier curve is never limited to not crossing back over itself in (x). Since a Bezier behaves without such a limit, it is perhaps unreasonable to assume that a general analytical solution COULD be limited in that fashion, since it cannot address a local region of a Bezier where there is always one (y) for every (x). That is not the global, general behavior of a Bezier, so the analytical solution will not behave that way either, without some special modifications, whatever those might be, if they even exist.
 
Last edited:
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...

Similar threads

Replies
2
Views
3K
Replies
1
Views
4K
Replies
7
Views
3K
Replies
8
Views
4K
Replies
11
Views
13K
Replies
5
Views
4K
Replies
2
Views
5K
Replies
2
Views
2K
Back
Top