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.
MATLAB API
nsidedpoly
nsidedpoly expects following parameters
- n is no of the sides for polygon
- The default radius is 1
- I have used matlab command to generate points
P5 JS
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