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

public class bike_as_numeric {

    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();

        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 a1 = atan2(y1, x1);
        double a2 = atan2(y2 - d, x2);

        double alpha = asin(v / u);

        double best = hypot(x1 - x2, y1 - y2) / v;
        double besta = 0;
        double bestb = 0;
        for (double a = 0; a < 2 * PI; a += 0.01) {
            for (double b = 0; b < 2 * PI; b += 0.01) {
                double dist = r * angle(a1, a) / u + r * angle(a2, b) / u + hypot(r * cos(a) - r * cos(b), r * sin(a) - (d + r * sin(b))) / v;
                if (dist < best) {
                    best = dist;
                    besta = a;
                    bestb = b;
                }
            }
        }

        out.printf("%.10f\n", best);

        double scale = 20 / (2 * d + r);
        mp.printf("u=%.10fcm;\n", scale);
        mp.printf("beginfig(1)\n");
        mp.printf("draw (%.10fu,%.10fu)..(%.10fu,%.10fu)..(%.10fu,%.10fu)..(%.10fu,%.10fu)..cycle;\n", 0.0, r, r, 0.0, 0.0, -r, -r, 0.0);
        mp.printf("draw (%.10fu,%.10fu)..(%.10fu,%.10fu)..(%.10fu,%.10fu)..(%.10fu,%.10fu)..cycle;\n", 0.0, d + r, r, d, 0.0, d-r, -r, d);

        mp.printf("draw (%.10fu,%.10fu)--(%.10fu,%.10fu);\n", r * cos(besta), r * sin(besta), r * cos(bestb), d + r * sin(bestb));

        mp.printf("pickup pencircle scaled 2pt;\n");
        mp.printf("drawdot (%.10fu, %.10fu);\n", x1, y1);
        mp.printf("drawdot (%.10fu, %.10fu);\n", x2, y2);
        mp.printf("endfig;");
        mp.printf("end.");

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

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