A rotation matrix is able to transform a point or a vector in space in proportion to the rotations values expressed in radian. Every single position of a static object in space can be explained by a position vector and a rotation matrix. To understand a rotation matrix, we can first consider simple rotations around the coordinate axes.
In the simplest case, if we consider a two-dimensional Cartesian coordinate system, we can assume a rotation around the axis perpendicular to the plane.

In the simple case above, the coordinates of the final point can be calculated using the following equation

This equation is a simple rotation in two-dimensional space. More complex formulas are obtained by generalizing this simple form to higher dimensions, in such a way that, for example, in a three-dimensional Cartesian coordinate system, we obtain the rotation around the first axis with the following relationship

Rotation around the second axis is obtained by

and the third axis

In above formula, we should be careful that the order of applying rotations in the final matrix will be effective, in the sense that different orders of applying rotations around the coordinate axes will lead to different rotation matrices (R_OPK and R_KPO are different). The simple rotation angles mentioned in the above relationships are called Euler angles and form the simplest rotation system in photogrammetry and computer vision. The second point about the above system(Euler) is that sometimes different orders in some cases lead to the same rotation matrices. Therefore, in some cases, it is not possible to directly compare two groups of Euler angles. The best way to compare Euler rotations is to form a rotation matrix and then compare the elements of the resulting rotation matrices. The last important point about Euler’s rotating system is the problem of gimbal lock, which is related to the situation where two rotating plates become the planar. In this case, a degree of singularity is created and practically one degree of freedom is reduced from the rotation matrix. (We will see the definition of singularity in the next chapters) For this reason, Euler’s rotation system is not a ideal rotation system for many robotic, photogrammetry, or computer vision applications.
A rotation system based on a vector and rotation value
A rotation matrix in the 3D Cartesian coordinate system can be expressed in other ways. Perhaps one of the most useful rotation systems is the angle vector system, in which a three-dimensional rotation is expressed as a “rotation vector” and “rotation around this vector”. This rotational system is called “vector, angle” system. Although initially four degrees of freedom can be imagined here (three parameters of the position vector and one period around this vector), but in reality there are still no more three degrees of freedom, because the length of the period vector is not important.
Extracting vector and rotation value vector from a three-dimensional rotation matrix
Here, we first examine the method of extracting the rotational vector from the three-dimensional rotational matrix. To begin with, we express the form of the external multiplication matrix that is used in this calculation. As we know, the external product of two three-dimensional vectors is perpendicular to both primary vectors and follows the following relationship in terms of length.


The outer product of two vectors can be written in matrix form as follows.

We can use the following symbol for the modified form of the first matrix.

By using this symbology we have

If we consider a rotation matrix R_3x3 that has an underlying rotation vector of u then we have

Because all rotations are around this vector u, then applying the rotation matrix R shouldn’t have any effect on u, in this case, u is an eigen vector for the matrix R. We use this relationship to extract a useful formula to find u

Since (R_Transpose(R)) is a asymmetric matrix, we can choose u such that

Therefore, if elements of R are like the following

Therefore, the elements of (R-Rt) will be

In definition of [u]_x we had

Therefore, the elements of u will be

After extracting the value of u vector, now we can get the value of rotation around this vector. For this purpose, we first consider a hypothetical plane perpendicular to the u vector. In this page, we consider a vector as unit v_1 and apply R to it. The vector will be the result we were interested in.

The angle between these two vectors is our desired value. We can use dot vector multiplication to get this angle.