function [result_x, result_y] = extend(vector_x, vector_y, korak, N_lastPoints, N_newPoints)
%  Program does the following:
% - picks N_last points
% - finds log(vector)
% - finds slope and intercept fora the log(vector)
% - adds N_newPoints linearly
% - finds exp(new points)
% - adds them to the initial vector


last = numel(vector_y);
levi = last-N_lastPoints+1; 
desni = last; 
noviLast = last + N_newPoints;

x = vector_x(levi:desni);
y = log(vector_y(levi:desni));
[slope, inter] = linear(x, y);
result_x(1:desni) = vector_x(1:desni);
result_y(1:desni) = vector_y(1:desni);
result_x(desni+1:noviLast) = vector_x(desni)+korak:korak:vector_x(desni)+korak*N_newPoints;
result_y(desni+1:noviLast) = exp(linijaX(result_x(desni+1:noviLast), slope, inter));
