Calculate trajectories in voxel.js