GamesEngine.Grid.Coordinate (games_engine v0.1.0)
Functions for handling coordinate transformations and translations
Summary
Functions
Converts a coordinate's linear index to row/col subscript
Types
Functions
Link to this function
ind_2_sub(ind, arg)
@spec ind_2_sub( non_neg_integer(), {non_neg_integer(), non_neg_integer()} ) :: t()
Converts a coordinate's linear index to row/col subscript
0 | 3 | 6 | 0,0 | 0,1 | 0,2 | |
1 | 4 | 7 | --> | 1,0 | 1,1 | 1,2 |
2 | 5 | 8 | 2,0 | 2,1 | 2,2 |