#include<iostream>
#include<complex>
#include<cmath>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define mp         make_pair

const double eps = 1e-10;

typedef complex<int> P;
typedef complex<double> DP;

class Tri{
public:
  //  P d[3];
  int x[3],y[3];
};


inline double compute_dist(double x,double y){
  return sqrt(x*x+y*y);
}

int double_to_int(double &a){
  if (a <0)return (int)(a-0.5);
  else return     (int)(a+0.5);
}

bool isint(double a){
  if (a <0){
    if ( fabs((int)(a-0.5)-a)<eps)return true;
  }else {
    if ( fabs((int)(a+0.5)-a)<eps)return true;
  }
  return false;
}

double myabs(P a){
  return sqrt(a.real()*a.real()+a.imag()*a.imag());
}

inline void CC_intersection(int &ax,int &ay,int &bx,int &by,double &r1,double &r2,double &d,
			    double &x1,double &y1,double &x2,double &y2){
  double l,m,n;
  double x,y;
  double p,q;
  l=(d*d-r2*r2+r1*r1)/(2*d);
  
  x=ax+(bx-ax)*l/d;
  y=ay+(by-ay)*l/d;
  n=sqrt(r1*r1-l*l);
  p=(by-ay)/d*n;
  q=(bx-ax)/d*n;
  
  x1=x+p;
  y1=y-q;

  x2=x-p;
  y2=y+q;
}

int is_intersected_circle(int &ax,int &ay,int &bx,int &by,
			  double &r1,double& r2,double &d){
  d = compute_dist(ax-bx,ay-by);
  if (d<eps && fabs(r1-r2)<eps)return 3;
  if (d+r2 < r1)return 0;
  if (d+r1 < r2)return 1;
  if (d > r1+r2)return 4;
  return 2;
}

//inline double cross(P a,P b){
inline double cross(double ax,double ay,double bx,double by){
  return ax*by - ay*bx;
}

inline double dot(double ax,double ay,double bx,double by){
  return ax*bx+ay*by;}

inline bool isp(int &ax,int & ay,int & bx,int & by,int & cx,int & cy){
  double tmp1=cross(bx-ax,by-ay,cx-ax,cy-ay);
  double tmp2=dot(bx-ax,by-ay,cx-ax,cy-ay);
  return tmp1<eps&&tmp1>-eps&&tmp2<eps&&tmp2>-eps;
}

inline bool is_intersected_ls(int &a1x,int &a1y,
			      int &a2x,int &a2y,
			      int &b1x,int &b1y,
			      int &b2x,int &b2y){
  if (  ( cross(a2x-a1x,a2y-a1y,b1x-a1x,b1y-a1y)
	  * cross(a2x-a1x,a2y-a1y,b2x-a1x,b2y-a1y)<-eps ) && 
	( cross(b2x-b1x,b2y-b1y,
		a1x-b1x,a1y-b1y)*
	  cross(b2x-b1x,b2y-b1y,
		a2x-b1x,a2y-b1y)<-eps))
    return true;
  return false;
}

inline bool is_in(int *inx,int *iny,int &ax,int& ay){
  int cnt =0;
  int n = 3;
  rep(i,n){
    //    P cur = in[i],next=in[(i+1)%n];
    int curx=inx[i],cury=iny[i];
    int nextx=inx[(i+1)%n],nexty=iny[(i+1)%n];
    curx-=ax;
    cury-=ay;
    nextx-=ax;
    nexty-=ay;
    if (cury > nexty)swap(curx,nextx),swap(cury,nexty);
    if (cury<0 && 0<=nexty &&
	cross(nextx,nexty,curx,cury)>=0)cnt++;
    if (isp(inx[i],iny[i],inx[(i+1)%n],iny[(i+1)%n],ax,ay))return true;
  }
  if (cnt %2 == 1)return true;
  else return false;
}

inline double distance_l_p(int &ax,int &ay,int &bx,int &by,int &cx,int &cy){
  return fabs(cross(bx-ax,by-ay,cx-ax,cy-ay))/compute_dist(bx-ax,by-ay);
}

inline DP vector_mapping(int &ax,int &ay,int& bx,int& by,int &cx,int &cy){
  double tmp = distance_l_p(ax,ay,bx,by,cx,cy);
  double tmp2= compute_dist(cx-ax,cy-ay);
  double C   = sqrt(tmp2*tmp2-tmp*tmp+eps);
  if (dot(bx-ax,by-ay,cx-ax,cy-ay)<0)C*=-1;
  DP e(bx-ax,by-ay);
  DP A(ax,ay);
  e/=compute_dist(bx-ax,by-ay);
  e*=C;
  return A + e;
}


inline double solve_linear(double A1,double B1,double C1,
		    double A2,double B2,double C2,
			   double x2,double y2,double d2
		    ){
  if (fabs(A1*B2-A2*B1)<1e-8|| fabs(A1)<eps){
    return -1;
  }
  double y = (A1*C2-A2*C1)/(A1*B2-A2*B1);
  double x = (C1-B1*y)/A1;
  double z = d2*d2 - (x-x2)*(x-x2) - (y-y2)*(y-y2);
  if (z < 1e-4)return -1;

  return sqrt(z);
  if (isnan(z)||z<0)return -1;
  else return sqrt(z);
}


/*
void output(Tri in[4],double tmp){
  cout <<tmp << endl;
  rep(i,4){
    cout <<"[";
    rep(j,3){
      cout <<in[i].d[j] << ",";
    }
    cout <<in[i].d[0] << ",],"<< endl;
  }
}
*/


double ans;
inline void compute_height(Tri in[4]){
  DP data[3];
  double r[3];
  REP(i,1,4){
    data[i-1]=vector_mapping(in[i].x[0],in[i].y[0],
			     in[i].x[1],in[i].y[1],
			     in[i].x[2],in[i].y[2]
			     );
    r[i-1]   =  distance_l_p(in[i].x[0],in[i].y[0],
			     in[i].x[1],in[i].y[1],
			     in[i].x[2],in[i].y[2]
			     );
  }
  double tmp = solve_linear(2*(data[1].real()-data[0].real()),
			    2*(data[1].imag()-data[0].imag()),
			    r[0]*r[0]-r[1]*r[1]
			    -(data[0].real()*data[0].real()-data[1].real()*data[1].real())
			    -(data[0].imag()*data[0].imag()-data[1].imag()*data[1].imag()),
			    2*(data[1].real()-data[2].real()),
			    2*(data[1].imag()-data[2].imag()),
			    r[2]*r[2]-r[1]*r[1]
			    -(data[2].real()*data[2].real()-data[1].real()*data[1].real())
			    -(data[2].imag()*data[2].imag()-data[1].imag()*data[1].imag()),
			    data[1].real(),data[1].imag(),r[1]
			    );
  if (tmp < 0.00001||isnan(tmp));
  else {
    ans = min(ans,tmp);
    return;
  }
  return;
}

inline bool isvalid(Tri in[4],int now){
  rep(j,3){
    if ((int)(in[now].x[j])<-100||(int)(in[now].x[j])>100 ||
	(int)(in[now].y[j])<-100||(int)(in[now].y[j])>100){
      return false;
    }

  }


  rep(j,now){
    rep(k,3){
      if (is_intersected_ls(in[now].x[0]    ,in[now].y[0],
			    in[now].x[2]    ,in[now].y[2],
			    in[j].x[k]      ,in[j].y[k],
			    in[j].x[(k+1)%3],in[j].y[(k+1)%3])){
	return false;
      }
      if (is_intersected_ls(in[now].x[1],in[now].y[1],
			    in[now].x[2],in[now].y[2],
			    in[j].x[k]  ,in[j].y[k],
			    in[j].x[(k+1)%3],in[j].y[(k+1)%3])){
	return false;
      }

      if (isp(in[j].x[k]      ,in[j].y[k],
	      in[j].x[(k+1)%3],in[j].y[(k+1)%3],
	      in[now].x[2]    ,in[now].y[2])){
	return false;
      }

    }

    
    if (is_in(in[j].x,in[j].y,in[now].x[2],in[now].y[2])){
      return false;
    }

    if (j != 0 && fabs(in[now].x[2]-in[j].x[2])<1e-8 &&
	          fabs(in[now].y[2]-in[j].y[2])<1e-8){
      return false;
    } 


  }
  return true;

}


inline void decide3(Tri in[4],double &dist2){
  //  double dist1=myabs(in[1].d[0]-in[1].d[2]);
  double dist1=compute_dist(in[1].x[0]-in[1].x[2],in[1].y[0]-in[1].y[2]);
  P c1(in[3].x[1],in[3].y[1]);
  P c2(in[3].x[0],in[3].y[0]);

  double tx1,tx2,ty1,ty2,d;
  int x1,x2,y1,y2;
  if (is_intersected_circle(c1.real(),c1.imag(),c2.real(),c2.imag(),dist1,dist2,d) == 2){
    CC_intersection(c1.real(),c1.imag(),c2.real(),c2.imag(),dist1,dist2,d,tx1,ty1,tx2,ty2);

    if (isint(tx1)&&isint(ty1)){
      x1=double_to_int(tx1);
      y1=double_to_int(ty1);
      in[3].x[2]=x1;
      in[3].y[2]=y1;
      if (isvalid(in,3))compute_height(in);
    }
	
    if (isint(tx2)&&isint(ty2)){
      x2=double_to_int(tx2);
      y2=double_to_int(ty2);
      in[3].x[2]=x2;
      in[3].y[2]=y2;
      if (isvalid(in,3))compute_height(in);
    }
  }
}

inline void decide2(Tri in[4]){
  //  double dist =myabs(in[1].d[1]-in[1].d[2]);
  double dist=compute_dist(in[1].x[1]-in[1].x[2],in[1].y[1]-in[1].y[2]);
  int lim = (int)(dist+0.1);
  for(int x=0;x<=lim;x++){
    double ty = sqrt(dist*dist-x*x+eps);
    if ( !isint(ty))continue;
    int y = double_to_int(ty);
    in[2].x[2]=in[2].x[0]+x;
    in[2].y[2]=in[2].y[0]+y;
    //    double dist2=myabs(in[2].d[2]-in[2].d[1]);
    double dist2=compute_dist(in[2].x[2]-in[2].x[1],in[2].y[2]-in[2].y[1]);
    if (isvalid(in,2))decide3(in,dist2);
    in[2].y[2]=in[2].y[0]-y;
    //dist2 = myabs(in[2].d[2]-in[2].d[1]);
    dist2=compute_dist(in[2].x[2]-in[2].x[1],in[2].y[2]-in[2].y[1]);
    if (isvalid(in,2))decide3(in,dist2);
    
    in[2].x[2]=in[2].x[0]-x;
    in[2].y[2]=in[2].y[0]+y;
    //    dist2 = myabs(in[2].d[2]-in[2].d[1]);
    dist2=compute_dist(in[2].x[2]-in[2].x[1],in[2].y[2]-in[2].y[1]);
    if (isvalid(in,2))decide3(in,dist2);
    
    in[2].y[2]=in[2].y[0]-y;
    //    dist2 = myabs(in[2].d[2]-in[2].d[1]);
    dist2=compute_dist(in[2].x[2]-in[2].x[1],in[2].y[2]-in[2].y[1]);
    if (isvalid(in,2))decide3(in,dist2);
    
  }
}

inline void decide1(Tri in[4]){
  REP(y,-100,101){
    REP(x,-100,101){
      in[1].x[2]=x;
      in[1].y[2]=y;
      if (isvalid(in,1))decide2(in);
    }
  }
}

main(){
  Tri in[4];
    
  while(cin>>in[0].x[0]>>in[0].y[0]
	>>in[0].x[1]>>in[0].y[1]
	>>in[0].x[2]>>in[0].y[2]){

    if (in[0].x[0] == 0 && in[0].y[0] == 0 &&
	in[0].x[1] == 0 && in[0].y[1] == 0 &&
	in[0].x[2] == 0 && in[0].y[2] == 0)break;
    
    in[1].x[0]=in[0].x[0];    in[1].y[0]=in[0].y[0];
    in[1].x[1]=in[0].x[1];    in[1].y[1]=in[0].y[1];

    in[2].x[0]=in[0].x[1];    in[2].y[0]=in[0].y[1];
    in[2].x[1]=in[0].x[2];    in[2].y[1]=in[0].y[2];
    
    in[3].x[0]=in[0].x[2];    in[3].y[0]=in[0].y[2];
    in[3].x[1]=in[0].x[0];    in[3].y[1]=in[0].y[0];

    ans = 1e100;
    decide1(in);
    if (ans >1e99)printf("-1\n");
    else printf("%.7lf\n",ans);
  }
}

Measured memory_bytes: 956