#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){
    double a1=L.point_A.x-L.point_B.x;
    double a2=L.point_A.y-L.point_B.y;
    double b1=P.y-L.point_A.y;
    double b2=P.x-L.point_A.x;
   return abs(a1*b1-a2*b2) /(sqrt(a1*a1+a2*a2));
}
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;
}