# Time To Cut The Cake

I ran across a couple of cool Lego links yesterday. One of was this link to Robots for Everyone: Getting Kids Interested in Programming with Legos which talks about how educators are using Lego Mindstorms and other kits to get students interested in STEM fields and especially programming. Lego is a pretty cool set of products. THe second link was this Lego machine that cuts cake via Make Magazine.

Now that is great but I don’t have a whole Lego NXT set nor am I particularly mechanical. But I thought I could do some of the math. Right? Why not? So I wrote some code in Small basic to cut circles into even sections. The images below are 7 sections, 70 sections, and 150 sections. This ran a lot faster than cutting that cake in the video did but I doubt it was as much fun as eating the cut cake was.

There are a couple of things that make this a good project. First are the programming concepts – loops and arrays are prominent in the solution I adopted. Then there is the graphic piece which allows the creation of visually interesting results. Lastly, but far from unimportant, is the incorporation of math in the process. Degrees and Radians, coordinate geometry,  and of course some basic algebra for the calculations of things. Some discussion of Sine and Cosine while are both used for calculating the points also comes into play. There is also the basics of geometry in the form of the circle that is “cut” because things like understanding the center, points on the circle and the radius are valuable in the understanding of the solution.

One could do all this with pencil and paper using triangles, compasses, and other drawing tools of course. A lot of us did back in the day. While there may be some value in that I think that using the computer to show us lots of different patterns is also valuable in its own right. I think students who write a program like this understand the concepts just as well, perhaps even better, that those who do it the old fashioned way. Not that I have data to support that theory. But one other advantage is that now they have some code they can use, adapt, modify and incorperate into other projects later on. In a sense they are building a tool as well as learning a concept. That has to be a good thing.