The Rotationmatrix is a matrix that has the effect of changing the vector direction but not the size when multiplied by a vector. The rotation matrix does not include Inversion. it can change the right coordinate system to the left coordinate system or vice versa. All rotation plus inversion form a set of orthogonal matrices. Rotation can be divided into active rotation and passive rotation. Active rotation refers to the rotation of the vector around the rotating axis counterclockwise. Passive rotation is a counter-clockwise rotation of the coordinate axis itself.
The Rotation matrix is a matrix that has the effect of changing the vector direction but not the size when multiplied by a vector. The rotation matrix does not include Inversion. it can change the right coordinate system to the left coordinate system or vice versa. All rotation plus inversion form a set of orthogonal matrices. Rotation can be divided into active rotation and passive rotation. Active rotation refers to the rotation of the vector around the rotating axis counterclockwise. Passive rotation is a counter-clockwise rotation of the axis itself, which is equivalent to the inverse operation of active rotation.
The following uses homogeneous coordinates to transform the matrix:
/* Enter a character matrix of n * n and rotate it counter-clockwise for 90 degrees. output: After calculation, the transformation matrix of n * n square matrix rotation of 90 degrees is: 0, 1, 0, 0,-1, 0-1, 0, 0, 0, the inverse matrix is, 1, 0, 0 n-1, 0, 1 0, n-1, 1 */# include
# Define N 4 char m [N] [N] = {'a', 'B', 'c', 'D'}, {'e ', 'F', 'G', 'H'}, {'I', 'J', 'K', 'l'}, {'M', 'n ', 'o', 'P' }}; int main () {int I, j; for (I = 0; I
A detailed program:
/* Enter the N-level matrix and rotate 90 ° counter-clockwise */# include
# Include
# Define N 20int a [N] [N]; main () {int I, k, n, j; printf ("Enter n <= % d \ n ", n); scanf ("% d", & n); // input order if (n> N) {printf ("input error \ n "); exit (0) ;}for (I = 0; I
This article is available at http://www.nowamagic.net/librarys/veda/detail/4254.