Rotates each x and y tuple in `points`` by `rotationDegrees`. The points
    are rotated around the origin by default, but can be rotated around another
    pivot point by specifying `pivotx` and `pivoty`.

    The points are rotated counterclockwise.

    Returns a generator that produces an x and y tuple for each point in `points`.

    >>> list(rotatePoints([(10, 0), (7, 7)], 45))
    [(7, 7), (0, 9)]

def rotatePoints(points, rotationDegrees, pivotx=0, pivoty=0):
    """
    Rotates each x and y tuple in `points`` by `rotationDegrees`. The points
    are rotated around the origin by default, but can be rotated around another
    pivot point by specifying `pivotx` and `pivoty`.

    The points are rotated counterclockwise.

    Returns a generator that produces an x and y tuple for each point in `points`.

    >>> list(rotatePoints([(10, 0), (7, 7)], 45))
    [(7, 7), (0, 9)]
    """

    rotationRadians = math.radians(rotationDegrees % 360)

    for x, y in points:
        _checkForIntOrFloat(x)
        _checkForIntOrFloat(y)
        x -= pivotx
        y -= pivoty
        x, y = x * math.cos(rotationRadians) - y * math.sin(rotationRadians), x * math.sin(rotationRadians) + y * math.cos(rotationRadians)
        x += pivotx
        y += pivoty

        yield int(x), int(y)