Constructing random polygons

  • Authors:
  • David Dailey;Deborah Whitfield

  • Affiliations:
  • Slippery Rock University, Slippery Rock, PA, USA;Slippery Rock University, Slippery Rock, PA, USA

  • Venue:
  • SIGITE '08 Proceedings of the 9th ACM SIGITE conference on Information technology education
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

The construction of random polygons has been used in psychological research and for the testing of algorithms. With the increased popularity of client-side vector based graphics in the web browser such as seen in Flash and SVG, as well as the newly introduced tag in HTML5.0, the use of random shapes for creation of scenes for animation and interactive art requires the construction of random polygons. A natural question, then, is how to generate random polygons in a way which is computationally efficient (particularly in a resource limited environment such as the web browser). This paper presents a random polygon algorithm (RPA) that generates polygons that are random and representative of the class of all n-gons in O(n2logn) time. Our algorithm differs from other approaches in that the vertices are generated randomly, the algorithm is inclusive (i.e. each polygon has a non-zero probability to be constructed), and it runs efficiently in polynomial time.