Matlab code

Cartoon of a synchrotron facility  

This animation is a cartoon of a synchrotron facility containing 12 sectors, six of which being hard x-ray ID beamlines (blue radiation, small periodicity magnet arrays) and the other six soft x-ray beamlines (red radiation, large periodicity magnet arrays). In addition, there are 12 bending-magnet arcs (golden radiation). The movie covers 60 degrees (one HXR ID and one SXR ID); playing it on loop will provide continuity. 

The code is clunky and difficult to reverse engineer, so any tips for significant improvements are most welcome!