

def xWherePieEdgeIntersectsHorizontalLine(self, yOfHorizontalLine, xPieCenter, yPieCenter, pieRadius, pieEdgeAngle):
    result = Double.NaN
    dyToArc = (pieRadius * math.sin(pieEdgeAngle))
    if (dyToArc != 0):
        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