All of these projections fall under the generic group of projections called "Axonometric" projections. The general goal of an axonometric projection is to manipulate the object using rotations and translations such that at least three adjacent faces of the projected object are shown. The result is projected from the center at infinity onto one of the coordinate planes usually the Z=0 plane. There are three common types of axonometric projections, trimetric, dimetric and isometric. With trimetric being the most general, dimetric is a specialization of trimetric with two of the three foreshortening factors being equal to each other, and isometric is a specialization of dimetric with the third foreshortening factor set equal to the other two (so all three are equal). Also note that the projection plane in this case is the Z plane. The matrix show below can be modified to use any of the X, Y or Z planes as the projection plane.
The general matrix form of all three (since dimetric and isometric are specializations of trimetric) is:
\begin{bmatrix}
&cos\phi &sin\phi sin\theta &0 &0 \\
&0 &cos\theta &0 &0 \\
&sin\phi &-cos\phi sin\theta &0 &0 \\
&0 &0 &0 &1
\end{bmatrix}
Where phi is the rotation around the y axis and theta is the rotation around the x axis. The foreshortening length of each axis can be computed just by taking the sum of the squares of each row. Then take the square root to get the length. For the X axis this would be:
\begin{equation}
f_{x}^{2} = cos^{2}\phi + sin^{2}\phi sin^{2}\theta
\end{equation}
A little bit of algebra will yield the values needed to compute the lengths of the other 2.
To determine a trimetric projection all we need are the two viewing angles. For a diametric or isometric view we need to set the foreshortening factors equal to either two or three of the axis. By using the lengths of the rows and setting them equal to one another then solving we can compute any of the values needed for either projection.