public static double Distance2Objects (ABObject o1, ABObject o2)
	{
		List<Point2D> pointsO1 = MathFunctions.getObjectContourPoints(o1);
		List<Point2D> pointsO2 = MathFunctions.getObjectContourPoints(o2);
		
		double error_distance = 2.0;
		double min_distance = 999.0;
		for (int i = 0; i < pointsO1.size(); i++)
		{
			Point2D p1 = pointsO1.get(i);
			for (int j = 0; j < pointsO2.size(); j++)
			{
				Point2D p2 = pointsO2.get(j);
				double distance = Distance2Points(p1, p2);
				//System.out.println("Distance between " + p1 + ", " + p2 + " = " + distance);
				if (distance < error_distance)
				{
					/*System.out.println("Distance between " + "(" +  p1.x + ", " + p1.y + ")" + 
								"(" + p2.x + ", " + p2.y + ")" + 
							" = " + distance);*/
					if (distance < min_distance)
						min_distance = distance;
				}
			}
		}
		
		return min_distance;
	}