|
|
|
|
|
by ajkjk
3490 days ago
|
|
Well, implementing rotation matrices in code isn't hard, and they should be supported in every mathematical library already. Even more lightweight than matrices is just implementing the transformation on vector objects yourself: a 90-degree rotation left is R(x,y) = (-y, x), and (-R)(x,y) = -(R(x,y)). In higher dimensions this remains true for any 2-dimension subplane, so R_zx(x,y,z) = (z,y,-x). Rotation matrices / other formulations become necessary when you're dealing with being able to rotate through any angle. Though, doing rotations of the matrix 'y = Rx' form suffers mathematical problems like numerical instability and bad behavior. Quaternion rotations or Geometric Algebra's rotors (which are equivalent for N=3, and both take the form y = RxR^-1) work a lot better, and also eliminate a lot of the redundancy in the (skew-symmetric) rotation matrices formulation (4 variables instead of 9, for 3d). |
|