How can I calculate directional vector of a line connecting two points?

6 ビュー (過去 30 日間)
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah 2016 年 5 月 19 日
回答済み: goerk 2016 年 5 月 19 日
The two points are pixel position of an image

回答 (1 件)

goerk
goerk 2016 年 5 月 19 日
Startpoint = [1 2];
Endpoint = [3 3];
direction = Endpoint - Startpoint;
direction_scaled = direction/norm(direction); % vector with length 1

カテゴリ

Help Center および File Exchange3-D Volumetric Image Processing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by