Questions tagged [rotation]

The rotation tag is used for challenges related to rotating or shifting elements in an array, matrix, or string in Code Golf Stack Exchange.

Filter by
Sorted by
Tagged with
18 votes
8 answers
2k views

Roll a painted cube

There is a 1x1x1 cube placed on a infinite grid of 1x1 squares. The cube is painted on every side, so it leaves a mark on the grid when it moves. The sides of the cube are colored 6 distinct colors, ...
mousetail's user avatar
  • 12.5k
9 votes
5 answers
465 views

3D rotation matrix to quaternion

There are multiple ways to represent a 3D rotation. The most intuitive way is the rotation matrix – $$A=\begin{bmatrix}A_{11}&A_{12}&A_{13}\\A_{21}&A_{22}&A_{23}\\A_{31}&A_{32}&...
Parcly Taxel's user avatar
  • 3,737
4 votes
1 answer
192 views

4D rotation matrix to quaternions

It is well-known that a 3D rotation can always be represented by a quaternion. It is less well-known that a 4D rotation can always be represented by two quaternions, sending a point \$p=(a,b,c,d)^T\$ ...
Parcly Taxel's user avatar
  • 3,737