Seems pretty easy to me. Well, easy enough. Ok, well doable.
Compute the area inside an ellipse, centered at [2,3], all done by integrating a cscvn curve. Yes, I hope it will be pi, or close to that.
t = linspace(0,2*pi,10);
rx = 1/2;
ry = 2;
x = 2 + rx*cos(t);
y = 3 + ry*sin(t);
The area of that ellipse is simple enough, because I carefully chose rx and ry. It would pi*rx*ry = pi.
Now, we apply Green's theorem. We can find the necessary line integral, in parametric form from (4) on the page:
Lets apply it to this spline.
fn = cscvn([x;y]);
fnprime = fnder(fn);
Kofs = @(s) [1 -1]*(fnval(fn,s) .* flipud(fnval(fnprime,s)));
A = 1/2*integral(Kofs,fn.breaks(1),fn.breaks(end))
Got lucky. Of course, we know the area of that ellipse is indeed pi, so that was a reasonable result given a 10 point approximation around the curve. The result is a signed area, based on traversing the curve in the order of the points given. (Right hand rule should indicate the sign.)
The length of the curve itself is even easier.
Lfun = @(s) sqrt(sum(fnval(fnprime,s).^2,1));
L = integral(Lfun,fn.breaks(1),fn.breaks(end))
The true arc length for that curve will be somewhat difficult, at least to do analytically without an elliptic integral. vpaintegral will handle it, of course.
vpaintegral(sqrt(rx^2*cos(theta)^2 + ry^2*sin(theta)^2),theta,[0,2*pi])
I should probably be able to check that from an elliptic integral. hmm, ellipke should do it, based on a quick search for a complete elliptic integral in MATLAB. Looks like the second kind should give what I need.
Based on the Kummer series approimation we find on that page, thus (65) & (66)
h = (ry - rx)/(ry + rx)
pi*(rx + ry)*(1 + h^2/4 + h^4/64 + h^6/256)
Looks good enough to me.