private static double dist(
	double a, 
	double b )
{
	double r;
	if ( Math.abs(a) > Math.abs(b) )
	{
		r = b / a;
		return(Math.abs(a) * Math.sqrt(1 + r * r));
	}
	else
		if ( b != 0 )
		{
			r = a / b;
			return(Math.abs(b) * Math.sqrt(1 + r * r));
		}
		else
			return(0.0);
}