Divide area into polygons

6 ビュー (過去 30 日間)
Paschalis Garouniatis
Paschalis Garouniatis 2020 年 4 月 8 日
Hello everyone. Supposing there is a square area (x,y coordinates) given by the user is it possible to divide the area into non overlapping polygons (let's say 8 polygons for example) and then check which polygon contains a single pair of coordinates? In the meantime i am trying to figure it out and if there is any progress I will post it as a comment. Any help is most welcome. Thanks in advance.

採用された回答

Steven Lord
Steven Lord 2020 年 4 月 8 日
Many different ways.
  • Slice the square into 8 rectangles with horizontal cuts.
  • Slice the square into 8 rectangles with vertical cuts.
  • Slice the square into 4 smaller squares with one horizontal and one vertical cut, then divide each square into two pieces with a single cut each.
  • Do some other series of 3 cuts that achieves the upper bound of 7 in the lazy caterer's sequence then make one cut that divides one of the pieces in two.
What requirements do you have on the polygons into which you want to cut the square?
  4 件のコメント
Paschalis Garouniatis
Paschalis Garouniatis 2020 年 4 月 8 日
編集済み: Paschalis Garouniatis 2020 年 4 月 8 日
For the inner polygons it's ok but for the outer ones I need 2 more vertices. Polygon X7 for example. The vertices from the R variable are 1, 3 and 4. However V1 is infinite. Is there a way to create vertices for this polygon at the points that there is intersection of the plot and axis (let them be A(-4, -2) and B(-4, 0.3) roughly estimating). Also for X12 I need 3 more vertices (one of them is (-4, -4) ).
Paschalis Garouniatis
Paschalis Garouniatis 2020 年 4 月 25 日
After many trials to create polygons I ended up dividing the area into smaller squares and then use the voroinoilimit function in order to obtain the vertices.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeElementary Polygons についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by