Examples / p5.js Examples / / Triangle Inset

Triangle Inset

example p5.js javascript input

This sketch draws a triangle inside a triangle inside a triangle inside a triangle inside a triangle.

mouse ripple

Remix Ideas

  • Try alternating shapes: draw a square inside a triangle inside a circle.
  • Give each individual section of each triangle a different color (3 sections per triangle).
  • Instead of using the midpoint of each line, try moving the next point closer to one of the previous points.

Comments and Questions

Happy Coding is a community of folks just like you learning about coding.
Do you have a comment or question? Post it here!