uxarray.grid.coordinates.normalize_in_place

uxarray.grid.coordinates.normalize_in_place#

uxarray.grid.coordinates.normalize_in_place(node)#

Helper function to project an arbitrary node in 3D coordinates [x, y, z] on the unit sphere. It uses the np.linalg.norm internally to calculate the magnitude.

Parameters:

node (float list) – 3D Cartesian Coordinates [x, y, z]

Returns:

the result unit vector [x, y, z] where \(x^2 + y^2 + z^2 = 1\)

Return type:

float list

Raises:

RuntimeError – The input array doesn’t have the size of 3.