How to find length of a line

4 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2014-2-11
Let X = newBoxPolygon(:, 1) and Y = newBoxPolygon(:, 2), then
width = max(X) - min(X)
height = max(Y) - min(Y)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Elementary Polygons 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by