#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 getDistance(point P, line L){
// TODO: 计算点P到直线L的距离
double t1=sqrt(pow((L.point_A.x-P.x),2)+pow((L.point_A.y-P.y),2));
double t2=sqrt(pow((L.point_B.x-P.x),2)+pow((L.point_B.y-P.y),2));
double t3=sqrt(pow((L.point_A.x-L.point_B.x),2)+pow((L.point_A.y-L.point_B.y),2));
double s = (t1 + t2 + t3) / 2;
double area = sqrt(s * (s - t1) * (s - t2) * (s - t3));
double res = 2 * area / t3;
return res;
}
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;
}