2
$\begingroup$

Is there a free / open-source program that would allow me to drag and drop points of a cubic curve and displays the equation?

There are a number of equations that I could use in my game project and it would be a huge time saver if there is a tool that allows me to drag & drop and fine-tune curves to meet the desired effect.

In all circumstances I need to compute the value of y given x. This probably is not important, but both axis always range between -1 and 1.

1 Answers 1

3

Here's a little JSXGraph web page. Click and drag the red dots to change the cubic. The equation for the cubic will be changed accordingly... Drag the green dot along the curve to see the coordinates.

Is this what you wanted?

The full source is in the html file from the download link, and is easily modified (I think). It uses the formulas for the cubic passing through four given points found on this page: Lagrange Polynomials.

Admittingly, the equation looks ugly, but one could expand the formulas found on the linked page to put it in standard form.

Be warned: I haven't checked this thoroughly. The equations may be off...

Sample screen shot is below:

enter image description here

  • 0
    This is nice. It should be straightforward to modify the source so it can do Bézier curves instead of interpolating polynomials...2012-02-10
  • 0
    @Peter Your welcome. I really like the MathJax incorporation (though the script in the link runs much faster with MathJax disabled). JSXgraph can do amazing things. It's a very nice library; though, it is a pain to use at times.2012-02-10
  • 0
    Many thanks, with a few changes that should help me solve my problem.2012-02-10
  • 0
    Anyone got an updated link? This one seems to have expired. Thanks!2013-04-04
  • 0
    @chester I put it back up [here](http://www.mediafire.com/view/?c4yqurjdc2tb2lk). (Click on the link and download it. Then you can open it in a web browser. I wrote this for Firefox; but it should work in any browser.)2013-04-04
  • 0
    @chester There is a "download document" icon at the top right of the linked page. Click this and you should be able to load the page in your browser.2013-04-04