Open for Enrollment

You can also start immediately after joining!
Join Now

Would you like to enroll?

Enrollment for this course has closed. But you can enroll in a future offering (please select)

Enrollment has closed

Go at your own pace
5 Sessions / 6 hours of work per session
Price
Premium membership $20/month (Preview session 1 free)
Included w/ premium membership ($20/month)
Skill Level
Intermediate
Video Transcripts
English, Spanish; Castilian, Chinese, Portuguese
Topics
p5.js, Physics, Mathematics

Not available for purchase in India

Open for Enrollment

The Nature of Code

Open for Enrollment
You can also start immediately after joining!

Would you like to enroll?

Enrollment for this course has closed. But you can enroll in a future offering (please select)

Enrollment has closed

Go at your own pace
5 Sessions / 6 hours of work per session
Price
Premium membership $20/month (Preview session 1 free)
Included w/ premium membership ($20/month)
Skill Level
Intermediate
Video Transcripts
English, Spanish; Castilian, Chinese, Portuguese
Topics
p5.js, Physics, Mathematics

Not available for purchase in India

Course Description

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.

Video featuring original artwork in P5.js by:
Particle Equalizer #1 by Sehyun Kim
Look at me! by Muqing Niu
Dancing Spring by Yue Hu
FireWork by Yue Hu
Nature Of Code final at ITP by Joe_Mango
Nature of Code - midterm by Marcela Nowak
Sound And Motion Coding by Marcela Nowak


Reviews
schedule

This course is in adaptive mode and is open for enrollment. Learn more about adaptive courses here.

Session 1: Introduction / Overview (November 19, 2024)
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.
10 lessons
1. Introduction
2. What is P5.JS?
3. Random Walker
4. What is a Vector?
5. Vector Math
6. Building a Physics Engine
7. Acceleration
8. Accelerating Towards the Mouse (Premium Exclusive)
9. Perlin Noise (Premium Exclusive)
10. Assignment (Premium Exclusive)
Session 2: Vectors / Forces (November 26, 2024)
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.
8 lessons
1. Newton's Laws of Motion (Premium Exclusive)
2. Adding Forces (Premium Exclusive)
3. Force Accumulation (Premium Exclusive)
4. Adding Mass (Premium Exclusive)
5. Gravitational Attraction (Premium Exclusive)
6. Friction (Premium Exclusive)
7. Arrays of Particles (Premium Exclusive)
8. Assignment (Premium Exclusive)
Session 3: Steering Behaviors (December 3, 2024)
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.
8 lessons
1. Steering Behaviors - Introduction (Premium Exclusive)
2. What is an Autonomous Agent? (Premium Exclusive)
3. Steering Force: Seek (Premium Exclusive)
4. Arrival (Premium Exclusive)
5. Flow Field (Premium Exclusive)
6. Group Behavior: Separation (Premium Exclusive)
7. Combining Behaviors: Seek and Separate (Premium Exclusive)
8. Complex Systems: Flocking (Premium Exclusive)
Session 4: Fractals (December 10, 2024)
In this session we will cover the concept of a fractal and look at ways of generating fractal patterns with code.
6 lessons
1. Introduction (Premium Exclusive)
2. What are Fractals? (Premium Exclusive)
3. Recursion with Functions (Premium Exclusive)
4. Recursion with Transformation (Premium Exclusive)
5. Recursion with Arrays of Objects (Premium Exclusive)
6. Conclusion & Assignment (Premium Exclusive)
Session 5: Genetic Algorithms (December 17, 2024)
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.
13 lessons
1. Evolutionary Computing (Premium Exclusive)
2. What is a Genetic Algorithm? (Premium Exclusive)
3. The Shakespeare Monkey Problem (Premium Exclusive)
4. Darwinian Natural Selection (Premium Exclusive)
5. Algorithm part 1: creating a population (Premium Exclusive)
6. Algorithm part 2: selection (Premium Exclusive)
7. Algorithm part 3: reproduction (Premium Exclusive)
8. Putting it all together (Premium Exclusive)
9. Varying the Parameters of the Genetic Algorithm (Premium Exclusive)
10. Smart Rockets (Premium Exclusive)
11. Interactive selection (Premium Exclusive)
12. Ecosystem Simulation (Premium Exclusive)
13. Conclusion (Premium Exclusive)
Show off your Certificate of Accomplishment

Verify Your Achievements
Whenever you complete a course as a premium member, you can earn a verified Certificate of Accomplishment. These certificates are proof that you completed an online course on our platform.

Easily Shareable
Using its unique link, you can share your certificate with everyone from future employers and schools, to friends, family, and colleagues. It's the perfect tool to help you land that new job or promotion, apply to college, or simply share your achievements with the world.

Learning Outcomes

Below you will find an overview of the Learning Outcomes you will achieve as you complete this course.

Instructors And Guests
What You Need to Take This Course
  • Equipment: PC/Mac with installation privileges
  • Software: P5.js
Additional Information

Peer Assessment Code of Conduct: Part of what makes Kadenze a great place to learn is our community of students. While you are completing your Peer Assessments, we ask that you help us maintain the quality of our community. Please:

  • Be Polite. Show your fellow students courtesy. No one wants to feel attacked - ever. For this reason, insults, condescension, or abuse will not be tolerated.

  • Show Respect. Kadenze is a global community. Our students are from many different cultures and backgrounds. Please be patient, kind, and open-minded when discussing topics such as race, religion, gender, sexual orientation, or other potentially controversial subjects.

  • Post Appropriate Content. We believe that expression is a human right and we would never censor our students. With that in mind, please be sensitive of what you post in a Peer Assessment. Only post content where and when it is appropriate to do so.

Please understand that posts which violate this Code of Conduct harm our community and may be deleted or made invisible to other students by course moderators. Students who repeatedly break these rules may be removed from the course and/or may lose access to Kadenze.

Students with Disabilities: Students who have documented disabilities and who want to request accommodations should refer to the student help article via the Kadenze support center.  Kadenze is committed to making sure that our site is accessible to everyone. Configure your accessibility settings in your Kadenze Account Settings.