How to generate a random shape convex polygon with the same area?

6 views (last 30 days)
Hi, I want to generate a number of random shape convex polygons. They must have the same value of area. It dosen't matter how much vertex it has.
I know how to generate a bunch of random shape convex polygons, but if I additionally want them to have the same value of area, it is difficult for me.
Thanks,
  2 Comments
Image Analyst
Image Analyst on 18 Oct 2013
The same as what? What other area should the polygon's area match? Why not just create one, then scale it to force it to have the area you want?
toby
toby on 18 Oct 2013
Thanks for your reply. I mean all random convex polygon need to have the same area. I think the scale method might be a good one. Could you please be more specific?

Sign in to comment.

Accepted Answer

Image Analyst
Image Analyst on 18 Oct 2013
Make a random polygon and use polyarea() to find it's area. Then calculate the centroid and then change the distance from the centroid to the vertices by the proper amount so that the area is what is desired. I think if the radius changes by a factor F then the area will change by F^2. Try that and see how it goes.
  2 Comments
toby
toby on 18 Oct 2013
thank you very much! But I still have some question about the convex polygon generation. Is there some available functions in matlab to generate convex polygon?
Image Analyst
Image Analyst on 18 Oct 2013
You can use the rand() function to generate random coordinates.

Sign in to comment.

More Answers (0)

Categories

Find more on Computational Geometry in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!