public ApproximationSlice(final GeoPoint center, final GeoPoint endPoint1, final double point1Bearing, final GeoPoint endPoint2, final double point2Bearing, final GeoPoint middlePoint, final double middlePointBearing, final boolean mustSplit) { this.endPoint1 = endPoint1; this.point1Bearing = point1Bearing; this.endPoint2 = endPoint2; this.point2Bearing = point2Bearing; this.middlePoint = middlePoint; this.middlePointBearing = middlePointBearing; this.mustSplit = mustSplit; // Construct the plane going through the three given points this.plane = SidedPlane.constructNormalizedThreePointSidedPlane(center, endPoint1, endPoint2, middlePoint); if (this.plane == null) { throw new IllegalArgumentException("Either circle is too small or accuracy is too high; could not construct a plane with endPoint1="+endPoint1+" bearing "+point1Bearing+", endPoint2="+endPoint2+" bearing "+point2Bearing+", middle="+middlePoint+" bearing "+middlePointBearing); } if (this.plane.isWithin(-center.x, -center.y, -center.z)) { //Plane is bogus, we cannot build the circle throw new IllegalArgumentException("Could not construct a valid plane for this planet model with endPoint1="+endPoint1+" bearing "+point1Bearing+", endPoint2="+endPoint2+" bearing "+point2Bearing+", middle="+middlePoint+" bearing "+middlePointBearing); } }
final SidedPlane candidate1 = SidedPlane.constructNormalizedThreePointSidedPlane(currentSegment.start, prevSegment.URHC, currentSegment.ULHC, currentSegment.LLHC); final SidedPlane candidate2 = SidedPlane.constructNormalizedThreePointSidedPlane(currentSegment.start, currentSegment.ULHC, currentSegment.LLHC, prevSegment.LRHC); final SidedPlane candidate3 = SidedPlane.constructNormalizedThreePointSidedPlane(currentSegment.start, currentSegment.LLHC, prevSegment.LRHC, prevSegment.URHC); final SidedPlane candidate4 = SidedPlane.constructNormalizedThreePointSidedPlane(currentSegment.start, prevSegment.LRHC, prevSegment.URHC, currentSegment.ULHC);