def trotx(theta, unit="rad", xyz=[0, 0, 0]):
"""
TROTX Rotation about X axis
:param theta: rotation in radians or degrees
:param unit: "rad" or "deg" to indicate unit being used
:param xyz: the xyz translation, if blank defaults to [0,0,0]
:return: homogeneous transform matrix
trotx(THETA) is a homogeneous transformation (4x4) representing a rotation
of THETA radians about the x-axis.
trotx(THETA, 'deg') as above but THETA is in degrees
trotx(THETA, 'rad', [x,y,z]) as above with translation of [x,y,z]
"""
check_args.unit_check(unit)
tm = rotx(theta, unit)
tm = np.r_[tm, np.zeros((1, 3))]
mat = np.c_[tm, np.array([[xyz[0]], [xyz[1]], [xyz[2]], [1]])]
mat = np.asmatrix(mat.round(15))
return mat
# ---------------------------------------------------------------------------------------#
评论列表
文章目录