|laziness, impatience, and hubris|
Math::Bezier returns Math::Bizarre outputby captainentropy (Initiate)
|on Oct 06, 2013 at 19:00 UTC||Need Help??|
captainentropy has asked for the
wisdom of the Perl Monks concerning the following question:
NB: dozens of times I attempted to write this post but nothing would work. I was able to successfully write a post title "permission denied", which I have replaced with the current one. I'll keep the following updates in place, in case this is some glitch with the website and this makes any sense for that issue.
Original successful post titled "permission denied"WTF? This has gone on long enough!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Oh, great. So, after 18hrs of trying and waiting, THAT works. WTH?
Here's the original attempt, none of which will post as written. It returns "permission denied". The preview looks perfect
First post and I find a bug in the website? No attempt has worked except this "permission denied" post. What is wrong with (the format?) of my post? I seek Perl wisdom, not Perl aggravation
I rewrote the whole post using a different text editor, and the same "permission denied" (with the title I was using obviously). And I know the title is fine because I read the page about how to write a title and it conformed (but why would that block my post anyway?).
OK, here's the question I have.
Hi, I'm using Math::Bezier to create smooth curves from a set of three x,y coordinates. I'm not having problems with accomplishing that per se, my program does, essentially, what I need it to. The thing is that 1) to get the interpolated curve to go through the correct maximum y-value (which was fed into the module as one of the three control sets) I have to multiply the resulting y-values by 2. And 2) the shape of the curve is wrong. It comes out as a simple, symmetric parabola (p<0). When I graph the same points in Excel using the "XY Scatter With Smooth Lines" function (which uses Bezier interpolation) it comes out perfect, exactly as it should. So, anyone have an idea what's happening?
Here's an example of what I'm seeing https://www.dropbox.com/s/vtwwzkvo1l3unla/Bezier_example.pdf
Let me explain the curves. "Control points Alpha" is just the control set I'm using to evaluate my output. In this case the three XY coordinates are (0,0; 208,67.07; 690,0). "(Excel)" means, duh, graphed in Excel. Math::Bezier Alpha corrected y-max is the resulting curve if I multiply all the y-values of Math::Bezier Alpha original by 2. Control points Beta is adding two more control points (104,33.54; 312,33.54), graphed in Excel. And Math::Bezier Beta is the output of Math::Bezier with the two extra control points. The first curve - "control points Alpha (Excel)" - is exactly what I want to see from my perl script. Hopefully, someone has some experience using Math::Bezier and can tell me what I'm doing wrong. I emailed the author but have not received a reply.
Here's my code, though it works, I'm not sure if it's the Math::Bezier that's at fault, or me. It's probably me but I can't find anyone discussing Math::Bezier anywhere.