Obtaining curve equation #1
-
Hi @ChevronOne and/or other folks who are using this repo, I would like to have the equation of the created curve. However, I got a bit confused. Could you show me how I can get the equation? I hope you will see my question and thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, the fitting function fits cubic-Bézier curves, it returns four control points (P0 to P3) for each curve and by which the equation of the curve C is then defined as follows: You can get the four control points of a single curve by writing something like this: More about it in README.md |
Beta Was this translation helpful? Give feedback.
Hi, the fitting function fits cubic-Bézier curves, it returns four control points (P0 to P3) for each curve and by which the equation of the curve C is then defined as follows:
https://bit.ly/39LnG93 "C(t) = \sum_{i=0}^{n}\binom{n}{i} (1-t)^{n-i}t^{i}P_i"
where and the curve is defined only in . For cubic curves n=3.
This can simplified further to https://bit.ly/3wFIBBZ "C(t)=(1-t)^{3}P_{0}+3(1-t)^{2}tP_{1}+3(1-t)t^{2}P_{2}+t^{3}P_{3}, 0\leq t\leq 1"
"if the equations above did not render properly, you can copy-paste them in a proper latex renderer".
Also if you're not familiar with Bézier or parametric curves in general, here's a quick introduction. The Wikipedia article on the subject…