Can't we just round it up... int(5/10)==0,int(2/10)==0, so (5,2) on the big map corresponds to (0,0) on the small map, like this...? Uh-huh, okay, because I am used to C++ array subscripts starting from 0, so the default coordinate values are all non-negative. If the coordinates of the subject are positive numbers, then use the ceil function to round them up.
Why does it feel weird? Is it because I didn’t understand the purpose of the question?
Can't we just round it up...
int(5/10)==0,int(2/10)==0
, so (5,2) on the big map corresponds to (0,0) on the small map, like this...?Uh-huh, okay, because I am used to C++ array subscripts starting from 0, so the default coordinate values are all non-negative. If the coordinates of the subject are positive numbers, then use the
ceil
function to round them up.Why does it feel weird? Is it because I didn’t understand the purpose of the question?