The scale() function scales the current coordinate system by the specified factor.
The push() and pop() functions save and restore the coordinate system, respectively.
In this example, a square size 200 is drawn at the origin, with three different scaling factors.
Scale: Revised by Darren Kessner. Edited and maintained by p5.js Contributors and Processing Foundation. Licensed under CC BY-NC-SA 4.0.
You can find the code history of these examples here: 2023 code, pre-2023 code. You can suggest improvements by contributing to the current website!