Posted May 23, 2015
Wishbone: Thanks, but I fell off completely around halfway down page 4. I never took high-level math, so when an explanation evolves into too many long equations filled with weird variables, I tend to lose track of what is going on.
Regardless, the algorithm is a beautiful shortcut, even if I don't quite understand how it works. It's also the first time I've ever seen code which intentionally interprets the bit pattern of one data type as another. I never imagined that maneuver could have any practical applications outside of possibly cryptology, but the way it is used here truly is elegant.
You know, I never thought much of high school math either until I saw it used in the real world. While this is just one interesting example of it (in the case of digital video manipulation), there are so many other things we take for granted, like coefficient of friction for our tires around curves on icy roads (and why they have speed limits) all the way to the flushing of our toilets and the physics that goes on behind plumbing. Regardless, the algorithm is a beautiful shortcut, even if I don't quite understand how it works. It's also the first time I've ever seen code which intentionally interprets the bit pattern of one data type as another. I never imagined that maneuver could have any practical applications outside of possibly cryptology, but the way it is used here truly is elegant.
While you don't need the high level math, it's there and it's a way to express some of the things we see in nature in a "formulaic" way.
Interpreting one bit pattern of one data type for another is not really much different than using a different base system for numbers. People usually use base ten on a daily basis, so they use the digits zero through nine. However, people who use base two, zero and one. You kind of get the picture. You can easily convert one base to another if you know the formula (which does require some mathematics).
There are a lot of elegant algorithms out there! :)