private int segmentAt( double position ) {
		int result = Arrays.binarySearch( segmentLengthsSum, position * totalLength );
		if( result >= 0 ) {
			return result;
		} else {
			return -2 - result;
		}
	}