startX = ( i > 0 ) ? ( i - 1 ) : 0; break;
rt = ya[ya.length / 2]; } else { int x = ya.length / 2; rt = ( ya[x] + ya[x - 1] ) / 2;
	private double getFitYPosition( double[] xa, double[] ya, double center,			double width, double height, boolean above )	{		int gap = 10;		int startX = 0, endX = xa.length - 1;		for ( int i = 0; i < xa.length; i++ )		{			if ( xa[i] >= center - width / 2d )			{				startX = ( i > 0 ) ? ( i - 1 ) : 0;				break;			}		}		for ( int i = 0; i < xa.length; i++ )		{			if ( xa[i] >= center + width / 2d )			{				endX = i;				break;			}		}		double yc = above ? Double.MAX_VALUE : 0;		for ( int i = startX; i <= endX; i++ )		{			yc = above ? Math.min( yc, ya[i] ) : Math.max( yc, ya[i] );		}		return above ? ( yc - height - gap ) : ( yc + gap );	}