close all
clear all

X0 = [ 0 100 100 0 50];
Y0 = [0 0 100 100 50];

C0 = 1400;

N = length(X0);

Tij = zeros(N,N);
for i = 1:N
    for j = 1:N
     Tij(i,j) = 2*sqrt((X0(i)-X0(j))^2+(Y0(i)-Y0(j))^2)/C0;       
    end
end

%Introduce random error 
TijMean =  mean(mean(Tij));
Error = .2*TijMean*(rand(N)-.5);
Tij = Tij+Error;

[c nu] = SpeedOfSound(X0,Y0,Tij);


C = c;

[X Y nu] = ComputePositions( Tij, c, X0, Y0);


figure;
grid on;
hold on;
axis([-10 110 -10 110]);
plot(X0,Y0,'x',X,Y,'o');
