function lab04_pelda3_matlab2015
% 4. gyakorlat 3. peldajanak megoldasa
% 2015. marcius 6.
    
    load house.mat
    
    figure(1);
    plot(house(:,1),house(:,2));
    xlim([-10, 10]);
    ylim([-10, 10]);
    axis equal;
    title('original house', 'FontSize', 12, 'FontWeight', 'bold');

    % transzformaciok elvegzese
    H1 = house*A1;
    H2 = house*A2;
    H3 = house*A3;
    H4 = house*A4;
    
    figure(2);
    subplot(2, 2, 1);
    plot(H1(:,1),H1(:,2));
    xlim([-10, 10]);
    ylim([-10, 10]);
    axis equal
    title('house*A1', 'FontSize', 12, 'FontWeight', 'bold');

    subplot(2, 2, 2);
    plot(H2(:,1),H2(:,2));
    xlim([-10, 10]);
    ylim([-10, 10]);
    axis equal
    title('house*A2', 'FontSize', 12, 'FontWeight', 'bold');

    subplot(2, 2, 3);
    plot(H3(:,1),H3(:,2));
    xlim([-10, 10]);
    ylim([-10, 10]);
    axis equal
    title('house*A3', 'FontSize', 12, 'FontWeight', 'bold');

    subplot(2, 2, 4);
    plot(H4(:,1),H4(:,2));
    xlim([-10, 10]);
    ylim([-10, 10]);
    axis equal
    title('house*A4', 'FontSize', 12, 'FontWeight', 'bold');
    
    
    
    % itt jon a pelda folytatasa - a forgatas
    figure(3);
    for ang = 0:15:90
        % aktualis forgatasi szog
        phi = ang;

        % aktualis forgatasi matrix
        R = [cosd(phi) -sind(phi);
             sind(phi) cosd(phi)];

        % forgatas elvegzese
        HR = house*R;

        % kirajzolas
        plot(HR(:,1),HR(:,2), 'LineWidth', 3);
        xlim([-10 10]);
        ylim([-10 10]);
        title(strcat('Forgatas ', num2str(ang, 4), ' fokkal'), ...
            'FontSize', 12, 'FontWeight', 'bold');

        % a futas megallitasa tetszoleges billentyu lenyomasaig:
        pause;
    end
    
    
    
end
