-
Notifications
You must be signed in to change notification settings - Fork 10
Quadratic Bézier Curve #1
Comments
The implicit equation I came up for quadratic bezier curves with was (it's the same as the one mentioned in the readme): It seems a bit different than yours. I won't show the one for cubic bezier curves here, it has over a hundred terms. So I consider that the "direct" approach consisting of calculating each term is not very viable, unless maybe converting all cubic curves to quadratic curves beforehand. I had also tried another method which used a number of points from the bezier curve (6 for quadratic, 10 for cubic) to make a curve fitting, essentially reducing the problem to solving a system of linear equations. It worked great, however I was using arbitrary precision numbers and I'm not sure how well it would work with floating point numbers. I have some Maple worksheets on that if you're interested. There are other problems with implicit equations. For example finding the bounds becomes a lot more complicated. For parametric equations it's as easy as limiting the range of . For implicit equations you get complex bounds like (this one was made up but you get the point). I didn't look much into it though. Performance also becomes a problem. Thousands of parametric equations can be plotted just fine since it's a matter of entering various values for . Implicit equations on the other hand are a lot harder to plot. You can already see that when comparing the performance in Desmos for plotting the generated cartesian equations vs the parametric ones for a relatively complex SVG made of only straight lines. (like a world map) So yes, you are correct in saying this is possible. However I believe it goes beyond the intent of this project. The complexity of resulting equations makes it unappealing.
Adding fill would certainly be an interesting challenge. I don't have much time right now unfortunately. I encourage you to make your own research! |
Thank you for the reply! I believe that the equation I gave would be the same as yours after expanding unless I made any mistake. Also, if performance is your concern I suggest you to add an option to plot straight lines by explicit functions. Luckily Desmos support filling of parametric functions, so it would be easy to reproduce the SVG path (additionally, by setting the color by JavaScript). |
Here's PDF renders of the Maple worksheets I had made:
The worksheets in case you have Maple: bezier-maple.zip |
After simplifying a quadratic curve is actually just a simple parabola:
And the 5 constants could be pre-calculated if necessary.
Also, it would be great if something like this could be made.
Desmos Link
Thank you for reading and sorry for disturbing.
The text was updated successfully, but these errors were encountered: