July 2, 2014

Lorenz Attractor Day 1

Today I did some major work on the Lorenz Attractor program. It's far from done, but I was able to draw the fractal on the screen in 3D. Here are a few nice intermediate screenshots:






I finished transcribing the code from the book I have, and then started rewriting it for a number of reasons:
  1. The original code calculated positions component-wise; the code was repeated three times for the x, y, and z direction. In my version of the program, I used vectors which do all three directions at once.
  2. The old code was repeated three times for three different 2D projections of the 3D system. In my program, I drew the curve with 3D graphics, so most of the old code was irrelevant to me. 
  3. The old code had a bad coding style. Numbers were entered into the code directly, which by modern standards is bad coding practice. I am fixing this with named variables and constants in my program.
I realize that these problems are due to the book being about 25 years old. It's an interesting programming challenge to update the code to modern standards.

Tomorrow I will discuss the Lorentz Attractor in more detail to explain what this fancy chaos really means!

Today I also got another order of electronics parts. I ran a test of one of two infrared (IR) sensors to see how they work. Here are the results:
Eventually I will use the sensor in tandem with my Arduino board. However, I have a few last tricks up my sleeve for my dot matrix! Stay tuned!

No comments:

Post a Comment