The dimensions of the standard rotation matrices for R3 are 3x3. That is, they have 3 rows and 3 columns. The reason for this is to allow for the multiplication of vectors from R3 with the rotation matrices to obtain their final orientation.
A simple example of this would be
The first matrix is the rotation matrix around the z-axis of q radians (or degrees, but I'll be using radians). The second matrix is the vector consisting of the components (x, y, z). This vector represents the point that we wish to rotate around the z-axis by ? radians. Finally this results in another vector consisting of (x', y', z'), which is the result of the rotation of the old vector around the z-axis. Shown in the following image:
Obviously this will not change the z component at all, thus z = z'. However it does change the x and y coordinates. But how did they come up with this matrix? The answer is quite simple actually. Assuming we have a linear transformation function, T, which takes in a vector, we'll be using v=(x, y, z), and spits out a new vector u=(x', y', z'), what would this function look like?
Applying what we know about radian coordinate systems (or in this case, cylindrical coordinate systems), we quickly remember that: x = rcos?, y = rsin?, and z = z. We can then say that given some vector v we can represent the components of it as: (rcosa, rsina, z). Knowing that we want to rotate that even further, we get that x = rcos(? + ?), y = rsin(? + ?), and z = z. Thus our function T should look something like:
Using our trigonometric angle addition identities, this becomes
Seems pretty simple, at least to me. Now the next step would be to convert this to a matrix equation. We can do this simply by pluging in the standard basis of R3 and using the resulting vectors as the columns of our matrix:
= (cos?, sin?, 0)
T((0, 1, 0)) = (cos(?/2) cos? - sin(?/2) sin?, cos(?/2) sin? + cos? sin(?/2), 0)
= (-sin?, cos?, 0)
T((0, 0, 1)) = (0, 0, 1)
Plugging these vectors into a matrix we get the same matrix as seen in the first equation. The derivation of the rotation matrices around the x-axis and y-axis are equally as simple. Obviously the only real knowledge required to derive these formulas is a basic knowledge of linear algebra (specifically how linear transformations work and how to represent them in a matrix form), and some knowledge of trigonometric identities.
Note that there is a more comprehensive derivation at http://members.gamedev.net/washu/derive.pdf