EBSDhex.hex2cube edit page

convert offset coordinates into cube coordinates

Description

Cells of a hexagonal grid are addressed by a row and a column index, so called offset coordinates. For many computations the three digit cube coordinates x, y, z are more convenient as they satisfy x + y + z == 0 and all six neighbours differ by exactly one step in two of the three coordinates. See here for the details.

Syntax

[x,y,z] = hex2cube(ebsd,row,col)
[x,y,z] = hex2cube(ebsd,ind)

Input

ebsd EBSDhex
row, col offset coordinates of the cells
ind linear indices of the cells

Output

x, y, z cube coordinates of the cells

See also

EBSDhex.cube2hex