unit

m3sh.linalg.unit(u)[source]

Vector normalization.

Convenience function to normalize a vector.

Parameters:

u (ndarray, shape (3, )) – Vector in \(\mathbb{R}^3\).

Returns:

Normalized copy of input vector.

Return type:

ndarray, shape (3, )

Note

No error checking (division by zero, input vector shape) is performed.