#include <iostream>
#include <iomanip>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
using namespace std;
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};
struct C{
    P p;
    double r;
    C(const P& p, const double& r) : p(p), r(r) {}
    C(){}
};

namespace std{
    bool operator < (const P& a, const P& b){
        return !EQ(a.X,b.X) ? a.X<b.X : a.Y+EPS<b.Y;
    }
    bool operator == (const P& a, const P& b){
        return abs(a-b) < EPS;
    }
}

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
int ccw(P a, P b, P c){
    b -= a;
    c -= a;
    if(cross(b,c) > EPS) return +1; //ccw
    if(cross(b,c) < -EPS) return -1; //cw
    if(dot(b,c) < -EPS) return +2; //c-a-b
    if(abs(c)-abs(b) > EPS) return -2; //a-b-c
    return 0; //a-c-b
}
P unit(const P &p){
    return p/abs(p);
}
P rotate(const P &p, double rad){
    return p *P(cos(rad), sin(rad));
}

bool intersectSS(const L& a, const L& b){
    return ( ccw(a[0],a[1],b[0]) *ccw(a[0],a[1],b[1]) <= 0 ) &&
        ( ccw(b[0],b[1],a[0]) *ccw(b[0],b[1],a[1]) <= 0 );
}

P projection(const L& l, const P& p) {
    double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
    return l[0] + t*(l[0]-l[1]);
}
double distanceLP(const L &l, const P &p) {
    return abs(cross(l[1]-l[0], p-l[0])) /abs(l[1]-l[0]);
}

P crosspointLL(const L &l, const L &m) {
  double A = cross(l[1]-l[0], m[1]-m[0]);
  double B = cross(l[1]-l[0], l[1]-m[0]);
  return m[0] + B/A *(m[1]-m[0]);
}

VP crosspointCC(C a, C b){
    VP ret;
    if(a.p == b.p && a.r == b.r){
        return ret;
    }
    if(a.r < b.r) swap(a,b);
    double dist = abs(b.p-a.p);
    P dir = a.r*unit(b.p-a.p);
    if(EQ(dist, a.r+b.r) || EQ(dist, a.r-b.r)){
        ret.push_back(a.p +dir);
    }else if(a.r-b.r < dist && dist < a.r+b.r){
        double cos = (a.r*a.r +dist*dist -b.r*b.r)/(2*a.r*dist);
        double sin = sqrt(1 -cos*cos);
        ret.push_back(a.p +dir*P(cos, sin));
        ret.push_back(a.p +dir*P(cos, -sin));
    }
    return ret;
}

bool isValid(const P &p){
	return -100 < p.X +EPS && p.X < 100 +EPS &&
		-100 < p.Y +EPS && p.Y < 100 +EPS &&
		EQ(p.X, round(p.X)) && EQ(p.Y, round(p.Y));			
}

double solve(const VP &tri, const P &p, const P &q){
	//p,qを置く位置が不正
	if(!isValid(p) || !isValid(q)) return INF;
	if(cross(tri[0] -tri[1], p -tri[1]) < EPS) return INF*2;
	if(cross(tri[2] -tri[0], q -tri[0]) < EPS) return INF*3;
	if(intersectSS(L(tri[1], p), L(tri[0], q))) return INF*4;
	if(intersectSS(L(tri[0], p), L(tri[2], q))) return INF*5;

	//もう1つの点rの位置
	VP cp = crosspointCC(C(tri[1], abs(tri[1] -p)), C(tri[2], abs(tri[2] -q)));
	if((int)cp.size()!=2) return INF;
	P r = (cross(tri[1] -tri[2], cp[0] -tri[2]) > EPS)? cp[0]: cp[1];
	if(!isValid(r)) return INF;

	//四面体の高さを計算
	P cpll = crosspointLL(L(p, projection(L(tri[0], tri[1]), p)), 
		L(q, projection(L(tri[2], tri[0]), q)));
	double d = distanceLP(L(tri[0], tri[1]), p);
	double a = distanceLP(L(tri[0], tri[1]), cpll);
    if(EQ(d, a)) return INF;
	return sqrt(d*d -a*a);
}

int main(){
	vector<VP> ltoxy(80001);
	for(int x=0; x<=200; x++){
		for(int y=0; y<=200; y++){
			int lsq = x*x +y*y;
			ltoxy[lsq].emplace_back(x, y);
            if(x != 0){
                ltoxy[lsq].emplace_back(-x, y);
            }
			if(y != 0){
                ltoxy[lsq].emplace_back(x, -y);
            }
			if(x != 0 && y != 0){
                ltoxy[lsq].emplace_back(-x, -y);
            }
		}
	}

    while(1){
    	VP tri(3);
    	P ori(0, 0);
    	for(int i=0; i<3; i++){
    		int x,y;
    		cin >> x >> y;
    		tri[i] = P(x, y);
    	}
    	if(tri[0]==ori && tri[1]==ori && tri[2]==ori){
    		break;
    	}

    	double ans = INF;
    	for(int l=1; l<(int)ltoxy.size(); l++){
    		for(const P &p: ltoxy[l]){
    			for(const P &q: ltoxy[l]){
    				ans = min(ans, solve(tri, tri[0]+p, tri[0]+q));
    			}
    		}
    	}
    	if(ans == INF){
    		cout << -1 << endl;
    	}else{
	    	cout << fixed << setprecision(10);
    		cout << ans << endl;
    	}
    }
    return 0;
}


Measured memory_bytes: 7428