필터 지우기
필터 지우기

How to find length of a line

조회 수: 4 (최근 30일)
Elie
Elie 2014년 2월 11일
댓글: Elie 2014년 2월 11일
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)
  댓글 수: 1
Elie
Elie 2014년 2월 11일
Thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (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