1% =========================================================================== %
2%> @brief convert a vector to an axis and a direction
6%> @retval axis axis (1, 2, 3)
7%> @retval dir direction (1, -1)
10%> [axis, dir] =
vec2axisdir([1, 0, 0]) % returns
"x",
"positive"
11%> [axis, dir] =
vec2axisdir([-1, 0, 0]) % returns
"x",
"negative"
14%> %> @copyright see the file @ref LICENSE in the root directory of the repository
15% =========================================================================== %
23assert(sum(abs(vec)) == 1, "The vector must be a unit vector")
24assert(max(abs(vec)) == 1, "The vector must align with an axis")
function vec2axisdir(in vec)
convert a vector to an axis and a direction