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

42 visualizaciones (últimos 30 días)
The two points are pixel position of an image

Respuestas (1)

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

Categorías

Más información sobre Image Filtering and Enhancement en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by