Update index.js

Added proper rotation and calculus-based dot spacing. Kind of a mess.