# Transformations & the Matrix Stack **Track:** Foundations — Creative Coding — the existing 50 **Framework / surface:** p5.js **Level:** Intermediate **Prerequisites:** Functions & Modularity **In one line:** Move the coordinate system — translate, rotate, scale — kept local with push/pop. ## Theory, aesthetics & inspiration Rather than recompute where every point should land, a program can move the coordinate system itself — translating its origin, rotating its axes, scaling its unit — and draw simple shapes into that displaced frame. Push and pop save and restore these states on a stack, so transformations nest cleanly, each local to its branch. The idea descends from the transformation matrices of early computer graphics and, pedagogically, from Seymour Papert's Logo turtle in "Mindstorms," which taught geometry as motion relative to a moving body. Aesthetically, this shift in stance — change the world, not the object — is what makes recursive trees, mandalas, and articulated figures tractable and expressive.