question: public PlaPointInt round_to_grid ( int p_horizontal_grid , int p_vertical_grid ) { double rounded_x ; if ( p_horizontal_grid > 0 ) { rounded_x = Math . rint ( v_x / p_horizontal_grid ) * p_horizontal_grid ; } else { rounded_x = v_x ; } double rounded_y ; if ( p_vertical_grid > 0 ) { rounded_y = Math . rint ( v_y / p_vertical_grid ) * p_vertical_grid ; } else { rounded_y = v_y ; } return new PlaPointInt ( rounded_x , rounded_y ) ; }
target:  Round this Point so the x coordinate of the result will be a multiple of p_horizontal_grid and the y coordinate a multiple of p_vertical_grid.