Just stumbled across this code in one of my private projects:
core::vector3df a(4, 2,-4); core::vector3df b(-4,-4, 2); core::vector3df c(2, 4, 4);
float v = a.crossProduct(b).dotProduct(c); |
First I had no idea what the did and why I wrote it. But then I remembered: It calculates the volume of the parallelepiped described by the vectors a, b and c. I just calculated the volume there because I needed it for a math exercise and was to lazy to calculate it in my brain. And I didn't erase the code again. ;) Maybe I should stop using VC++'s debugger as calculator.