示例#1
0
文件: Line.java 项目: inutard/cra
 // TODO Unify the result to same type for lpProject
 protected GeomObj2 intersectPlane(Line that) {
   if ((type == CohoDouble.type || that.type() == CohoDouble.type)
       && (type instanceof ScaleType && that.type() instanceof ScaleType)) {
     try {
       GeomObj2 obj =
           this.specifyType(DoubleInterval.type)
               .baseIntersectPlane(that.specifyType(DoubleInterval.type));
       // make sure the error is not large when conver to double
       // System.out.println(obj.maxError());
       if (obj.maxError() > eps) throw new ArithmeticException();
       return obj;
     } catch (ArithmeticException e) {
       // System.out.println("here");
       return this.specifyType(CohoAPR.type).baseIntersectPlane(that.specifyType(CohoAPR.type));
     }
   } else { // NOTICE: don't use double and interval. the result may contain error.
     return baseIntersectPlane(that);
   }
 }