p5.js for Mathematicians

I teach A-level Maths and Further Maths, and have been using p5.js to introduce my students to visual coding alongside their further maths syllabus.   Here are some standalone project tutorials for students (each one produces a functional web app and takes about an hour to work through. Below I've linked to a few of my own web apps, which are fairly varied, but mostly link to the teaching of A-level Maths or Further Maths.  If you're interested in the full list of my teaching resources (including PowerPoint presentations, worksheets, etc as well as interactive spreadsheets), see my Teaching Resources pages: Teaching Resources

The online p5.js editor

Introduction for maths teachers, from the ATM virtual conference: Visual Coding for Beginners ATM.pdf

A short introductory video for conference attendees: Visual Coding for Beginners ATM intro (youtube)

Standalone p5 coding projects for students:
Intro.pdf
Multiplication Wheel.pdf
Optical Illusions.pdf
Mandelbrot Set.pdf
Oscillating Dots.pdf
Vectors.pdf
Bezier Curves part 1.pdf
Bezier Curves part 2.pdf
Bouncing Chaos.pdf
Polar Plotter.pdf
Simulating Life.pdf
Life Contined.pdf
Snowflake Generator.pdf
Draining Tanks.pdf
Clock.pdf
Rocket.pdf
Rocket part 2.pdf
Point In Polygon.pdf
Hex Grid.pdf
Charged Particles.pdf
Lorenz Attractor.pdf
Tangent Fields.pdf
Voronoi Diagram.pdf
Rule 90.pdf
The Forgetful Point.pdf
Vector Quadrilateral.pdf
 

My own projects:
No Frills Clock
Full screen digital clock, with option to add text (eg for exams). Light/dark mode, show/hide seconds, ampm/24hr options.
No Frills Clock


Colouring Grid
Very customisable colouring grid - click or tap to colour in the squares, show/hide grid lines, index numbers, tap to randomize colours, modify the grid size.
Colouring Grid


Crazy Clock
A fun animated clock, in hh:mm:ss mode, but with falling segments.
Crazy Clock


Factors Game
How many numbers can you add to the network without crossing lines? Numbers are linked according to common factors. Essentially a planarity graph theory puzzle.
Factors Game


A-level Maths Flashcards
A simple flashcard app that lets you scroll through cards or choose at random, and flip them for answers. Also tracks the number of cards you flip and how long you've been studying for. Designed for Edexcel A-level Maths.
A-level Maths Flashcards


A-level Further Maths Flashcards
A simple flashcard app that lets you scroll through cards or choose at random, and flip them for answers. Also tracks the number of cards you flip and how long you've been studying for. Designed for Edexcel A-level Further Maths (modules Core Pure 1, Core Pure 2, Further Pure 1).
A-level Further Maths Flashcards


Genius Square Puzzle
Based on 'The Genius Square' by The Happy Puzzle Company https://www.happypuzzle.co.uk, this app lets you play a random (always new, always solvable) puzzle, or play synchronously against a friend if you both tap the clock icon within a few seconds of one another. Tap to rotate a piece, or tap and hold to turn it over (reflect it).
Genius Square Puzzle


Random Textbook Question A-level Maths
A simple way to avoid the bias of only revising the topics you like - every time you click, you get a recommended textbook question (the exercise and question number, plus the topic). Note: you have to have the textbooks yourself to look up the questions! Designed for Edexcel A-level Maths.
Random Textbook Question A-level Maths


Random Textbook Question A-level Further Maths
A simple way to avoid the bias of only revising the topics you like - every time you click, you get a recommended textbook question (the exercise and question number, plus the topic). Note: you have to have the textbooks yourself to look up the questions! Designed for Edexcel A-level Further Maths - includes Core Pure 1, Core Pure 2, Further Pure 1 and Decision 1.
Random Textbook Question A-level Further Maths


Pi from Polygons
A simple illustration of how to approximate pi using regular polygons. Increase the number of sides to show how the area and perimeter start to resemble pi and 2pi respectively.
Pi from Polygons


Projectile Motion
Designed to allow exploration of some key properties of projectile motion - what happens to the horizontal range and the vertical height when you change the angle, but not the speed, of projection? How much effect does a change in speed have?
Projectile Motion


Puzzle-A-Day
Similar to the Genius Square, but more challenging. And different every day - based on DragonFjord's Puzzle-A-Day, you have to use the blocks to cover up everything but today's date. Tap to rotate pieces, tap and hold to reflect.
Puzzle-A-Day


Pythagoras Calculator
Designed to streamline numerical Pythagoras calculations - input any known sides, and the missing sides will be automatically calculated for you. If you input all three, and your triangle isn't right-angled, it'll tell you what its angle is, and if you only input one, it'll make the two shorter legs equal. Very handy.
Pythagoras Calculator


Pythagoras Proof
A delightful little moving tiles puzzle which, when done correctly, demonstrates the truth of Pythagoras' theorem.
Pythagoras Proof


Pomodoro Timer
A simple Pomodoro-style timer that lets you choose work and rest times, then shows you how far through you are, and how many full cycles you've completed.
Pomodoro Timer


Venn Diagram Notation
A classic two-set Venn diagram, but by tapping on different regions, you can reveal a description and/or the mathematical set notation for the shaded region.
Venn Diagram Notation


Water Clock
A fluid clock visual made by animating many small moving blobs, but only having them light up if they coincide with the location of the desired numbers.
Water Clock


Exam Question Timer
Designed for use with Edexcel A-level Maths exam questions, where the average time available in exams is 1.2 minutes per mark. Choose the number of marks, and the timer will automatically give the right time for the question (also shows the equivalent of 25% extra time for those who may be eligible).
Exam Question Timer


Collisions
Build an intuition for the coefficient of restitution, for two dimensional collisions between a particle and a surface. Designed to support with Further Mechanics from A-level Further Maths.
Collisions



The Coding Train - Daniel Shiffman was my route into p5, which I reluctantly turned to after teaching myself Python because I wanted to do more visual things than Python would easily allow. Daniel's videos are an excellent introduction to the coding language, including explanations of the 'why' behind many of the concepts and ideas, and his 'coding challenge' youtube videos are a superb source of inspiration for any budding coders.
thechalkface