What is the n-dimensional rotation matrix formula?
- User
What is the n-dimensional rotation matrix formula?
- Assistant
The n-dimensional rotation matrix formula is a generalization of the rotation matrices used in 2D and 3D spaces. In n-dimensional space, the rotation matrix is defined for a rotation in a plane spanned by two coordinate axes. The general formula for a rotation by an angle θ in the plane spanned by the i-th and j-th axes (i < j) is given by an n × n matrix R(i,j,θ):
R(i,j,θ) = I + (cos θ - 1)(e_i e_i^T + e_j e_j^T) + sin θ(e_j e_i^T - e_i e_j^T)
where:
- I is the n × n identity matrix
- e_i and e_j are the i-th and j-th standard basis vectors (i.e., vectors with a 1 in the i-th or j-th position and 0s elsewhere)
- e_i^T and e_j^T are the transposes of e_i and e_j
- cos θ and sin θ are the cosine and sine of the rotation angle θ
The resulting matrix R(i,j,θ) has the following properties:
- The i-th and j-th columns and rows contain the rotation terms
- The diagonal elements (k,k) with k ≠ i and k ≠ j are equal to 1
- All other elements are 0
To apply the rotation to a vector x in n-dimensional space, simply multiply the vector by the rotation matrix:
x_rotated = R(i,j,θ) · x
Note that multiple rotations can be combined by multiplying the corresponding rotation matrices in the appropriate order.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.