How to divide the last slice of pizza 🍕 with all crust on one half and only cheese on the other.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
images
.codeclimate.yml
LICENSE
README.md
icon-120.png
icon-128.png
icon-152.png
icon-167.png
icon-180.png
icon-192.png
index.html
main.css
main.js
pizza.sublime-project
pizza_slice.py

README.md

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.

Origin

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:

shortcut

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

shortcut

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?

Yes.