Alvin,
Alvin Penner wrote:
The two Bezier quadratics that you could extract from the Inkscape file (assuming that the curve representing the function is a single Bezier curve segment)
I am not entirely clear on which way the data is flowing here. Are you trying to do a curve-fit to an existing curve (not in Inkscape) and then subsequently represent it in svg, or are you drawing a curve in svg and then trying to represent it as f(x)?
Yes.
In any event, just quick comment. The typical svg path element is a cubic Bezier which can only be represented parametrically as a function of t, not as an explicit f(x) relationship. However, there is a subset that might be interesting to look at. If you take a cubic Bezier curve and force the 4 control points to be equally spaced in the x axis, then what happens is that x(t) becomes linear and y(t) remains cubic. So you now have an explicit function y(x) which is still SVG-compatible, and is a cubic polynomial. So you could do a standard curve fit using cubic polynomials, and still be able to represent the result in svg.
That is exactly what I would like to do! - with other software available this should not be hard? For the particular case I am thinking of, the quadratic would be sufficient. What would be nice is to be able to extract this equation directly from Inkscape . .
Regards,
Phil.