# Advanced Mathematics and Mechanics Applications Using MATLAB, 3rd Edition

### Howard Wilson (view profile)

14 Oct 2002 (Updated )

Companion Software (amamhlib)

[p,zplot]=aprop(xd,yd,kn)
```function [p,zplot]=aprop(xd,yd,kn)
%
% [p,zplot]=aprop(xd,yd,kn)
% ~~~~~~~~~~~~~~~~~~~~~~~~~
% This function determines geometrical properties
% of a general plane area bounded by a spline
% curve
%
% xd,yd - data points for spline interpolation
%         with the boundary traversed in counter-
%         clockwise direction. The first and last
%         points must match for boundary closure.
% kn    - vector of indices of points where the
%         slope is discontinuous to handle corners
%         like those needed for shapes such as a
%         rectangle.
% p     - the vector [a,xcg,ycg,axx,axy,ayy]
%         containing the area, centroid coordinates,
%         moment of inertia about the y-axis,
%         product of inertia, and moment of inertia
% zplot - complex vector of boundary points for
%         plotting the spline interpolated geometry.
%         The points include the numerical quadrature
%         points interspersed with data values.
%
% User functions called: gcquad, curve2d
if nargin==0
td=linspace(0,2*pi,13); kn=[1,13];
xd=cos(td)+1; yd=sin(td)+1;
end
nd=length(xd); nseg=nd-1;