1.2.2

double[] intervalPoint = {0, 0.2, 0.1, 0.3, 0.2, 0.3};      
int intervalNum = intervalPoint.length/2;   
Interval1D[] intervals = new Interval1D[intervalNum];

for(int i=0; i
/**
* 判断区间a,b是否有交集
* @param a
* @param b
* @return
*/
public static boolean isIntersection(Interval1D a, Interval1D b){
    if(a.contains(b.min()) || a.contains(b.max()))return true;
    if(b.contains(a.min()) || b.contains(a.max()))return true;
    return false;
}

你可能感兴趣的:(1.2.2)