javascript Vector2D class