Welcome to Function Fit! This is a tool to make fitting equations to data points simple.
You can pan and zoom the graph by dragging and scrolling (or pinching) and you can place, move and delete points by tapping and dragging them.
You can also edit the points on the graph from the text box labelled "points" - you can edit their positions or paste in a set of points.
You can pick from a few different fit types from the dropdown menu labelled "fit". The first 6 are linear regression and have closed form solutions, but the last one (custom) is nonlinear regression by an iterative process.
The first 6 will therefore run much faster and more stably but you might get a slightly less accurate fit due to the variable transformation applied.
To fit a custom function, you can write the form of your equation as a JavaScript expression in the formula text box. You can use normal js such as the Math library as this expression gets evaled during the iteration (make sure all your data points agree with the expression you've written, for example don't use points with negative x in a square root function). The letters a - j are reserved for the parameters that will be optimised over, and you can call your independant variable anything else.
Once you've got your function, you can copy the code from the text boxes at the bottom to get it into your project :)