This function generates a rotation matrix.
Examples
set.seed(20240412)
rotations_4d <- list(
list(plane = c(1, 2), angle = 60), # Rotation in the (1, 2) plane
list(plane = c(3, 4), angle = 90) # Rotation in the (3, 4) plane
)
gen_rotation(planes_angles = rotations_4d)
#> [,1] [,2] [,3] [,4]
#> [1,] 0.5000000 -0.8660254 0.000000e+00 0.000000e+00
#> [2,] 0.8660254 0.5000000 0.000000e+00 0.000000e+00
#> [3,] 0.0000000 0.0000000 6.123234e-17 -1.000000e+00
#> [4,] 0.0000000 0.0000000 1.000000e+00 6.123234e-17