My Analytical Chemistry class just started the module on spectroscopy, and I wanted to have a visualization that displayed the different types of motion (rotational, translational and stretching) that molecules can experience. It turned out, I was able to make an interactive (sort of) graphic with a few lines of Mathematica code:

Here’s the code I used, in case you happen to have access to Mathematica and would like to try it out. It loads carbon dioxide from the Wolfram knowledgebase and then uses transformation functions to perform the translation, rotation and scaling operations. I take advantage of the structure of the GraphicsComplex to perform the transformations on just the coordinates instead of the actual objects (spheres in this case, which would get squished if the scaling transform was applied to the entire object. The dimensions of the graphic are hard coded for carbon dioxide, so a bit of work will be required to expand this tool to other molecules. Lastly, I create some DownValues that make it easy to use the Manipulate interface for swapping between the three types of motion.