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

조회 수: 42 (최근 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 CenterFile Exchange에서 Image Filtering and Enhancement에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by