import torch


def Rotz(t):
	"""
		Rotation about the z-axis.
		np.array([[c, -s,  0], [s,  c,  0], [0,  0,  1]])

		-- input t shape B x 1
		-- return B x 3 x 3
	"""
	B = t.shape[0]
	Rz = torch.zeros((B, 9, 1), dtype=torch.float)

	c = torch.cos(t)
	s = torch.sin(t)
	ones = torch.ones(B)

	Rz[:, 0, 0] = c
	Rz[:, 1, 0] = -s
	Rz[:, 3, 0] = s
	Rz[:, 4, 0] = c
	Rz[:, 8, 0] = ones

	Rz = Rz.reshape(B, 3, 3)

	return Rz