Skip to content

A function to draw a circle filled with hatched lines using the p5.js library.

Notifications You must be signed in to change notification settings

dutchdan/hatchedCircle.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

hatchedCircle.js

A function to draw a circle filled with hatched lines using the p5.js library.

Calling the function.

hatchedCircle(x,y,radius,step,angle);

Call the function passing the following parameters:

  • the x-position of the center of the circle,
  • the y-position of the center of the circle,
  • the radius of the circle,
  • the distance between the hatched lines (step) in pixels,
  • the angle of the hatched lines in degrees( from the top of the circle).

Other information.

  • Inside the function push() and pop() are used to stop it interfering with the surrounding p5.js code as it uses translate() and rotate().
  • remember to use noFill() before calling the function otherwise the hatched lines won't be visible.
  • to use: copy and paste into your code or link to the file in the index.html.

About

A function to draw a circle filled with hatched lines using the p5.js library.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages