function [pts] = WingPoints(x0,Angle,Chord,ctr)
%Returns a collection of points in x that draws a wing of chord length
%wing, oriented at an angle about a point cc back from the leading edge,
%located at the point x0.

%NACA 0015 Airfoil M=0.0% P=0.0% T=15.0%
if(isrow(x0))
    x0 = x0';
end

 pts = [
  1.000000 -0.000000;
  0.998459  0.000280;
  0.993844  0.001114;
  0.986185  0.002488;
  0.975528  0.004377;
  0.961940  0.006748;
  0.945503  0.009564;
  0.926320  0.012777;
  0.904508  0.016339;
  0.880203  0.020197;
  0.853553  0.024298;
  0.824724  0.028586;
  0.793893  0.033006;
  0.761249  0.037500;
  0.726995  0.042013;
  0.691342  0.046485;
  0.654508  0.050858;
  0.616723  0.055068;
  0.578217  0.059053;
  0.539230  0.062745;
  0.500000  0.066077;
  0.460770  0.068980;
  0.421783  0.071385;
  0.383277  0.073228;
  0.345492  0.074446;
  0.308658  0.074986;
  0.273005  0.074801;
  0.238751  0.073860;
  0.206107  0.072140;
  0.175276  0.069635;
  0.146447  0.066353;
  0.119797  0.062317;
  0.095492  0.057561;
  0.073680  0.052132;
  0.054497  0.046083;
  0.038060  0.039475;
  0.024472  0.032367;
  0.013815  0.024817;
  0.006156  0.016879;
  0.001541  0.008596;
  0.000000  0.000000;
  0.001541 -0.008596;
  0.006156 -0.016879;
  0.013815 -0.024817;
  0.024472 -0.032367;
  0.038060 -0.039475;
  0.054497 -0.046083;
  0.073680 -0.052132;
  0.095492 -0.057561;
  0.119797 -0.062317;
  0.146447 -0.066353;
  0.175276 -0.069635;
  0.206107 -0.072140;
  0.238751 -0.073860;
  0.273005 -0.074801;
  0.308658 -0.074986;
  0.345492 -0.074446;
  0.383277 -0.073228;
  0.421783 -0.071385;
  0.460770 -0.068980;
  0.500000 -0.066077;
  0.539230 -0.062745;
  0.578217 -0.059053;
  0.616723 -0.055068;
  0.654508 -0.050858;
  0.691342 -0.046485;
  0.726995 -0.042013;
  0.761249 -0.037500;
  0.793893 -0.033006;
  0.824724 -0.028586;
  0.853553 -0.024298;
  0.880203 -0.020197;
  0.904508 -0.016339;
  0.926320 -0.012777;
  0.945503 -0.009564;
  0.961940 -0.006748;
  0.975528 -0.004377;
  0.986185 -0.002488;
  0.993844 -0.001114;
  0.998459 -0.000280;
  1.000000  0.000000;
]';

pts(1,:) = 1-pts(1,:);
pts = Chord*pts;

pts(1,:) = pts(1,:)-(Chord-ctr);

%figure
%plot(pts(1,:)/.0254,pts(2,:)/.0254,'-x')
%axis equal
%hold all
%grid on

R(1,1) = cos(Angle);
R(1,2) = sin(Angle);
R(2,1) = -sin(Angle);
R(2,2) = cos(Angle);

pts = R*pts;
for i = 1:length(pts)
  pts(:,i) = pts(:,i)+x0; %.*ones(size(pts));
end
%plot(pts(1,:)/.0254,pts(2,:)/.0254,'-o')

return;

end

