import math


def spiral(radius, step, resolution=.1, angle=0.0, start=0.0, direction=-1):
    """
    Generate points on a spiral.

    Original source:
    https://gist.github.com/eliatlarge/d3d4cb8ba8f868bf640c3f6b1c6f30fd

    Parameters
    ----------
    radius : float
        maximum radius of the spiral from the center.
        Defines the distance of the tail end from the center.
    step : float
        amount the current radius increases between each point.
        Larger = spiral expands faster
    resolution : float
        distance between 2 points on the curve.
        Defines amount radius rotates between each point.
        Larger = smoother curves, more points, longer time to calculate.
    angle : float
        starting angle the pointer starts at on the interior
    start : float
        starting distance the radius is from the center.
    direction : {-1, 1}
        direction of the rotation of the spiral

    Returns
    -------
    coordinates : List[Tuple[float, float]]
    """
    dist = start + 0.0
    coords = []
    while dist * math.hypot(math.cos(angle), math.sin(angle)) < radius:
        cord = []
        cord.append(dist * math.cos(angle) * direction)
        cord.append(dist * math.sin(angle))
        coords.append(cord)
        dist += step
        angle += resolution
    return coords