Javascript 2d Vector