Chaining TouchActions in a loop

Env: Appium 1.3.7 ; Python ; iOS8 device

What is the appropriate way to chain together multiple TouchActions when each coordinate must be calculated via a loop?

Most of the chain implementations I’ve seen look something like this:

action.press(el, x, y).move_to(el, h, k).release()

However, I would like to chain together multiple move_to’s via a loop so I can calculate each coordinate.

This is basically what I have tried:

action.press(el, h, k)
while count < (num):
    nextLoc = {"x" : (h + r * math.cos(num)), "y" : (k + r * math.sin(num))}
    adjust = {"x": nextLoc["x"] - prevLoc["x"], "y" : nextLoc["y"] - prevLoc["y"]}
    action.move_to(el, (h + adjust["x"]), (k + adjust["y"]))
    prevLoc = nextLoc
    count += 2 * pi / 36
action.release()

The code runs; however, the action doesn’t seem to be taking place.

Any ideas?

Thanks.