Made Vec2d X vs Y parameratizable

Now instead of writing a function twice, once for X and once for Y, I
can write it once for parameter “axis”.
Did that to the grid entrance/exit functions.