def xWherePieEdgeIntersectsHorizontalLine(self, yOfHorizontalLine,
                                             xPieCenter, yPieCenter, 
                                             pieRadius, pieEdgeAngle):
        result = Double.NaN
        dyToArc = pieRadius*math.sin(pieEdgeAngle)
        if dyToArc != 0:
            # The fraction of the way (from pie center to pie perimeter
            # along the pie slice edge) that you must go to reach the point
            # at which the horizontal line intersects with the pie slice
            # edge. For example, this fraction is 0.5 whenever the horizontal
            # line bisects the pie slice edge.
            t = (yPieCenter - yOfHorizontalLine)/dyToArc
            if GChartUtil.withinRange(t,0,1):
                result = xPieCenter + t * pieRadius * math.cos(pieEdgeAngle)

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