xxxxxxxxxx
pto1 = [3.4353 0.2521];
pto2 = [39.5904 -20.6633];
% A vector along the ray from pto1 to pto2
V = pto2 - pto1;
% The distance between the points would be:
% dist12 = norm(V);
% but there is no need to compute it.
% which will be extended (by 20% in this case) here
factor_distance = 1.2;
% Extend the ray
pext = pto1 + V*factor_distance;
% plot
plot([pto1(1),pto2(1)],[pto1(2),pto2(2)],'bo',[pto1(1),pext(1)],[pto1(2),pext(2)],'r-')