The site now has the capability to include p5.js sketches into blog posts. The framework enables math+art to provide visualizations of mathematical concepts in fun ways. For example, let's take a look at a simple example of sinusoidal motion.
This square's position oscillates via a sinusoidal function of time. Given the height of its container, the square's position behaves as
p5.js provides a nice interface to bring this equation to life. Similarly, we can visualize circular motion — and while we're at it, let's reduce the velocity too.
That one's coordinate positions are
Finally, we can combine the two motions, i.e., and .
While these examples just scratch the surface of what's possible with p5.js sketches, I look forward to including more advanced and interesting visualizations in future posts.
Copyright © 2022 Robert Adkins. All rights reserved.