[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: polynome code?
From: |
Robert A. Macy |
Subject: |
Re: polynome code? |
Date: |
Thu, 19 Jan 2006 10:13:42 -0800 |
At the risk of looking really, really stupid here...
given x0, x1, y0, y1, doty0, and doty1
what about making the four by four matrix, M =
x0^3, x0^2, x0, 1;
x1^3, x1^2, x1, 1;
3*x0^2, 2*x0, 1, 0;
3*x1^2, 2*x1, 1, 0;
taking the inverse of that matrix:
Minv=inv(M);
then coefficients of polynome, Coeff
= Minv*[(y0, y1, doty0, doty1)];
Coeff=Coeff';
...or so
and you're done.
- Robert -
On Thu, 19 Jan 2006 12:36:16 -0500 (EST)
> does anybody know of existing code which returns the
> coefficients of
> one cubic polynome, which are completely defined by 4
> conditions:
>
> the value of the polynome at two points and the slope
> of the polynome
> at these two points (one of the slopes is actually
> zero for my
> application).
>
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------