Can we capture the unpredictable evolutionary and emergent properties of nature in software? Can understanding the mathematical principles behind our physical world help us to create digital worlds? This class focuses on the programming strategies and techniques behind computer simulations of natural systems. We explore topics ranging from basic mathematics and physics concepts to more advanced simulations of complex systems. Subjects covered include physics simulation, trigonometry, fractals, cellular automata, self-organization, and genetic algorithms. Examples are demonstrated using the p5.js environment with a focus on object oriented programming.
Session 1: Introduction / Overview In this session we’ll review the basics of p5.js and get everyone up and running with posting sketches online. We’ll look at how object-oriented programming works in JS and create simple sketches of objects moving around a canvas.
Session 2: Vectors / Forces This session will look at the concept of a vector and implement sketches using a p5.Vector object. By creating objects with vectors for position, velocity, and acceleration, we’ll build a simple “hello world” physics engine.
Session 3: Steering Behaviors This session, we’ll examine a special kind of force (pioneered by Craig Reynolds) — a steering force — that moves an object according to its own goals or desires. Examples are wandering, seeking a target, path following, obstacle avoidance, and more. We’ll then look at how group behaviors can be simulated by combining multiple steering behaviors according to local interactions between objects.
Session 4: Fractals In this session we will cover the concept of a fractal and look at ways of generating fractal patterns with code.
Session 5: Genetic Algorithms This session will look at the key concepts of Darwinian evolution — variation, selection, heredity — and examine how they can be applied in a computer simulation.
MOOCs stand for Massive Open Online Courses. These arefree online courses from universities around the world (eg. StanfordHarvardMIT) offered to anyone with an internet connection.
How do I register?
To register for a course, click on "Go to Class" button on the course page. This will take you to the providers website where you can register for the course.
How do these MOOCs or free online courses work?
MOOCs are designed for an online audience, teaching primarily through short (5-20 min.) pre recorded video lectures, that you watch on weekly schedule when convenient for you. They also have student discussion forums, homework/assignments, and online quizzes or exams.
Dan is an unbelievable teacher! I always wanted to go to NYU but in reality I could never afford it. Thank you for sharing this knowledge with the world. I bought your book last year but this class really helped me step through it piece by piece. It is not an easy course. But I can't believe what I was able to create! The best part was seeing what other students were making at the same time from all around the world. Thank you. Thank you. Thank you.
Dan Shiffman has great courses on his youtube channel. Coding Rainbows! But this course is so well made. Only on week 1 but cant wait for the next sessions to be released! Also great to see other students work in the gallery.
This was a great course. Dan is a very dynamic, entertaining and funny teacher. The video lectures were well done and the assignments appropriate to the content. The last session seemed a little compressed – a couple of advanced subjects that might have been better as separate session/assignments – but overall it was an excellent course. I have done several courses on Kadenze and this was one of the best.
I stumbled upon Dan Shiffman's one-hour of code video a few months ago and I'm now officially hooked and trying to watch every tutorial videos/course he makes. I didn't know anything about code before and the way he explains it make it very accessible and also pushes me to know more and more. I highly recommend his course.
This is the most interesting course for creative programming, or simply if you are a programming enthusiast. The course materials are excellent, and provide a wide range of personal exploration, and you are able to model many interesting, real or fictional, natural scenarios.
Great course with a terrific teacher (I started following Dan Shiffman on Youtube after completing the course). I learned a lot and there are many connected topics and areas that got me interested — simulations, games, P5.js in general, etc.