protected void findIntersectionBounds(final PlanetModel planetModel,final Bounds boundsInfo,final Plane q,final Membership... bounds){
  final double lineVectorX=y * q.z - z * q.y;
  final double lineVectorY=z * q.x - x * q.z;
  final double lineVectorZ=x * q.y - y * q.x;
  if (Math.abs(lineVectorX) < MINIMUM_RESOLUTION && Math.abs(lineVectorY) < MINIMUM_RESOLUTION && Math.abs(lineVectorZ) < MINIMUM_RESOLUTION) {
    return;
  }
  final double denomYZ=this.y * q.z - this.z * q.y;
  final double denomXZ=this.x * q.z - this.z * q.x;
  final double denomXY=this.x * q.y - this.y * q.x;
  if (Math.abs(denomYZ) >= Math.abs(denomXZ) && Math.abs(denomYZ) >= Math.abs(denomXY)) {
    if (Math.abs(denomYZ) < MINIMUM_RESOLUTION_SQUARED) {
      return;
    }
    final double denom=1.0 / denomYZ;
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,0.0,(-(this.D + MINIMUM_RESOLUTION) * q.z - this.z * -(q.D + MINIMUM_RESOLUTION)) * denom,(this.y * -(q.D + MINIMUM_RESOLUTION) + (this.D + MINIMUM_RESOLUTION) * q.y) * denom,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,0.0,(-(this.D - MINIMUM_RESOLUTION) * q.z - this.z * -(q.D + MINIMUM_RESOLUTION)) * denom,(this.y * -(q.D + MINIMUM_RESOLUTION) + (this.D - MINIMUM_RESOLUTION) * q.y) * denom,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,0.0,(-(this.D + MINIMUM_RESOLUTION) * q.z - this.z * -(q.D - MINIMUM_RESOLUTION)) * denom,(this.y * -(q.D - MINIMUM_RESOLUTION) + (this.D + MINIMUM_RESOLUTION) * q.y) * denom,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,0.0,(-(this.D - MINIMUM_RESOLUTION) * q.z - this.z * -(q.D - MINIMUM_RESOLUTION)) * denom,(this.y * -(q.D - MINIMUM_RESOLUTION) + (this.D - MINIMUM_RESOLUTION) * q.y) * denom,bounds);
  }
 else   if (Math.abs(denomXZ) >= Math.abs(denomXY) && Math.abs(denomXZ) >= Math.abs(denomYZ)) {
    if (Math.abs(denomXZ) < MINIMUM_RESOLUTION_SQUARED) {
      return;
    }
    final double denom=1.0 / denomXZ;
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D + MINIMUM_RESOLUTION) * q.z - this.z * -(q.D + MINIMUM_RESOLUTION)) * denom,0.0,(this.x * -(q.D + MINIMUM_RESOLUTION) + (this.D + MINIMUM_RESOLUTION) * q.x) * denom,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D - MINIMUM_RESOLUTION) * q.z - this.z * -(q.D + MINIMUM_RESOLUTION)) * denom,0.0,(this.x * -(q.D + MINIMUM_RESOLUTION) + (this.D - MINIMUM_RESOLUTION) * q.x) * denom,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D + MINIMUM_RESOLUTION) * q.z - this.z * -(q.D - MINIMUM_RESOLUTION)) * denom,0.0,(this.x * -(q.D - MINIMUM_RESOLUTION) + (this.D + MINIMUM_RESOLUTION) * q.x) * denom,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D - MINIMUM_RESOLUTION) * q.z - this.z * -(q.D - MINIMUM_RESOLUTION)) * denom,0.0,(this.x * -(q.D - MINIMUM_RESOLUTION) + (this.D - MINIMUM_RESOLUTION) * q.x) * denom,bounds);
  }
 else {
    if (Math.abs(denomXY) < MINIMUM_RESOLUTION_SQUARED) {
      return;
    }
    final double denom=1.0 / denomXY;
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D + MINIMUM_RESOLUTION) * q.y - this.y * -(q.D + MINIMUM_RESOLUTION)) * denom,(this.x * -(q.D + MINIMUM_RESOLUTION) + (this.D + MINIMUM_RESOLUTION) * q.x) * denom,0.0,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D - MINIMUM_RESOLUTION) * q.y - this.y * -(q.D + MINIMUM_RESOLUTION)) * denom,(this.x * -(q.D + MINIMUM_RESOLUTION) + (this.D - MINIMUM_RESOLUTION) * q.x) * denom,0.0,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D + MINIMUM_RESOLUTION) * q.y - this.y * -(q.D - MINIMUM_RESOLUTION)) * denom,(this.x * -(q.D - MINIMUM_RESOLUTION) + (this.D + MINIMUM_RESOLUTION) * q.x) * denom,0.0,bounds);
    recordLineBounds(planetModel,boundsInfo,lineVectorX,lineVectorY,lineVectorZ,(-(this.D - MINIMUM_RESOLUTION) * q.y - this.y * -(q.D - MINIMUM_RESOLUTION)) * denom,(this.x * -(q.D - MINIMUM_RESOLUTION) + (this.D - MINIMUM_RESOLUTION) * q.x) * denom,0.0,bounds);
  }
}

protected void findIntersectionBounds ( final PlanetModel planetModel , final Bounds boundsInfo , final Plane q , final Membership ... bounds ) { final double lineVectorX = y * q . z - z * q . y ; final double lineVectorY = z * q . x - x * q . z ; final double lineVectorZ = x * q . y - y * q . x ; if ( Math . abs ( lineVectorX ) < MINIMUM_RESOLUTION && Math . abs ( lineVectorY ) < MINIMUM_RESOLUTION && Math . abs ( lineVectorZ ) < MINIMUM_RESOLUTION ) { return ; } final double denomYZ = this . y * q . z - this . z * q . y ; final double denomXZ = this . x * q . z - this . z * q . x ; final double denomXY = this . x * q . y - this . y * q . x ; if ( Math . abs ( denomYZ ) >= Math . abs ( denomXZ ) && Math . abs ( denomYZ ) >= Math . abs ( denomXY ) ) { if ( Math . abs ( denomYZ ) < MINIMUM_RESOLUTION_SQUARED ) { return ; } final double denom = 1.0 / denomYZ ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , 0.0 , ( - ( this . D + MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D + MINIMUM_RESOLUTION ) ) * denom , ( this . y * - ( q . D + MINIMUM_RESOLUTION ) + ( this . D + MINIMUM_RESOLUTION ) * q . y ) * denom , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , 0.0 , ( - ( this . D - MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D + MINIMUM_RESOLUTION ) ) * denom , ( this . y * - ( q . D + MINIMUM_RESOLUTION ) + ( this . D - MINIMUM_RESOLUTION ) * q . y ) * denom , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , 0.0 , ( - ( this . D + MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D - MINIMUM_RESOLUTION ) ) * denom , ( this . y * - ( q . D - MINIMUM_RESOLUTION ) + ( this . D + MINIMUM_RESOLUTION ) * q . y ) * denom , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , 0.0 , ( - ( this . D - MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D - MINIMUM_RESOLUTION ) ) * denom , ( this . y * - ( q . D - MINIMUM_RESOLUTION ) + ( this . D - MINIMUM_RESOLUTION ) * q . y ) * denom , bounds ) ; } else if ( Math . abs ( denomXZ ) >= Math . abs ( denomXY ) && Math . abs ( denomXZ ) >= Math . abs ( denomYZ ) ) { if ( Math . abs ( denomXZ ) < MINIMUM_RESOLUTION_SQUARED ) { return ; } final double denom = 1.0 / denomXZ ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D + MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D + MINIMUM_RESOLUTION ) ) * denom , 0.0 , ( this . x * - ( q . D + MINIMUM_RESOLUTION ) + ( this . D + MINIMUM_RESOLUTION ) * q . x ) * denom , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D - MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D + MINIMUM_RESOLUTION ) ) * denom , 0.0 , ( this . x * - ( q . D + MINIMUM_RESOLUTION ) + ( this . D - MINIMUM_RESOLUTION ) * q . x ) * denom , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D + MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D - MINIMUM_RESOLUTION ) ) * denom , 0.0 , ( this . x * - ( q . D - MINIMUM_RESOLUTION ) + ( this . D + MINIMUM_RESOLUTION ) * q . x ) * denom , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D - MINIMUM_RESOLUTION ) * q . z - this . z * - ( q . D - MINIMUM_RESOLUTION ) ) * denom , 0.0 , ( this . x * - ( q . D - MINIMUM_RESOLUTION ) + ( this . D - MINIMUM_RESOLUTION ) * q . x ) * denom , bounds ) ; } else { if ( Math . abs ( denomXY ) < MINIMUM_RESOLUTION_SQUARED ) { return ; } final double denom = 1.0 / denomXY ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D + MINIMUM_RESOLUTION ) * q . y - this . y * - ( q . D + MINIMUM_RESOLUTION ) ) * denom , ( this . x * - ( q . D + MINIMUM_RESOLUTION ) + ( this . D + MINIMUM_RESOLUTION ) * q . x ) * denom , 0.0 , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D - MINIMUM_RESOLUTION ) * q . y - this . y * - ( q . D + MINIMUM_RESOLUTION ) ) * denom , ( this . x * - ( q . D + MINIMUM_RESOLUTION ) + ( this . D - MINIMUM_RESOLUTION ) * q . x ) * denom , 0.0 , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D + MINIMUM_RESOLUTION ) * q . y - this . y * - ( q . D - MINIMUM_RESOLUTION ) ) * denom , ( this . x * - ( q . D - MINIMUM_RESOLUTION ) + ( this . D + MINIMUM_RESOLUTION ) * q . x ) * denom , 0.0 , bounds ) ; recordLineBounds ( planetModel , boundsInfo , lineVectorX , lineVectorY , lineVectorZ , ( - ( this . D - MINIMUM_RESOLUTION ) * q . y - this . y * - ( q . D - MINIMUM_RESOLUTION ) ) * denom , ( this . x * - ( q . D - MINIMUM_RESOLUTION ) + ( this . D - MINIMUM_RESOLUTION ) * q . x ) * denom , 0.0 , bounds ) ; } }
record intersection points for planes with error bounds . this method calls the bounds object with every intersection point it can find that matches the criteria . each plane is considered to have two sides , one that is d + minimum_resolution , and one that is d - minimum_resolution . both are examined and intersection points determined .
