Skip to content

dblume/pizza-slice

main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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.

About

How to divide the last slice of pizza πŸ• with all crust on one half and only cheese on the other.

Resources

License

Stars

Watchers

Forks

Packages

No packages published