This is a project for which I used Matlab to create a rotating torus using Euler’s equations to demonstrate rigid body mechanics. I made the below animation which simulates the rigid body mechanics and I created a couple of graphs that show the rotational velocity of the object.
https://github.com/FinlayMcGrath/RotatingTorus


