How can I calculate directional vector of a line connecting two points?
27 次查看(过去 30 天)
显示 更早的评论
The two points are pixel position of an image
0 个评论
回答(1 个)
goerk
2016-5-19
Startpoint = [1 2];
Endpoint = [3 3];
direction = Endpoint - Startpoint;
direction_scaled = direction/norm(direction); % vector with length 1
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Image Filtering and Enhancement 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!