How to generate a random shape convex polygon with the same area?
3 views (last 30 days)
Show older comments
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
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?
Accepted Answer
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
More Answers (0)
See Also
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!