clear all;close all;clc

x=[-1 1.2];
y=[2 1];


af=atan2(x(1)-x(2),y(2)-y(1))+pi;
r=x(1)*cos(af)+y(1)*sin(af);

plot(x,y)

hold on
axis([-5 5 -5 5])
axis square
grid on

plot([0 r*cos(af)],[0 r*sin(af)],'r')
