The final three methods you will add are all for rotation. They allow you to rotate around any axis:
def rotate_x(self, amount) :
amount $=$ math.radians (amount)
self.MVM $=$ self.MVM@np.matrix([
$[1,0,0,0]$,
[0, math.cos (amount),
math.sin (amount), 0],
[0, -math. $\sin$ (amount),
math.cos (amount), 0],
$[0,0,0,1]])$
def rotate_y(self, amount) :
amount $=$ math.radians (amount)
self.MVM = self.MVM@np.matrix([
[math.cos (amount), 0 ,
-math.sin(amount), 0],
$[0,1,0,0]$,
[math.sin(amount), 0 ,
math.cos (amount), 0],
$[0,0,0,1]\})$
def rotate_z(self, amount) :
amount $=$ math $\cdot$ radians (amount)
self.MVM $=$ self.MVM @ np.matrix([
[math.cos(amount), math.sin(amount),
$0,0]$,
[-math.sin(amount), math.cos(amount),
$0,0]$,
$[0,0,1,0]$,
$[0,0,0,1]])$
Take note of how the three rotation matrices have been formatted for the different axes.