def getSliceLimits(self, tMin, tMax):
        result = SliceLimits()
        xMin = 0; # origin of 0,0 present in every slice
        xMax = 0; # (it's the pie center/slice pivot point)
        yMin = 0
        yMax = 0
        tmp = 0
        # points where each edge intersects the arc could be
        # extremal points--include them too.
        tmp = math.cos(tMin)
        xMin = min(xMin , tmp)
        xMax = max(xMax , tmp)
        tmp = math.sin(tMin)
        yMin = min(yMin , tmp)
        yMax = max(yMax , tmp)

        tmp = math.cos(tMax)
        xMin = min(xMin , tmp)
        xMax = max(xMax , tmp)
        tmp = math.sin(tMax)
        yMin = min(yMin , tmp)
        yMax = max(yMax , tmp)

        # finally if slice includes any special extreme points
        # on the arc (namely, points of the arc that are
        # either due north, due south, due east or due west)
        # include those points in determining the min/max x
        # and min/max y included in the slice:
        halfPi = math.pi/2.
        i = int (math.ceil(tMin/halfPi))
        while i*halfPi < tMax:
            t = i*halfPi
            tmp =  math.cos(t)
            xMin = min(xMin , tmp)
            xMax = max(xMax , tmp)
            tmp = math.sin(t)
            yMin = min(yMin , tmp)
            yMax = max(yMax , tmp)
            i += 1

        result.xMin = xMin
        result.xMax = xMax
        result.yMin = yMin
        result.yMax = yMax

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