필터 지우기
필터 지우기

How to rotate a polygon

조회 수: 3 (최근 30일)
Md
Md 2015년 5월 14일
답변: Walter Roberson 2015년 5월 15일
Hi, I have some data points that forms a irregular shape polygon. I want to rotate the polygon gradually to see the minimum area bounded by a rectangle for the polygon. Can anyone help me in this ..... Thanks in advance.
  댓글 수: 2
Dasharath Gulvady
Dasharath Gulvady 2015년 5월 15일
You may use "hgtransform" and rotate the irregular shaped polygon. Refer the examples in the documentation page below:
For the second part of the question - "to see the minimum area bounded by a rectangle for the polygon", can you elaborate more on this?
Walter Roberson
Walter Roberson 2015년 5월 15일

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

답변 (1개)

Walter Roberson
Walter Roberson 2015년 5월 15일
To find the minimum area bounded by a rectangle for the polygon, start by finding the furthest distance between any two points on the polygon. The pair of points with the furthest distance forms one axis of a bounding rectangle. Rotate the polygon so that the pair is along the vertical axis, and then the distance between the maximum and minimum horizontal axis results will give you the length of the smaller side.
There might be a nice vector algebra way of doing this; I don't know.
The MajorAxisLength and MinorAxisLength of regionprops() might help.

카테고리

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