add backward move

This commit is contained in:
Zhengyu Peng
2021-12-09 09:40:50 -05:00
parent cf6fc30a19
commit 0a83d5e7fb
2 changed files with 26 additions and 1 deletions

View File

@ -20,3 +20,23 @@ def forward_path():
path[:, 5, :] = mir_path
return path
def backward_path():
# assert (g_steps % 4) == 0
g_steps = 20
g_radius = 25
halfsteps = int(g_steps/2)
path = np.zeros((g_steps, 6, 3))
path[:, 0, :] = semicircle_generator(g_radius, g_steps, reverse=True)
mir_path = np.roll(path[:, 0, :], halfsteps, axis=0)
path[:, 2, :] = path[:, 0, :]
path[:, 4, :] = path[:, 0, :]
path[:, 1, :] = mir_path
path[:, 3, :] = mir_path
path[:, 5, :] = mir_path
return path