The Ravioli Equation

I was in The Hill in St. Louis recently — that’s the really amazing Italian neighborhood in the city.  Had lunch there twice, actually, and it brought back memories of my trip to Florence.


I then remembered that I started working on a post a while back, but never quite finished.  An equation for ravioli.  Here it is:

\left(r-\dfrac1{(\cos^6\theta+\sin^6\theta)^{1/6}}-0.03 \arccos(\cos(24\theta))\right)\times

\hbox{ } \qquad\qquad\qquad\qquad\left(r-\dfrac{0.7}{(\cos^6\theta+\sin^6\theta)^{1/6}}\right)=0.

Looks a little complicated, but here is what you get when you graph it:


Yep, ravioli!  So I thought I’d talk about how I came up with The Ravioli Equation.  Not very deep, but there are a few interesting mathematical tidbits hiding in it.

Let’s look at the central mound — the curve which outlines all the deliciously stuffed goodness in the ravioli.  I note that the ravioli in the picture above has a sauce of nuts and sage in butter, but I don’t capture that in the equation….

This is an example of a superellipse, which is a generalization of the ellipse.  It has equation

\left|\dfrac xa\right|^n+\left|\dfrac yb\right|^n=1,

where a and b are positive numbers.  Of course when n=2, you get an ordinary ellipse, but for different n, you get other curves.

The parameters a and b are called semi-diameters of the superellipse, much like the semi-axes of an ellipse.  Because ravioli are basically square, I set a=b, so that the superellipse equation looks like


Below are a few examples with a = 1 and n being 1/2, 2, and 4 (from left to right).


So you can see that the larger n gets, the more the superellipse looks like a square.  I thought that a value of n = 6 looked just about right for ravioli.

Ravioli with pesto.

Because I wanted the outer edge of the ravioli to have a radius of approximately 1, I used a value of a = 0.7 for the inner mound.

I should say a few words about using polar coordinates.  Since superellipses are easily described with Cartesian coordinates, why bother to convert to polar?  Well, I needed to get the scalloped ravioli edge.  To show a simple example, consider a plot of the polar function

r=1+0.1\cos(12 \theta),\qquad 0\le\theta<2\pi.

Here’s what it looks like:


Notice how adding the additional cosine term to r makes the circle “oscillate” as \theta moves around the circle.  Also notice how the coefficient of \theta tells you how many scallops there are around the edge.

This is a fairly simple way to produce something that looks like the edges of ravioli, so I decided to use polar coordinates for everything.  Of course you remember the conversion, based on the definition of sine and cosine:

x=r\cos\theta,\quad y=r\sin\theta.

Substituting into the superellipse equation gives


and solving for r results in


And of course when n is even, the absolute value signs aren’t necessary.  So this gives the equation for the inner mound as


Now let’s move on to the outer, scalloped edge of the ravioli.  Let’s first look at the following polar function, which is basically a superellipse with some scalloping:


It looks like this (graphed together with the inner mound):


You can see the way the scalloping is modified when using a superellipse rather than a circle.  But in my mind, ravioli edges are a bit more “crinkly” than this.  The outer edges of the ravioli were just too smooth.

But there’s a nice fix.  It comes from the fact that the arccos (I prefer this notation for the inverse cosine function, since an exponent of -1 can be ambiguous) function is really not an inverse of the cosine function, since the graph of the cosine function fails the horizontal line test.  So we consider the domain of the arccos function to be [-1,1] and the range to be [0,\pi].  In this case, the graph

y=\arccos(\cos x)

looks like the line y=x on the interval [0,\pi]. But on the interval [0,4\pi], the function y=\arccos(\cos x) looks like


Now it should be clear that this function must be periodic with period 2\pi.  But what is happening on the interval [\pi,2\pi]?  In this case, x is in quadrants III and IV.  Since the range of \arccos x is [0,\pi], we’ve got to flip x over the x-axis — in other words,

\arccos(\cos x)=2\pi-x.

You can see that this is the correct equation for the graph on the interval [\pi,2\pi].  Add in the periodicity, and there you have it!

Using this new function adds the crinkliness to the ravioli edge.  Delicious!

And for the final equation, we note that if we would like to simultaneously graph r=f_1(\theta) and r=f_2(\theta), we simply graph the equation


So there it is — The Ravioli Equation!  Of course you can change the parameters around to suit your particular taste in pasta.  And you can even fiddle with how the corners of your ravioli look.  Using sine rather than cosine, the equation

\left(r-\dfrac1{(\cos^6\theta+\sin^6\theta)^{1/6}}-0.03 \arcsin(\sin(24\theta))\right)\times

\hbox{ } \qquad\qquad\qquad\qquad\left(r-\dfrac{0.7}{(\cos^6\theta+\sin^6\theta)^{1/6}}\right)=0

produces the ravioli below.


Does it look tastier than the cosine version?  Hard to decide….

I hope you’ve enjoyed this introduction to the art of mathematical pasta making!  It’s a fun activity, and definitely stimulates the appetite….  If you need some practice, here’s another fabulous dish of ravioli I had in Florence.  Make it!  Mathematically, of course…


Buon appetito!

Published by

Vince Matsko

Mathematician, educator, consultant, artist, puzzle designer, programmer, blogger, etc., etc. @cre8math

3 thoughts on “The Ravioli Equation”

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s