Effacer les filtres
Effacer les filtres

How to find length of a line

4 vues (au cours des 30 derniers jours)
Elie
Elie le 11 Fév 2014
Commenté : Elie le 11 Fév 2014
how i can find the length of this line in the x direction and in y direction
line(newBoxPolygon(:, 1), newBoxPolygon(:, 2), 'Color', 'R');
This piece of code draws a rectangular polygon , can anyone tell me how to calculate the width and the height generated by this line. Thank you

Réponse acceptée

Walter Roberson
Walter Roberson le 11 Fév 2014
Let X = newBoxPolygon(:, 1) and Y = newBoxPolygon(:, 2), then
width = max(X) - min(X)
height = max(Y) - min(Y)
  1 commentaire
Elie
Elie le 11 Fév 2014
Thank you very much.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Elementary Polygons 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