#include <iostream>
#include <cstdlib>
#include <fstream>
#include <clocale>
#include <cmath>
#include <iomanip>
#define iFILE "input.txt"
#define oFILE "output.txt"
class Point {
public: double x;
public: double y;
};
int main(){setlocale(LC_ALL,"Rus");
std::ifstream inp;inp.open(iFILE);
while(!inp.is_open()){
std::cout << "Файл не найден." << std::endl;
system("pause");
return 0;
}
Point A,B,C;
inp >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y;
std::ofstream ofs;ofs.open(oFILE);
if( A.y<C.y && A.y>B.y ||
A.y<B.y && A.y>C.y){
double AB = sqrt(pow(C.x-A.x ,2.0)+pow(C.y-A.y ,2.0));
double AC = sqrt(pow(C.x-A.x ,2.0)+pow(C.y-A.y ,2.0));
double CB = sqrt(pow(C.x-B.x ,2.0)+pow(C.y-B.y ,2.0));
double p = (AB+AC+CB)/2;
double S = sqrt(p*(p-AB)*(p-AC)*(p-CB));
double Ah = (2*S)/CB;
ofs << std::fixed << std::setprecision(4) << Ah;
}
else if(A.y==C.y && A.y>B.y || A.y==B.y && A.y>C.y){
double Ah = sqrt(pow(C.x-A.x ,2.0)+pow(C.y-A.y ,2.0));
ofs << std::fixed << std::setprecision(4) << Ah;
}
else
ofs << -1;
ofs.close();
inp.close();
return 0;
}