clear all; close all; clc;
a=[];
indicator=[];
centerY=100;
centerX=240;
jos=20;
for i=100-jos:250
    for j=220:260
    indicator(i,j)=i-60;
    indicator(i,260-(j-220))=abs(j-i);
    end;
end;

% image(indicator)
% break

deltax=0;
deltay=0;
alfa=pi*0.5/3;
matrice=[];
rezultat=[];

for i=1:272
    for j=1:480
    a(i,j)=10;
        end;
end;

%        break;
        for i=100-jos:250
    for j=220:260
         b=273-i;
        address=(i)*480+j;
        deltay=(b-centerY);
        deltax=(j-centerX);
        matrice=[deltax; deltay];
       rezultat= [cos(alfa) , sin(alfa) ; -sin(alfa) , cos(alfa) ]*matrice;
        y2=floor(rezultat(2)+centerY+cos(alfa)*(250-100-jos)/2);
        x2=floor(rezultat(1)+centerX+sin(alfa)*(250-100-jos)/2);
%         if j==230
%             break;
%         end;s
if(273-y2-jos>0 & x2>0)
         a(273-y2,x2)=indicator((250-i+100-jos),j);
end;
    end;
end;
alfa=alfa+0.005
        for i=100-jos:250
    for j=220:260
         b=273-i;
        address=(i)*480+j;
        deltay=(b-centerY);
        deltax=(j-centerX);
        matrice=[deltax; deltay];
       rezultat= [cos(alfa) , sin(alfa) ; -sin(alfa) , cos(alfa) ]*matrice;
        y2=floor(rezultat(2)+centerY+cos(alfa)*(250-100-jos)/2);
        x2=floor(rezultat(1)+centerX+sin(alfa)*(250-100-jos)/2);
%         if j==230
%             break;
%         end;s
if(273-y2-jos>0 & x2>0)
         a(273-y2,x2)=indicator((250-i+100-jos),j);
end;
    end;
end;



a(273-100,240)=15;
image(a);

