function rotation2D_test(theta)

% This function rotates a triangular region by
% 
% Input: 
%      theta (degrees)

theta=pi/180*theta;

%   Verts =  [1 2 3; 
%             1 1 3];

% NACA 0012 profile
data=load('naca0012.dat');
Verts=data';

%Rotation matrix
Rot = @(theta) [  cos(theta)  -sin(theta);
                  sin(theta)   cos(theta)];

% Triangle
figure(1)
clf
patch(Verts(1,:), Verts(2,:),'r');
axis equal
axis([-1.2 1.2 -1.2 1.2]);
grid;
box;

% Rotated triangle
figure(2)
clf
NewVerts=Rot(theta)*Verts;
patch(NewVerts(1,:),NewVerts(2,:),'r');
axis equal
axis([-1.2 1.2 -1.2 1.2]);
grid;
box;

