Convex Hull without the in-built function.

Hello, I want to do the convex hull algorithm without using the built-in function. I know i have to use atan2 fucntion and sort function and that I have to start from the poin with the lowest y-value. But other than that I don't have concrete plan as how to do it. Can anyone guide me?Also,

回答 (2 件)

Bjorn Gustavsson
Bjorn Gustavsson 2021 年 12 月 7 日

1 投票

Take it step by step.
1, put points on paper.
2, work out how to step from the point with the smallest y-value to the next point along the perimeter in the counter-clock direction, what comparisons and conditions you need to make when selecting the next point, think this out graphically and write down the steps in pseudo-code on another paper.
3, progress to that next point and do the same for selecting the third point.
4, from this you should be able to work out a loop for this.
HTH
Jan
Jan 2021 年 12 月 7 日

0 投票

There are many known algorithms, which can inspire you. See https://en.wikipedia.org/wiki/Convex_hull_algorithms

カテゴリ

ヘルプ センター および File ExchangeBounding Regions についてさらに検索

製品

タグ

質問済み:

2021 年 12 月 7 日

回答済み:

Jan
2021 年 12 月 7 日

Community Treasure Hunt

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

Start Hunting!

Translated by