def isIntersecting(self, pp, symbol, iPoint, onY2, xBrush, yBrush,
                             brushWidth, brushHeight):

        result = False
        p = symbol.getParent().getPoint(iPoint)
        x = p.getX();  # pie center point (slice pivot)
        y = p.getY()
        xPx = pp.xToPixel(x)
        yPx = pp.yToPixel(y, onY2)
        dx = xBrush-xPx
        # - represents switch from graphics to cartesian coordinates
        dy = -(yBrush-yPx)

        rSquared = dx*dx + dy*dy
        angle = self.angle(dx, dy)
        # pie angles grow clockwise but radians counter-clockwise,
        # hence the odd "0 into max, 1 into min" mapping below.
        thetaMax = symbol.getPieSliceTheta0()
        thetaMin = symbol.getPieSliceTheta1()
        rPiePlus = (symbol.getPieSliceRadius(pp, onY2) +
                        0.5*max(brushWidth, brushHeight))

        """
        * Enforce a minimum slice angle for hit testing
        * purposes, equivalent to  +/- 1 px of play along the
        * arcs of tiny slices, to make them easier to select:<p>
        *
        * <pre>
        *   r*minDTheta = 1 px
        * </pre>
        *
        * This helps with tiny slices adjacent to large ones, but if
        * several tiny slices are adjacent to each other, or if both
        * adjacent slices come after the tiny slice in the curve
        * order (e.g. the tiny slice is the very first slice) it
        * still won't be selectable. Developers can switch
        * curve order to get around this, but it's not ideal.
        * <p>
        *
        * TODO: Integrate a "closest to slice angle" criterion
        * to resolve ties when hit testing slices to provide
        * a better hit testing behavior with small or overlapping
        * slices.
        *
        """
        minDTheta = (rPiePlus < 1) and 1.0 or 1./rPiePlus
        if thetaMax - thetaMin < 2*minDTheta:
            thetaMid = 0.5*(thetaMax + thetaMin)
            thetaMin = thetaMid - minDTheta
            thetaMax = thetaMid + minDTheta

        if rSquared <= rPiePlus*rPiePlus  and  self.angleInRange(angle,thetaMin,thetaMax):
            result = True


        return result
dataset/ETHPy150Open anandology/pyjamas/library/gwt/chart/SymbolType.py/PieSliceSymbolType.isIntersecting/original