public Line FindClosestEdge(Vector2 v)
	{
		double min = v.getDistance(new Vector2((edges[0].x0 + edges[0].x1) / 2, edges[0].y0));
		int id = 0;
		for (int i = 1; i < 4; i++)
		{
			double d = v.getDistance(new Vector2((edges[i].x0 + edges[i].x1) / 2, (edges[i].y0 + edges[i].y1) / 2));
			if (d < min)
			{
				min = d;
				id = i;
			}
		}
		return edges[id];
	}