You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/03/29 18:14:18 UTC
DO NOT REPLY [Bug 28019] New: -
SplineInterpolator gives bad interpolation
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28019>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://issues.apache.org/bugzilla/show_bug.cgi?id=28019
SplineInterpolator gives bad interpolation
Summary: SplineInterpolator gives bad interpolation
Product: Commons
Version: Nightly Builds
Platform: PC
OS/Version: Other
Status: NEW
Severity: Major
Priority: Other
Component: Math
AssignedTo: commons-dev@jakarta.apache.org
ReportedBy: jfreyss@hotmail.com
The CubicSplineFunction does not fit on each interval:
> Replace
> double dquot = (yval[1] - yval[0]) / (xval[1] - xval[0]);
> for (int i = 0; i < n - 1; i++) {
> double dquotNext =
> (yval[i + 2] - yval[i + 1]) / (xval[i
> + 2] - xval[i + 1]);
> b[i] = 6.0 * (dquotNext - dquot);
> d[i] = 2.0 * (xval[i + 2] - xval[i]);
> dquot = dquotNext;
> }
>
>
> With
>
> //Source: http://mathworld.wolfram.com/CubicSpline.html
> for (int i = 0; i < n - 1; i++) {
> b[i] = 3.0 * (yval[i+1] - yval[i]);
> d[i] = (i>0 && i<n-2)? 4.0: 2.0 ;
> }
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org