// Задача "Треугольная область"
// 8-ая Интернет-олимпиада сезона 2007-2008, базовый уровень
// Автор задачи: Федор Царев, tsarev@rain.ifmo.ru
// Автор решения: Сергей Поромов, poromov@rain.ifmo.ru

import java.io.*;
import java.util.*;

public class tri_sp implements Runnable {

	public static void main(String[] args) {
		new Thread(new tri_sp()).run();
	}

	public void run() {
		try {
			solve();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	BufferedReader br;

	PrintWriter out;

	StringTokenizer st;

	String nextToken() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			st = new StringTokenizer(br.readLine());
		}
		return st.nextToken();
	}

	int nextInt() throws IOException {
		return Integer.parseInt(nextToken());
	}

	void myAssert(boolean e, String s) {
		if (!e) {
			throw new Error("Assertion failure " + s);
		}
	}

	private static final String FILENAME = "tri";
	
	double dist(double x1, double y1, double x2, double y2, double x, double y) {
		double ans = Math.sqrt((x1 - x) * (x1 - x) + (y1 - y) * (y1 - y));
		ans = Math.min(ans, Math.sqrt((x2 - x) * (x2 - x) + (y2 - y) * (y2 - y)));
		if (((x2 - x1) * (x - x1) + (y2 - y1) * (y - y1) >= 0) && ((x1 - x2) * (x - x2) + (y1 - y2) * (y - y2) >= 0)) {
			ans = Math.min(ans, Math.abs(x1 * y2 - y1 * x2 + x2 * y - y2 * x + x * y1 - y * x1) / (Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2))));
		}
		return ans;
	}

	public void solve() throws IOException {
		br = new BufferedReader(new FileReader(FILENAME + ".in"));
		out = new PrintWriter(FILENAME + ".out");
		int[] x = new int[3];
		int[] y = new int[3];
		for (int i = 0; i < 3; i++) {
			x[i] = nextInt();
			y[i] = nextInt();
		}
		int xc = nextInt();
		int yc = nextInt();
		double ans = Double.POSITIVE_INFINITY;
		for (int i = 0; i < 3; i++) {
			ans = Math.min(ans, dist(x[i], y[i], x[(i + 1) % 3], y[(i + 1) % 3], xc, yc));
		}
		out.println(ans);
		out.close();
	}
}
