Many natural objects can be modelled by startlingly simple equations. For instance, there is a sextic surface (degree-6 polynomial equation in three variables) which resembles a heart. As such, it has been nicknamed the ‘heart surface’:
Now that we’re approaching Hallowe’en, I decided to do a similar thing to create a pumpkin. Due to its approximate spherical shape, the spherical coordinate system seemed like a good idea. I then used trigonometric functions to create the undulations:
Similarly, a cylindrical coordinate system is perfect for modelling surfaces such as hats. This time, I attempted to recreate an infamous hat worn by certain students at the Part IA lectures in the Cambridge Mathematical Tripos:
If you can decipher the Mathematica code, you’ll see that the equation (in cylindrical coordinates) is z = (3/2) Exp[-r^4] + (1/12) r^2 Cos[3 theta]. This was derived by modifying the ordinary Gaussian distribution until it had the correct shape. The trigonometric term causes the rim of the hat to vary sinusoidally. I then coloured the hat depending on radius to give the appearance of the black band.