% 2 dimensional Eucledian distance
clear
px=randn(1, 100)-1; py=randn(1,100)-1;
qx=randn(1, 100)+1; qy=randn(1,100)+1;
plot(px,py,'bx');
hold on;
plot(qx,qy, 'gx');
xlabel('feature s1');
ylabel('feature s2');
hold on;
T_px=mean(px); T_py=mean(py);
T_qx=mean(qx); T_qy=mean(qy);
plot(T_px,T_py,'rs');
plot(T_qx,T_qy,'ro');
axis([-5,5,-5,5]);
grid on;
for x=-5:0.1:5
    for y=-5:0.1:5
        dp=(x-T_px)^2+(y-T_py)^2;
        dq=(x-T_qx)^2+(y-T_qy)^2;
        if abs(dp-dq)<0.2 plot(x,y,'k.');
        end
    end
end

hold off;
