def scale(vertex, scale_factor):
    """Move a coordinate closer / further from origin.
    If done for all vertices in a 2d shape, it has the effect of changing the size of the whole shape."""
    [vertex_x, vertex_y] = vertex
    return [vertex_x * scale_factor, vertex_y * scale_factor]