/ concept-collection / walnuts-interactive
Sign in
concept-collection / walnuts-interactive
walnuts-interactive / helpers / u_turn.m
11 lines · 291 BBlameHistoryRaw
1function result = u_turn(O)
2 theta_left = O{1,1};
3 rho_left = O{1,2};
4 theta_right = O{end,1};
5 rho_right = O{end,2};
6
7 dot1 = dot(rho_right, (theta_right - theta_left));
8 dot2 = dot(rho_left, (theta_right - theta_left));
9
10 result = (dot1 < 0) || (dot2 < 0);
11end
moveopenescclose