Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

y and x axis reversed #58

Open
nekromoff opened this issue Feb 1, 2019 · 4 comments
Open

y and x axis reversed #58

nekromoff opened this issue Feb 1, 2019 · 4 comments

Comments

@nekromoff
Copy link

One would expect to have x followed by y (.e.g my grid is grid[x][y]). This engine unfortunately uses non-standard y first and then x second [y][x]. Took me few days to identify the culprit. Maybe this report will help somebody.

@Bobbyjoness
Copy link

In cs universally its y followed by x. I do not know why, but his code his correct.

@nekromoff
Copy link
Author

nekromoff commented May 14, 2019

The code is not correct or incorrect.
However, the standards are X-Y, it's basic Cartesian system (even, if Y actually starts based on old CRTs from the top, the order is X followed by Y).
https://en.wikipedia.org/wiki/Cartesian_coordinate_system

@nekromoff
Copy link
Author

nekromoff commented May 14, 2019

Also, it should be documented, if it's not using the standard X-Y order. It is not.

@Bobbyjoness
Copy link

For points yes it is x,y. but for 2d arrays in code visually its obvious that the first number specifies the row i.e y. The second number specifies the column i.e x. Y-X is the standard order in CS for grids and 2d arrays because in reality it is Row-Column which is what matches up with the way the code looks. I am not saying points in general are specified as Y-X because they are not. but when it comes to storage it is stored as Y-X.
'''
{
{1,1,1},
{1,1,1},
{1,1,1},
}
'''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants