Function to rotate a quaternion by the given amount
class quaternion: __slots__ = (“x”, “y”, “z”, “w”) def __init__(self, x: float, y: float, z: float, w: float): self.x = x self.y = y self.z = z self.w = w def rotate(self, x: float, y: float, z: float): # Correctly bump self.x, self.y, self.z, self.w with the provided radians I’m implementing quaternion rotations in my […]