// Arup Guha
// Started 4/3/2014 finished 4/4/2014
// Solution to 2014 Chicago Invitational (NAIPC) Problem A: Banjo.

// Note: I used the judge data and my ternary search is very unstable. So, I played
//       with my parameters for a while before I got all test cases to pass. There
//       must be some way to reduce this error I am getting.

import java.util.*;

public class a {

	final public static int SIZE = 8;

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		int[] buffer = new int[SIZE];
		for (int i=0; i<SIZE; i++) buffer[i] = stdin.nextInt();

		// In regular cases, radius must be positive...
		while (buffer[6] != 0) {

			// Copy data.
			pt start = new pt(buffer[0], buffer[1]);
			pt end = new pt(buffer[2], buffer[3]);
			pt center = new pt(buffer[4], buffer[5]);
			banjo.radius = buffer[6];
			banjo.walklen = buffer[7];

			// Original problem.
			banjo original = new banjo(start, end, center);

			// New equivalent instance with start at origin and end on positive x-axis.
			banjo temp = original.translate(-start.x, -start.y);
			banjo checkEasy = temp.rotate(-start.getAngle(end));

			if (checkEasy.canGoStraight()) {
				System.out.printf("%.2f\n", start.dist(end));
			}


			else {

				// This is the equivalent instance we'll solve. start = (0,0), center is on positive x-axis, end in quadrant 1.
				banjo problem = original.translate(-start.x, -start.y).rotate(-start.getAngle(center));
				if (problem.endYIsNeg()) problem.flipHorizEnd();
				banjo.setAngleOneT();

				if (DEBUG) System.out.println(problem);

				// Well, this will really be a ternary search, sorry!
				double[] binSearchBounds = problem.getbinSearchBounds();

				// Farm this out to solve using two ternary searches.
				System.out.printf("%.2f\n", solve(problem, binSearchBounds));
			}
			for (int i=0; i<SIZE; i++) buffer[i] = stdin.nextInt();
		}
	}

	// Outer ternary search, on "left" side.
	public static double solve(banjo problem, double[] searchBounds) {

		// Use tangent lines
		if (banjo.walklen == 0) {
			return solveInstance(problem, searchBounds[0], searchBounds[3]);
		}

		double low = searchBounds[0];
		double high = searchBounds[1];
		double best = 100000;

		// Outer ternary search.
		for (int loop=0; loop<40; loop++) {

			// The trickiness is this factor delta...
			double mid = (low+high)/2;
			double delta = Math.min((high-low)/100,1e-5);

			// I try both sides to look for an issue.
			double tmp = solveBest(problem, mid, searchBounds[2], searchBounds[3]);
			double left = solveBest(problem, mid-delta, searchBounds[2], searchBounds[3]);
			double right = solveBest(problem, mid+delta, searchBounds[2], searchBounds[3]);
			if (tmp < best) best = tmp;

			// Reset high or low.
			if (left < tmp || right > tmp) high = mid;
			else            low = mid;
		}

		return best;
	}

	// Inner ternary search where the angle on the left is fixed to leftAngle.
	public static double solveBest(banjo problem, double leftAngle, double low, double high) {

		double best = 100000;

		for (int loop=0; loop<40; loop++) {

			// The trickiness is this factor delta...
			double mid = (low+high)/2;
			double delta = Math.min((high-low)/100,1e-5);

			// I try both sides to look for an issue.
			double tmp = solveInstance(problem, leftAngle, mid);
			double left = solveInstance(problem, leftAngle, mid-delta);
			double right = solveInstance(problem, leftAngle, mid+delta);

			// Reset high or low.
			if (tmp < best) best = tmp;
			if (left < tmp || right > tmp) high = mid;
			else            low = mid;
		}

		return best;
	}

	public static double solveInstance(banjo problem, double left, double right) {

		// Points of intersection with circle.
		pt leftPt = problem.ptOnCircleAtAngle(left);
		pt rightPt = problem.ptOnCircleAtAngle(right);

		// Add up straight line segments to circle.
		double ans = problem.start.dist(leftPt) + problem.end.dist(rightPt);

		// Special case, can't walk in circle...
		if (banjo.walklen == 0) return ans + problem.radius*(left-right);

		// Add up the full walks inside the circle, all of the maximum walk length.
		double fullAngle = left-right;
		int fullWalks = (int)(fullAngle/banjo.angleOneT);
		ans += banjo.walklen*fullWalks;

		// The angle left to traverse.
		double leftOverAngle = fullAngle - fullWalks*banjo.angleOneT;

		// Last little bit we cut through the circle.
		ans += banjo.getChordLength(leftOverAngle);

		// At long last =)
		return ans;
	}
}

class pt {

	public double x;
	public double y;

	public pt(double myx, double myy) {
		x = myx;
		y = myy;
	}

	public pt translate(double dx, double dy) {
		return new pt(x+dx,y+dy);
	}

	public pt rotate(double angle) {
		return new pt(x*Math.cos(angle) - y*Math.sin(angle), x*Math.sin(angle) + y*Math.cos(angle));
	}

	public double getAngle(pt end) {
		return Math.atan2(end.y-y, end.x-x);
	}

	public pt horizFlip() {
		return new pt(x,-y);
	}

	public double dist(pt other) {
		return Math.sqrt(Math.pow(x-other.x,2) + Math.pow(y-other.y,2));
	}

	public String toString() {
		return "("+x+", "+y+")";
	}
}

class banjo {

	public pt start;
	public pt end;
	public pt center;

	// Will read these in directly.
	public static int radius;
	public static int walklen;
	public static double angleOneT;

	final public static boolean DEBUG = false;

	public banjo(pt a, pt b, pt c) {
		start = a;
		end = b;
		center = c;
	}

	public banjo translate(double dx, double dy) {
		return new banjo(start.translate(dx,dy), end.translate(dx,dy), center.translate(dx,dy));
	}

	public banjo rotate(double angle) {
		return new banjo(start.rotate(angle), end.rotate(angle), center.rotate(angle));
	}

	// Pre-condition: start must be origin and end must be on the positive x-axis.
	public boolean canGoStraight() {

		// Either tangent or no intersection.
		double disc = radius*radius - center.y*center.y;
		if (disc <= 0) return true;

		double minX = center.x - Math.sqrt(disc);
		double maxX = center.x + Math.sqrt(disc);

		// Circle intersection is either to the left or right of the line segment start to end.
		if (maxX <= 0 || minX >= end.x) return true;

		// Otherwise, the secant line is exactly twice the discriminant =)
		return 2*Math.sqrt(disc) <= walklen;
	}

	public void flipHorizEnd() {
		end = end.horizFlip();
	}

	public boolean endYIsNeg() {
		return end.y < 0;
	}

	public static void setAngleOneT() {
		angleOneT = Math.acos(1-1.0*walklen*walklen/(2*radius*radius));
	}

	public double[] getbinSearchBounds() {

		double[] ans = new double[4];

		// Intersect tangent line with circle for low bound.
		double angleUp = Math.asin(radius/start.dist(center));

		// Set up quadratic for interection. Since we never use the discriminant, which must be 0, we can just use a and b for the root.
		double a = 1 + Math.pow(Math.tan(angleUp), 2);
		double b = -2*center.x;

		// Point of intersection.
		double x = -b/(2*a);
		double y = Math.sqrt(radius*radius-Math.pow(center.x-x,2));
		ans[0] = Math.atan2(y,x-center.x);

		// Intersect start-end with circle for high bound.
		angleUp = Math.atan2(end.y,end.x);
		a = 1 + Math.pow(Math.tan(angleUp), 2);
		b = -2*center.x;
		double c = center.x*center.x - radius*radius;
		x = (-b-Math.sqrt(b*b-4*a*c))/(2*a);
		y = Math.sqrt(radius*radius-Math.pow(center.x-x,2));
		ans[1] = Math.atan2(y,x-center.x);

		// Get this intersection for free!
		x = (-b+Math.sqrt(b*b-4*a*c))/(2*a);
		y = Math.sqrt(radius*radius-Math.pow(center.x-x,2));
		ans[2] = Math.atan2(y,x-center.x);

		// This works by doing angles from the circle and using the right triangle with the radius
		// perpendicular to the tangent line from end to the circle.
		double centerToEnd = center.getAngle(end);
		double theta = Math.acos(radius/(center.dist(end)));
		ans[3] = centerToEnd + theta;

		return ans;
	}

	public static double getChordLength(double angle) {
		return radius*Math.sqrt(2*(1-Math.cos(angle)));
	}

	public pt ptOnCircleAtAngle(double angle) {
		return new pt(center.x+radius*Math.cos(angle), center.y+radius*Math.sin(angle));
	}
}
