def __get_pivots(diameter, x, y):
    """
    Get the x-intercepts and y-intercepts of
    the circle and return a list of pivots which
    the coin lies on.
    """

    pivots = []
    radius = diameter / 2

    sqval = radius**2 - y**2
    if sqval > 0: # no imaginary numbers!
        sqrt = sqval**(0.5)
        pivots.append((x + sqrt, 0))
        pivots.append((x - sqrt, 0))
    elif sqval == 0: # tangent
        pivots.append((x, 0))

    sqval = radius**2 - x**2
    if sqval > 0:
        sqrt = sqval**(0.5)
        pivots.append((0, y + sqrt))
        pivots.append((0, y - sqrt))
    elif sqval == 0:
        pivots.append((0, y))

    return pivots