Question: How to Extract Expressions in a Piecewise Function?

I am generating splines using CurveFitting[Spline] command, which produces piecewise functions. I would like to extract the different "pieces" of the spline for use elsewhere. How do I do that? In the attached worksheet, for example, I would like to extract (59*x^2)/756, -1/84*x^2 + 17/63*x - 17/84, and -19/504*x^2 + 19/36*x - 61/72. There has to be a way to do this, but I'm coming up short.


f := Spline([[0, 0], [3, 1/2], [7, 1]], x, degree = 2)

piecewise(x < 3/2, (59/756)*x^2, x < 5, -(1/84)*x^2+(17/63)*x-17/84, -(19/504)*x^2+(19/36)*x-61/72)






Please Wait...