Code covered by the BSD License

# POFACETS4.1

### David Jenn (view profile)

Radar cross section (RCS) prediction code based on the physical optics (PO) approximation.

```function [coord,facet,scale,symplanes,comments,matrl]=pocylinder(R,H,N,ctop,cbottom)

%N=points to approximate circle in cylinder base
%cbottom='Yes': cylinder has bottom base, otherwise:no bottom base
%ctop='Yes':cylinder has top base, otherwise: no top base
% filename: pocylinder.m
% Project: POFACETS
% Description: This program creates a model of a cylinder with or w/o base
% Date:   February 2004
% Place: NPS

switch ctop
case 'Yes'
top=1;
otherwise
top=0;
end

switch cbottom
case 'Yes'
bottom=1;
otherwise
bottom=0;
end

Rs=0;

%Create Cylinder
[x,y,z]=cylinder(R,N);
z=z*H;

%eliminate last datapoints (same as first)
x=x(:,1:N);y=y(:,1:N);z=z(:,1:N);
if bottom==1
%First point is center of bottom base
fuselage=[0 0 0];
else
fuselage=[];
end
for j=1:2
for i=1:N
fuselage=[fuselage
x(j,i),y(j,i),z(j,i)];
end
end
if top==1
fuselage=[fuselage
0 0 H];
end
coord=fuselage;
% --------------- End Part 1 -----------------

%------------------PART 2 FACETS -----------------
fac=[];
count=0;
ind=0;
if bottom==1
%Create back cylinder base
for i=2:N
fac=[fac
i,1,i+1,1,Rs];
ind=ind+1;
end
fac=[fac
N+1,1,2,1,Rs];
ind=ind+1;
diff=0;
else
diff=-1;
end

%Create cylinder

for i=2:N
fac=[fac
N+i+diff,i+diff,i+1+diff,1,Rs
N+i+diff,i+1+diff,N+i+1+diff,1,Rs];
ind=ind+1;
ind=ind+1;
end
fac=[fac
2*N+1+diff,N+1+diff,2+diff,1,Rs
2*N+1+diff,2+diff,N+2+diff,1,Rs];
ind=ind+1;
ind=ind+1;

if top==1
last=size(coord,1);
%Create top base
for i=2:N
fac=[fac
N+i+diff,last,N+i+1+diff,1,Rs];
ind=ind+1;

end
fac=[fac
2*N+diff,last,N+2+diff,1,Rs];
ind=ind+1;
end
facet=fac;
%------------------End Part 2 ---------------------------

scale=1;
symplanes=[0 0 0];