On Sun, 12 Nov 2017, Evan Laforge wrote: > I see, I guess you mean NodeList.lookup is looking in a binary tree. right > Right, I'm not worried about approximation, as long as it's not too > approximate. It's just that I'm not sure about the complexity of the > implementation for those operations. An approach could be: Implement (zipWith f xs ys) in some way and then use curve fitting in order to construct approximate cubic functions. An exact implementation would have to be implemented for every operation, and might be feasible only for basic operations like multiplication. A general solution might sample the curves. The Fit example shows how curve fitting works. Alternatively you may warrant the correct function application only at the nodes and perform some differentation rules there. E.g. if you have node (ya,dya) from the first function and (yb,dyb) from the second function you may set the node of the multiplied curve using the Product rule to: y = ya*yb dy = ya*dyb + dya*yb > Also I see I had to do some awkward binary search guessing to find the > value at a specific 'x'. I forget the details now but I guess since > the bezier's output is (x, y) pairs, I can't just directly find the y > for a given 'x', hence the searching. That's probably pretty > inefficient and a sign I should have used a better technique. It > looks like Piece.hermite1 takes an arbitrary x and directly computes > the result, so it doesn't have that problem. Searching should be only necessary when you compute values of a function that is a concatenation of some basic pieces. Piece.hermite1 interpolates within one piece, thus no search. The same would apply to Bezier curves. > What's the difference with the other Types, like cubicLinear and > cubicParabola, given that interpolatePiece functions are all the same? > I gather the Basis.coefficientsToCubicLinear and CubicParabola are just > using different techniques and inputs to compute hermite1 values, which > ultimately goes into the same kind of interpolation. Right, they all are different ways to determine the cubic polynomials. Once you have the cubic polynomials, their interpolation is always the same. > I guess the idea with the Hermite spline is that since in and out > slope are the same, you automatically get a smooth function. right > But on the other hand, how do you influence how sharp the curve is? > With the bezier implementation I can get back to linear interpolation by > setting both weights to 0, or get a sigmoid kind of shape by setting > them both to 0.5. Sigmoid type would be slopes=0 for Hermite interpolation, Linear would be slopes=(y1-y0)/(x1-x0). > However, the Wikipedia page claims that Hermite and Bezier are simply > different representations for the same thing, and can be converted > mechanically, so surely they should have the same capabilities? Right, if of the same order they span the same set of functions, here: cubic polynomials. More generally: n degrees of freedom require polynomials of order (n-1).