errore Math.cos in spot.js