Skip to content


Repository files navigation

Code Climate Issue Count License python2.x

Dividing the Last Pizza Slice

Drag left and right on the pizza slice at the Last Pizza Slice. Notice how the the straight horizontal cut that evenly divides the pizza moves up and down a little? That's it. That's all this website does. We're done here.


My middle-school-aged son asked me how one would cut such a slice of pizza, given that it was a 14-inch pizza, and it had eight slices, so each slice's angle, θ, was 45°.

Want to solve it yourself? Stop reading, spoilers follow:


It took me longer than it should have to figure it out. I knew it'd be possible, but my trigonometry was rusty.


Of course, having eventually solved the simple problem, I began to suspect that the location of the cut would move subtly if you vary the angle of the slice. Obviously, that calls for an open-source website, and here we are.

Even More Interesting: When θ > 1.9 radians

Once θ grows to be over 1.9 radians the problem became more interesting and I had some trouble coming to a solution. The shapes of the two halves require more complicated math.

Being confronted with that challenge was irresistable.

Is it any good?



How to divide the last slice of pizza 🍕 with all crust on one half and only cheese on the other.







No packages published