#include <bits/stdc++.h>
using namespace std;
struct point{
double x,y;
point(double A,double B){
x=A,y=B;
}
point() = default;
};
struct line{
point point_A,point_B;
line(point A,point B){
point_A = A,point_B = B;
}
line() = default;
};
double chang(point A,point B){
double a1;
a1=sqrt(pow(A.x-B.x,2)+pow(A.y-B.y,2));
return a1;
}
double getDistance(point P, line L){
// TODO: 计算点P到直线L的距离
double b1,b2,b3;
b1=chang(P,L.point_A);
b2=chang(P,L.point_B);
b3=chang(L.point_B,L.point_A);
double M=(b1+b2+b3)/2;
double N;
N=sqrt(M*(M-b1)*(M-b2)*(M-b3));
return N*2/b3;
}
int main(){
int a, b, sx, sy, tx, ty;
cin >> a >> b >> sx >> sy >> tx >> ty;
point A(sx, sy), B(tx, ty), C(a, b);
line L(A, B);
printf("%.2lf", getDistance(C, L));
return 0;
}