import java.io.*;
import java.util.*;
import static java.lang.Math.*;

public class bike_as {
    private final static double EPS = 1e-7;

    double angle(double x, double y) {
        double d1 = min(abs(x - y), min(abs(2 * PI + x - y), abs(x - 2 * PI - y)));
        double d2 = min(abs(2 * PI - abs(x - y)), min(abs(2 * PI - abs(2 * PI + x - y)), abs(2 * PI - abs(x - 2 * PI - y))));
        return min(d1, d2);
    }

    public void run() throws IOException {
        Scanner in = new Scanner(new File("bike.in"));
        PrintWriter out = new PrintWriter(new File("bike.out"));
        PrintWriter mp = new PrintWriter(new File("bike.mp"));

        double d = in.nextDouble();
        double r = in.nextDouble();
        assert 2 * r < d - EPS;

        double x1 = in.nextDouble();
        double y1 = in.nextDouble();
        double x2 = in.nextDouble();
        double y2 = in.nextDouble();

        double u = in.nextDouble();
        double v = in.nextDouble();
        assert u >= v;

        double[][] a = new double[14][14];
        for (int i = 0; i < 14; i++) {
            Arrays.fill(a[i], -1);
        }
        a[0][1] = a[1][0] = hypot(x1 - x2, y1 - y2) / v;

        assert abs(hypot(x1, y1) - r) < EPS;
        double a1 = atan2(y1, x1);
        assert abs(hypot(x2, y2 - d) - r) < EPS;
        double a2 = atan2(y2 - d, x2);

        double alpha = asin(v / u);

        a[0][2] = a[2][0] = r * angle(a1, PI / 2 - alpha) / u;
        a[0][3] = a[3][0] = r * angle(a1, PI - (PI / 2 - alpha)) / u;
        a[1][4] = a[4][1] = r * angle(a2, - (PI / 2 - alpha)) / u;
        a[1][5] = a[5][1] = r * angle(a2, - PI + (PI / 2 - alpha)) / u;

        a[2][4] = a[4][2] = (d - 2 * r * cos(alpha)) / v;
        a[3][5] = a[5][3] = (d - 2 * r * cos(alpha)) / v;

        double gamma = PI / 2 - (alpha - asin((r * sin(PI - alpha)) / (d / 2)));

        a[0][6] = a[6][0] = r * angle(a1, gamma) / u;
        a[0][7] = a[7][0] = r * angle(a1, PI - gamma) / u;
        a[1][8] = a[8][1] = r * angle(a2, -gamma) / u;
        a[1][9] = a[9][1] = r * angle(a2, -PI + gamma) / u;

        a[6][9] = a[9][6] = hypot(2 * r * cos(gamma), d - 2 * r * sin(gamma)) / v;
        a[7][8] = a[8][7] = hypot(2 * r * cos(gamma), d - 2 * r * sin(gamma)) / v;

        double beta = atan2(y2, x2);
        double d1 = hypot(x2, y2);
        double delta = alpha - asin(r * sin(PI - alpha) / d1);
        a[0][10] = a[10][0] = r * angle(a1, beta + delta) / u;
        a[1][10] = a[10][1] = hypot(x2 - r * cos(beta + delta), y2 - r * sin(beta + delta)) / v;
        a[0][11] = a[11][0] = r * angle(a1, beta - delta) / u;
        a[1][11] = a[11][1] = hypot(x2 - r * cos(beta - delta), y2 - r * sin(beta - delta)) / v;

        beta = atan2(y1 - d, x1);
        double d2 = hypot(y1 - d, x1);
        delta = alpha - asin(r * sin(PI - alpha) / d2);
        a[1][12] = a[12][1] = r * angle(a2, beta + delta) / u;
        a[0][12] = a[12][0] = hypot(x1 - r * cos(beta + delta), y1 - (d + r * sin(beta + delta))) / v;
        a[1][13] = a[13][1] = r * angle(a2, beta - delta) / u;
        a[0][13] = a[13][0] = hypot(x1 - r * cos(beta - delta), y1 - (d + r * sin(beta - delta))) / v;

        for (int i = 0; i < 14; i++) {
            for (int j = 0; j < 14; j++) {
                for (int k = 0; k < 14; k++) {
                    if (a[j][i] >= -EPS && a[i][k] >= -EPS) {
                        if (a[j][k] < -EPS || a[j][k] > a[j][i] + a[i][k]) {
                            a[j][k] = a[j][i] + a[i][k];
                        }
                    }
                }
            }
        }

        out.printf("%.10f\n", a[0][1]);

        in.close();
        out.close();
        mp.close();
    }

    public static void main(String[] arg) throws IOException {
    	Locale.setDefault(Locale.US);
        new bike_as().run();
    }
}
