/
concept-collection
/
walnuts-interactive
Jump to
/
Appearance
Match my system
Paper
GitHub
Slate
Midnight
Terminal
Sign in
concept-collection
/
walnuts-interactive
Code
Commits
Issues
0
Pull requests
0
Actions
Branches
1
Tags
0
Site
cccc996
Branches
main
walnuts-interactive
/
helpers
/
u_turn.m
11 lines · 291 B
Copy
Copied
Blame
History
Raw
1
function 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
);
11
end
↑
↓
move
↵
open
esc
close