- 347

- 32

- Summary
- Rotate a shape back to it's original position with the least amount of rotations.

**Summary:**Rotate a shape back to it's original position with the least amount of rotations.

Lets say you have a cube. It's starting rotation is (0,0,0).

It can be rotated on each axis ( x,y,z ) no more than once each by 90 or -90 degrees

(rotation can also be skipped for any axis).

The shape has been rotated and the movements are unknown (its new rotation is known).

What method/algorithm could be used to determine the least amount of movements required to put it back to it's original rotation (0,0,0)?

(multiple solutions are allowed)

Rotations must happen sequentially.

My best guess is iterating through each possibility, but there has to be a better solution. This is related to animation.

Thanks in advance