Graphing a Spiral in Excel

By definition, a function must be single valued. That is, for any given x, there can be only one y. The same y can appear for multiple x‘s, like in every periodic function ever, but not the other way around. So, that’s pretty limiting. What if you want to graph a circle? Or a cardioid? Or a spiral?

The trick is to generate two separate function of a different variable. So $latex x=x(t)$ and $latex y=y(t)$. These are known as parametric equations.

One way to make Excel spit at you while trying to graph parametric equations is to graph them as a line plot rather than a scatter plot. This is confusing for me personally because I swear those used to do the same thing. But that’s the trouble with getting old. Things change, and you are cursed with the memory of how they used to work.

By way of example, let’s graph a spiral.

First, generate a column of t‘s. In our case, these are going to be angles in radians. You can use any step you like, but beware using a tiny step because it took me 200 data points to get around the spiral once.

You’ll also need to generate a gradually increasing r. This can be a constant times your angle step, or if you’re really fancy, it can be something more complex like $latex r=ct^2$. If your t‘s are in column A, starting in row 2, your formula for r would look like this: =4*A2 . For the rest of the discussion, assume I have put this formula in column B

Next, you generate your parametric equations: $latex x=r\cos(t)$ and $latex y=r\sin(t)$. In Excel, these will look like this: =B2*COS(A2) and =B2*SIN(A2) respectively.

Finally, you graph your x column and y column as a scatter plot, and you receive spirals as payment.

If your r increases by equal increments, you get a spiral that looks like this:




And if you graph a spiral with increasing r increments, you get something like this:



Fun right? Feel free to download the sheet I used to make these guys. If you have any questions, leave them in the comments.