skrobot.coordinates.math.convert_to_axis_vector

skrobot.coordinates.math.convert_to_axis_vector(axis)[source]

Convert axis to float vector.

Parameters:

axis (list or numpy.ndarray or str or bool or None) – rotation axis indicated by number or string.

Returns:

axis – converted axis

Return type:

numpy.ndarray

Examples

>>> from skrobot.coordinates.math import convert_to_axis_vector
>>> convert_to_axis_vector('x')
array([1, 0, 0])
>>> convert_to_axis_vector('y')
array([0, 1, 0])
>>> convert_to_axis_vector('z')
array([0, 0, 1])
>>> convert_to_axis_vector('xy')
array([1, 1, 0])
>>> convert_to_axis_vector([1, 1, 1])
array([1, 1, 1])
>>> convert_to_axis_vector(True)
array([0, 0, 0])
>>> convert_to_axis_vector(False)
array([1, 1, 1])