#include <bits/stdc++.h>
#include <cmath>
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的距离
int A = L.point_B.y - L.point_A.y;
int B = L.point_A.x - L.point_B.x;
int C = L.point_B.x * L.point_A.y - L.point_A.x * L.point_B.y;
double x0 = P.x;
double y0 = P.y;
double up = ((A * x0 + B * y0 + C) > 0 ? (A * x0 + B * y0 + C) : -(A * x0 + B * y0 + C));
double down = sqrt(A * A + B * B);
double shu = up / down;
return shu;
}
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;
}