leibnitz - Leibnitz-Sector formula (closed curves area)
This function is used to calculate the area of a closed curve. Several calling conventions can be used: 1) A=LEIBNITZ(Z) , Z is a matrix with 2 rows. The 1st row equals x, the 2nd equals y. 2) A=LEIBNITZ(CVEK), CVEK is a complex Vector, Real part equals x, imaginary part equals y.
phi=0:1:360; z=exp(%i .*%pi .*phi ./180); // Circle with radius 1 A1=leibnitz(z); disp(A1); A2=leibnitz(real(z),imag(z)); disp(A2); cs=[1,real(z);length(z),imag(z)]; A3=leibnitz(cs); disp(A3);
simpson ,