This 3D print has slices that represent a (linear) trip in the Julia Set from 0+0i to 0.32+0.64i. I wrote a Processing program to create the 400 Julia slices and then Fiji stitched the 2d images together into a 3D model. Here’s the interactive mandelbrot -> julia program that is featured in the last gif. The printer is a resin based SLA model (prints from liquid goo!).

]]>The connection between learning math and playing with math has been on my mind lately. Another connection that I’ve been thinking about is the interplay between math and art. This morning I decided to merge these two thoughts. I originally tweeted under the hashtag #playeveryday, but future challenges like these will be under the hashtag #playwithmath. Through exploring a graph in Desmos, can we both learn some math and make some interesting images?

Want to play (learn?) with polar fns, parametrics, & ellipses? Desmos link: https://t.co/LANeithex5 Share out your creations! #playeveryday pic.twitter.com/3lrKiF9WVh

— Dan Anderson (@dandersod) October 17, 2016

Here is some great work by some tweeps:

Making stars with Dan's equations https://t.co/ZV7pn7gpa4 https://t.co/sRoTPtu3au

— Paula Beardell Krieg (@PaulaKrieg) October 17, 2016

@dandersod @mathhombre Nice! pic.twitter.com/0E0KhEPCUm

— Simon Gregg (@Simon_Gregg) October 17, 2016

@dandersod @PaulaKrieg I added some friends pic.twitter.com/QjsGfqroMy

— Dan Allen (@AllenMath) October 17, 2016

@dandersod You inspired me to look at an ellipse that spins while being rotated around a circle. https://t.co/ZcgqxbpOFA #mathart pic.twitter.com/e0u9kRAcAd

— Luke Walsh (@LukeSelfwalker) October 17, 2016

What can you make? Can you learn some math by playing around?

]]>This workflow was done entirely in the web browser and could be done on a chromebook. The only step that requires a more serious computer is sending the file to your 3D printer. Also, writing up this blog post took three times longer than the actual workflow!

Make a design in Desmos, turn off grid and axes and take a screenshot. Here’s the design that I worked with, and the screenshot that I used. I have the function listed twice so that the design was fully black, but I don’t think this would have mattered.

Go to Selva3d and register for an account. Upload your screenshot and it will extrude it for you. Download the 3D file.

Note, if you want slightly higher quality (for free), you can bring the image to inkscape, convert it to svg, and bring the svg file to tinkercad. This requires you to install software, but there are also online png -> svg converters. It’s one more step for a bit more quality.

Bring the file to your 3D printing software for final tweaks. After 1 hour of printing, here’s the result!

Sidenote, selva3d has some cool partners. Here you can very easily order a phone case with your design on it for $21.

]]>

Have students create mathematical art in Desmos and bring that digital art into the physical world using a laser engraver. You can certainly bring any image from Desmos and engrave it into an object using a laser engraver, but this method allows you to cut out the actual line from the material so that all that is left is the shaded area.

Create a design in desmos that has lines which are crossing at points. This method will use the laser to cut on each side of a line, so that the material “inside” the line will remain.

Here’s an example: Wavy Sine Circles. Turn projector mode on.

Take a screenshot of your image.

Open the image with Inkscape (free and open source vector image editor), and then select the image by clicking on it.

Go to **Path -> Trace Bitmap.**

Select **Edge Detection**. This selection will make vector lines on each edge of our original image.

Drag one of the images sideways so that you can delete the original image and just have the vector image left.

Save the vector as a .svg file so that your laser cutter will be able to follow the lines directly (Vector vs Pixel images).

This output looks a bit “lacy” for most materials that I’d use in the laser cutter. The lines are too narrow. No problem, do the same steps with the original desmos image, but this time zoom out before you take your screenshot. Desmos will always make it’s lines a certain width, so if you zoom out, the lines will be relatively thicker. Here’s the result after a quick zoom out.

Bring your .svg file to the laser cutter that you have available (or to a vinyl sticker cutter). Here are some results (these are test cuts on manila folders):

What do you think students could make with this workflow?

I’ve had some trouble with the output from inkscape giving me double lines, so that the laser is making two cuts really close to each other. Here’s a fix.

When you go to trace the bitmap, keep the selection on brightness cutoff.

Result:

Move the vector off of the original image and delete the original image (the one that is fuzzy).

Change the fill and stroke to the following: No fill, black stroke.

Send to your laser cutter software. Much better!

]]>- Use your classmates for help and work together
- Good luck….even though homework’s aren’t graded make sure to actually DO them fully because if you don’t you’ll fall so behind….and retake as much as you can
- To study A LOT and with a group of people so that if you have any questions you guys can talk about it together.
- Also, you need to practice and study on your own if you do not understand something because it will catch up to you. You will not do well on the B quizzes if you don’t fully understand the material. If studying on your own doesn’t work, get extra help from a teacher.
- There’s a lot of material you will cover in this course, and you want to be able to look back on it at the end of the quarter / year. This course will never be easy, but it is manageable. Reassess every opportunity you get, even if it’s just a 4.5. If your scared you’ll lower your grade if you get a 4.5, you probably don’t know the material as well as your grade shows that you do, and you’ll suffer at the end of the quarter because of it.
- Take take homes seriously and do them with your friends, though never just copy what they have down. Though the skills on a take home are much more complex that what you need to do in class, they are skills you need to relatively comfortable with, and they actually do help a lot. If you don’t understand anything that you wrote down, stay after with Danderson and review the concepts. He can’t help you with the take home, but he can help you with the skills to do it (skills that you will need come midterm / final).
- Don’t be afraid to rely on people. You aren’t going to be able to get through this class alone even if you are like a math whiz.

In this post I’m going to outline how to use a workflow to go from a desmos sketch to a processing sketch to Fiji to a 3D file. The basic idea of the workflow is based on the idea of looking at a 3D object as a 2D image which is changed through time. Here’s a gif (source) that shows how we can view a cube (a 3D object) as a 2D slice.

So if we can create the 2D sketch, then we can create the 3D object with Fiji. Here’s a video that contains a walkthrough of all the steps involved in this process in more detail.

I used Desmos as a tool for quickly prototyping the 2D sketch. The original idea was to make a wavy cup. So the cup would start with a circle base, and slowly change up the walls to have a wavy top. Here’s the desmos sketch that shows the cup being sliced from the bottom to the top:

(There is more detail on how this sketch was created in the video.)

Next, we can bring the sketch to Processing so that we can easily save a bunch of frames and have a lot of control over all the details. Here’s the live code (had to be modified for openprocessing because PShape isn’t supported in JS), and here’s the original code. Once again, much more detail is available in the video.

Next bring the 400 frames into Fiji. Fiji is often used for stitching 2D images from MRI machines into 3D objects.

This is an optional step for shrinking the number of triangles used, and hence shrinking the model size.

Shown with Makerbot, but every 3D printer has software that can do these steps.

and two hours later:

These both use a different period for the sine function, and the second adds in a sine inside the first sine based on the height to give it the “wiggle” back and forth.

These were teased in a couple of tweets, the concept is the same as the wavy cup, but the size of each slice is controlled by a circle function. The desmos sketches are linked in the tweets.

If this represents slices of an object over time then what does the 3D object look like? https://t.co/PPjUGzvWj3 pic.twitter.com/btLQoaZuWp

— Dan Anderson (@dandersod) June 30, 2016

Likewise: https://t.co/dy4UdzTKzd pic.twitter.com/j3TocBT3iF

— Dan Anderson (@dandersod) June 30, 2016

The black spiral ball uses consecutive fibonacci periods spinning in different directions, which is why it looks like a pine cone.

Here’s the desmos sketch for this (admittedly weird model).

These were directly coded in processing, here’s the originating code to make the fractal.

Let me know if you know of a different way of making this kind of 3d model! It works pretty well, but there are some rough edges with taking the 2D images to make the 3D model. Cheers!

]]>Took this sketch from dailydesmos:

I had the student work on the solution after talking about superellipses (or the better name, squircles).

When he finished the solution, we modified it to get this sketch:

and we decided to try and get a 3D print of this sketch. We started working in madeup (a fantastic beta of a program that takes code and creates 3D models), but found it tricky to graph the function. Went back to desmos to get this sketch where we could figure out how to get the specific coordinates of points along the curve.

Fiddled around for a bit to get this result:

Here’s the code:

to abs x = if x > 0 then x else -x to func t_ a_ if (t_ < 0) t_ = t_ * -1 end out = a_ - t_ ^ 4 if (out < 0) out = abs out out = out ^ (0.2) out = - out else out = out ^ (0.2) end out end a = 20 h = 0 while a > 0 t = -3 while t < 3 x = t y = func t,a moveto x,y,h t = t + 0.025 end h = h + 0.1 extrude 0,0,1,-0.1 a = a - 1 end

Then click on the solidify button and download the model.

Send to makerbot, and pick up first thing monday!

]]>

@JuliaTsygan @ddmeyer Hi! I do a whole bunch of math in programming class. Only a small bit of code in math class. Darn curriculum.

— Dan Anderson (@dandersod) June 11, 2016

@dandersod huh, so are you saying this is uncharted? what code in math class do you do? What math in programming and why?

— Julia Tsygan (@JuliaTsygan) June 11, 2016

@JuliaTsygan we do a whole Mandelbrot fractal unit in precalc where we teach complex numbers through the fractal.+

— Dan Anderson (@dandersod) June 11, 2016

@JuliaTsygan I show the code I made and they help fill in the missing pieces from the complex number math.

— Dan Anderson (@dandersod) June 11, 2016

I’ve failed at teaching math topics directly through programming in math class. Maybe it’s a symptom of teaching math courses that are CHOCK full of material (IB PreCalculus Honors, and IB Calculus HL), but I just don’t seem to have the time to have the students work through the material at an appropriate rate. Or I’ve picked bad topics to try and teach through programming. Or it’s been a challenge to adapt to the different levels of student programming knowledge coming into math class. I don’t know. I’ve tried teaching arithmetic and geometric sequences and series with Python and loops, and I’ve tried teaching some probability through Python. No luck. I think it boiled down to the following problem:

- It’s tough to teach programming concepts AND sequences and series without taking a long time to build up. How can you (quickly) learn whether or not a series converges without having first understanding how a loop works, how variables work, and maybe how conditionals work. For example, this line of code, while easy for a programmer to understand, is *really* confusing for a new programmer in math class
x = x + 1

This line of code takes the current value of x, adds one, then stores it back into the variable x. “=” in most programming languages is an assignment operator, and “==” is an equality operator. Ich.

I think there ARE ways to teach a bit of math through programming. I just think that it’s use is limited. I presented on one of these topics at NCTM’s Annual Meeting in April of 2016, and at Twitter Math Camp in July 2015. All my resources are found here: Geometry from Scratch. Click through to get more details, but it boils down to the idea that you can be successful teaching Geometry or Middle School students about angles and polygons by having them use focused play in Scratch. They’ll discover the Exterior Angle Theorem after they’re asked to draw a hexagon. Likewise you can teach Geometry, Algebra, or Middle School students about slopes and lines by having them draw lines by making stairs.

Can you teach a big part of the math curriculum through programming in math class? Sure! In the same amount of class time? Nope!

I think the biggest gain can be found by teaching math topics in programming classes. The sticking point? They might all learn DIFFERENT math topics. At the end of our programming class, I give the students about 4 weeks to work on whatever project that they’d like. It’s graded on a loose rubric that is just looking for programming milestones. Out of a class of 16 students this year, here is a subset of their work when it came to learning and applying math topics to their work. Keep in mind, I gave no guidance to them learning math topics, these came up naturally from our previous work, and after they saw some examples of mathematical computer art (more on this later? Future blog post?)

*(This is my student math art gallery that just started!)*

The left picture is from a student who was having trouble landing on a specific topic and so just ended up making many smaller ideas into one project. You can read more in her blog post.

Here’s some code from her (all completely from scratch):

while (theta < 4*PI) { x = r*cos(theta); y = r*sin(theta); z = 2*r*cos((theta+PI/25));//finds the new point that the line should go to s = 2*r*sin((theta+PI/25)); x = map(x, -400, 400, 0, width); y = map(y, -400, 400, 0, width); z = x-z; s = y-s; lines(x,y,z,s);//calls the function lines theta = theta + PI/25;//repeats it until theta = 4PI so that the lines go in a circle }

This student is using polar coordinates that she learned in PreCalculus class, trigonometry with radians, and has used a proprortion to work with the colors (the *map* command). Later on the student uses the *%* operator, which calculates the remainder so that she can cycle through a set of drawing commands.

The picture on the right is from a student who was going to extend the Geometry from Scratch polygon angles from above. But the move and turn commands were too limited for him, so after a 5 minute talk, he learned how to use polar form of coordinates to easily make a n-gon from a given center. Keep in mind, that this student hadn’t heard of polar coordinates before and mastered them to get these shapes. I’m excited to see how much knowledge he’ll bring to PreCalculus next year when polar coordinates are officially “taught” to him. Here’s his blog post for his project.

This student designed a 3d model with code to create this fantastic piece of math art. It is a series of cocentric circles that represents the digits of pi, the center of the circle has a small circle with height 3. The next circle has height 1, then 4, then 1, … Here’s his blog post with code samples. He used 3D polar coordinates as well, and he made many connections to his project and the integration unit of his calculus class (rotational volumes).

This graphics program uses polar coordinates (yep again!), transparency, circles, trigonometry, lines, triangles and so much more to make some fantastic images. His blog post with more info.

This student did a project that has a grid of rectangles in a 3D environment and he rotates them in 3D based on a periodic pattern and the mouse position. Some really great use of translations, rotations, and 3D geometry. Here’s his blog post.

This student made a tank shooter game where the user (blue) battles the AI enemy (red). The really great math that this student had to apply and learn was the use of arctan to get an angle between two coordinates so that he could shoot between the coordinates. Impressive math. Blog post (sadly without the code or a link!).

Lastly, here’s a student’s work on making a bunch of bouncing coins. The math that this student had to work through was using vectors to make a gravity system and to obey Newton’s first law of motion. This senior hadn’t taken any math class that had vectors, nor had he taken any physics class. Yet he mastered the idea of velocity vectors to get the motion to work properly. He also was somewhat successful in making a collision system (from scratch!), a very hard task. His blog post.

I don’t know. That feels like much of my progress into adulthood. I’m less definitive about statements. I know that I don’t know a *whole *lot.

]]>

I’ll certainly poll the students and see where their interests lie, but I’d like to see what you think. What do you do after the AP/IB exams? What do you think of the programming and/or problem solving sessions?

Thank you for your input. ]]>

RAY: This Puzzler came from Kevin Tobin. A maharajah owned a mango tree that had very sweet, abundant fruit. People would come from miles around to pick the fruit. So the maharajah decided to protect the tree by erecting a series of seven concentric fences around it. Each fence had a gate with a guard. To get to the tree a person would have had to pass through seven gates and pass seven guards. One day, a man approached the guard at the first gate and said, “If you let me pass, when I come back I’ll bring you some mangoes. I will give you half of the mangoes I have, but you must give me one back.” For example, if he brings back 10 mangoes, he’ll give five to the guard and the guard will give one back. The guard let the man in through the gate, and the man proceeded to make the same deal with the other six guards. The question is: How many mangoes did the man have to get to pass back through the seven gates, giving half to each guard and the guard giving one back?

Similar to Gone Fishin’ puzzler.

]]>