Converting xy coordinates to theta without discontinutities
for index in range() is almost always wrong. Consider

prev = coords[0]
for coord in coords[1:]:
    theta = ...
    prev = coord

Instead of computing theta directly, compute delta - this way you may actually take an advantage of small differences:

prev = (1, 0)    # Initial vector is along the X axis
theta = 0.0
for coord in coords[]:
    delta = angle_between(coord, prev)
    theta += delta
    prev = coord


Computing delta is simply an application of a cross-product formula:

def angle_between(curr, prev):
    return asin(cross_product(curr, prev) / (norm(curr) / norm(prev))