My Works & learnings

Creating Pentagaon

I am planning to create a pentagon using p5 JS. In order to create a five sided polygon. We need to generate the points.



nsidedpoly expects following parameters

  1. n is no of the sides for polygon
  2. The default radius is 1
  3. I have used matlab command to generate points


scale is used to scale the whole canvas. Once the scale is applied all the further command will work on the scale. Line expects four parameters with x1, y1, x2, y2 coordiantes

Vishnu Sandhireddy

Written by Vishnu Sandhireddy who lives and works in Hyderabad, India. twitter