2
$\begingroup$

For a cubic curve (Bezier) of the form: $ax^3 + bx^2 + cx + d = y$.

I have a given set of four points $P_0, P_1, P_2, P_3$. Such that, $P_0$ is the origin and the other three are equidistant along the $x$-axis by a fixed distance of $\delta_x$.

I have to find the values of the coefficients of $a$, $b$ and $c$ (Note: $d$ is zero since the curve passes through the origin)

There are many ways of solving the equations given on the web, but I do not have these value as fixed and need some equation where I could later substitute the values when provided. Somehow, solving it in algebraic and matrix form is leading me to erroneous results. This is very likely due to my eyes glazing over and my handwriting being very bad. I have not been able to ask correctly on Wolfram Mathematica either.

I am willing to put in the effort if anyone could kindly guide me such that the process is less painful :) Also, similar questions have been answered before eg. an answer by @czar here. Unfortunately, I would like a little more explanation.

After this basic question is answered, I would also like to know how to find a best-fit regression curve like the least-squares method for linear equations such that the curve may not necessarily pass through all four points but could be within some given tolerance region on the $y$-axis.

Many Thanks to the Community in advance. I am new here and cannot vote you up but appreciate the corrections and help anyone can give.

$\endgroup$
2
  • $\begingroup$ Feed the three equidistant points to Newton's forward interpolation. This gives you a quadratic polynomial in $x$. Now multiply it by the factor of $(x-0)$. $\endgroup$ Commented Jan 21 at 11:36
  • $\begingroup$ Recommend you read about Lagrange interpolation: en.wikipedia.org/wiki/Lagrange_polynomial $\endgroup$
    – bubba
    Commented Jan 23 at 23:36

1 Answer 1

2
$\begingroup$

General case : $$ax^3 + bx^2 + cx + d = y$$. enter image description here

Particular case considered in the question (with $d=0$) : $$ax^3 + bx^2 + cx = y$$.

If I well understand the wording of the question the coordinates of the four points are :

$P_0(x_0=0\:,\: y_0=0)$ ; $P_1(x_1=\delta\: ,\: y_1)$ ; $P_2(x_2=2\delta\: ,\: y_2)$ ; $P_3(x_3=3\delta\: ,\: y_3)$

So they are four variables : $\delta$ , $y_1$ , $y_2$ and $y_3$.

The unknowns are $a,b,c$ and there is a parameter $\delta$.

The three linear equations written on matrix form and solutions (computed with Mathcad) are : enter image description here

$\endgroup$
1
  • $\begingroup$ Thank you so much for replying! I am not very good at formulating my questions often but you answered it perfectly. If it helps to know, I used Mathematica to get to the same solution but with way too much time and confusion. Your solution gives the reasoning and understanding so much clearer. Kudos! $\endgroup$
    – Norma
    Commented Feb 19 at 7:07

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .