I was playing around with robot localization the other day, and realized that the angular degrees of freedom a robot has follow an interesting pattern. A robot that can just move around a floor has only one degree of angular freedom; it can rotate to the left or right. A flying robot, on the other hand, has three angular degrees of freedom: it can pitch, roll, or yaw.

That made me curious how the number of angular degrees of freedom is related to the number of spatial degrees of freedom. If we could build a robot that could move in the 4th spatial dimension, how would it rotate?

A robot that can only move along one line is the degenerate case. This one dimensional bot has a single binary degree of freedom in rotation. It can point either forward or backwards.

A robot that can move in a single plane, like a roomba, has a single angular degree of freedom in rotation. It can rotate however it wants as long as it remains parallel to the floor.

A robot in arbitrary three space has the traditional angularĀ degrees of freedom of roll, pitch, and yaw.

But what about a robot in arbitrary spatial dimensions? What would a robot's degrees of freedom look like in 4-D space, or n-D space?

As normal, the linear degrees of freedom equal the dimensionsĀ of the space. So in n-D space there are n linear degrees of freedom.

At first, I naively thought that the number of angles the robot could rotate around would be the number of axes also. After all, in three spatial dimensions there's one orthogonal axis for each plane the robot rotates in. But for higher dimensional cases this doesn't quite follow. The plane that's defined by being orthogonal to one axis is actually a hyperplane. It's made up of all (n-1) dimensions at a right angle to the axis of rotation. If our robot sensors are still just 2D or 1D devices, then we probably want to be more precise about what plane they're rotating in.

What we're interested in for robot rotations is (I think) the number of 2D planes that the robot could rotate around. Just by happenstance, the number of 2D planes in 3-space is the same as the number of axes. But for higher dimensional spaces we actually have to define the 2D plane by choosing two orthogonal vectors and finding their span. We can find a sufficient set of planes by choosing orthogonal vectors that are all aligned with an axis of the space.

So the number of 2D planes in an nD space is , or . Here's a list of the number of 2D planes of rotation for a few different numbers of spatial dimensions:

- 2D = 1 plane of rotation
- 3D = 3 planes of rotation
- 4D = 6 planes of rotation
- 5D = 10 planes of rotation
- and so on