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

42 vues (au cours des 30 derniers jours)
K M Ibrahim Khalilullah
K M Ibrahim Khalilullah le 19 Mai 2016
Réponse apportée : goerk le 19 Mai 2016
The two points are pixel position of an image

Réponses (1)

goerk
goerk le 19 Mai 2016
Startpoint = [1 2];
Endpoint = [3 3];
direction = Endpoint - Startpoint;
direction_scaled = direction/norm(direction); % vector with length 1

Catégories

En savoir plus sur Image Filtering and Enhancement dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by