close all;
clear all;
plot_2d_axis(-1,6,-3,6);

orig = [0,0];

%bazove vektory
%ortonormalna baza
b1=[sqrt(3)/2 -0.5];
b2=[0.5 sqrt(3)/2];

%ortogonalna baza
%b1=[2*sqrt(3)/2 -1];
%b2=[0.5 sqrt(3)/2];

%neortogonalna baza
%b1=[1 1];
%b2=[0 0.5];
x=[2 3];

plot_2d_vector(orig, b1,'b_1', 'linewidth',1);
plot_2d_vector(orig, b2,'b_2', 'linewidth',1);
plot_2d_vector(orig, x,'x', 'linewidth',1);


x1=(b1(1)*x(1)+b1(2)*x(2))*b1;
plot_2d_vector(orig, x1,'x_1', 'linewidth',2);

x2=(b2(1)*x(1)+b2(2)*x(2))*b2;
plot_2d_vector(orig, x2,'x_2', 'linewidth',2);

plot_2d_vector(x1, x1+x2,'', 'linewidth',0.5);
plot_2d_vector(x2, x1+x2,'', 'linewidth',0.5);
%skalarny sucin b1(1)*b2(1)+b1(2)*b2(2)
%velkos, absolutna hodnota sqrt(b1(1)^2+b1(2)^2)