Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Coordinate vs position

Tags:

math

naming

struct Point2D
{
  int x;
  int y;
};

There is a 2D tile-based map. How to name variable of type Point2D which represents coordinates of specific tile?

Point2D tilePosition;

or

Point2D tileCoordinate;

I have problem in understanding difference between coordinate and position.

like image 728
John Lock Avatar asked Oct 19 '25 10:10

John Lock


1 Answers

Coordinate system is just a way to identify position, I prefer tilePosition. IMHO, naming is supposed to indicate the meaning of the variable, not what the inside structure is.

like image 73
delta Avatar answered Oct 22 '25 04:10

delta



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!