Assume I have this $5 \times 5$ grid with a red point on it. The position of the point relative to the top left corner ($x$ axis has "right" direction as positive, $y$ axis has "down" direction as positive) is $(2,3)$.
Now let's say I resize this grid to $10 \times 10$. I want the point to be dependant on the $5 \times 5$ grids point. So the new position, in the $10 \times 10$ grid, of the point should be $(2 \cdot 2, 3 \cdot 2)$ since I doubled the width and height of the new grid.
My question is, how do I figure out the new position in a grid with a more difficult grid size (in this case, that isn't a multiple of $5$) eg: in a $27 \times 27$ grid.
What would be the algorithm to figure out the new coordinates of the point ?