EBSDhex.cube2hex edit page

convert cube coordinates into offset coordinates

Description

The inverse of hex2cube. Cells outside the measured grid are returned as NaN. Called with a single output the linear index into the grid is returned instead of row and column.

Syntax

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

Input

ebsd EBSDhex
x, y, z cube coordinates of the cells

Output

row, col offset coordinates of the cells, |NaN| outside the grid
ind linear indices of the cells

See also

EBSDhex.hex2cube