def roty(theta, unit="rad"):
"""
ROTY Rotation about Y axis
:param theta: angle for rotation matrix
:param unit: unit of input passed. 'rad' or 'deg'
:return: rotation matrix
roty(THETA) is an SO(3) rotation matrix (3x3) representing a rotation
of THETA radians about the y-axis
roty(THETA, "deg") as above but THETA is in degrees
"""
check_args.unit_check(unit)
if unit == "deg":
theta = theta * math.pi / 180
ct = math.cos(theta)
st = math.sin(theta)
mat = np.matrix([[ct, 0, st], [0, 1, 0], [-st, 0, ct]])
mat = np.asmatrix(mat.round(15))
return mat
# ---------------------------------------------------------------------------------------#
评论列表
文章目录