Spinning a point around the z-axis is a 2D rotation in disguise: the x and y coordinates swirl around, and z doesn't move at all — it's the axis you're turning about, like a bead on a skewer.
Task: write rotate_z(point, degrees) returning the rotated point [x', y', z'], each coordinate rounded to 4 decimal places.
point is [x, y, z].degrees is in degrees — convert to radians with math.radians before using sin and cos, because they expect radians.z included.Two details worth noticing. The minus sign sits in the x' formula only — swap it onto y' and you've silently built a rotation that goes the wrong way. And the rotation preserves distance from the axis: x'² + y'² always equals x² + y², which is the cleanest way to check your implementation on any input at all.