function [x,y]=blah(t1,t2,t3)

x1=3;
x2=0;
x3=3;
y1=0;
y2=3;
y3=3;
z1=3;
z2=3;
z3=3;

ss=340.3;

goal=1e-4;

A=[-2*x1 -2*y1; -2*x2 -2*y2;-2*x3 -2*y3]
x=5
y=5
r1=ss*t1;
r2=ss*t2;
r3=ss*t3;
C=(inv(A'*A)*A');
x=1.5;
y=1.5;

for i=1:1:100
  xold=x;
  yold=y;
  b=[r1^2-z1^2-x1^2-x^2-y1^2-y^2;
     r2^2-z2^2-x2^2-x^2-y2^2-y^2;
     r3^2-z3^2-x3^2-x^2-y3^2-y^2];
  tem=C*b;
  x=tem(1);
  y=tem(2);
  error=(abs(x-xold)+abs(y-yold))/2;
  fprintf('Iteration: %i, x=%f, y=%f\n',i,x,y)
  if error<goal
    break
  end
end
