in reply to How to smooth values of an x,y,z array using Math::Spline
When I tried running
... I found that $spline_xy=Math::Spline::->new(...) and $spline_xz both die when they are created; if I change the third row to having an x value of -0.6437 instead of -0.7437, it fixes it, so I am assuming that it's because those x-values are the same.
Were you intending the middle two of the four points to be points on the curve (so the interpolation would hit them exactly); or are they "control points", where the interpolation doesn't hit them directly, but instead only touches on the outer two, and the inner two just define directions (like this image from Bézier_curve)? Because, from what I can tell, Math::Spline makes sure that it hits the points from the instantiation-list rather than treats them as controls.
If what you really wanted was more along the lines of a Bézier curve, let me know, because that's pretty simple to code up without a module.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to smooth values of an x,y,z array using Math::Spline
by cormanaz (Deacon) on May 10, 2023 at 17:34 UTC | |
by pryrt (Abbot) on May 10, 2023 at 18:35 UTC |