def from_transform(cls, matrix):
        r"""
        :param matrix: 4x4 3d affine transform matrix
        :type matrix: :class:`FreeCAD.Matrix`
        :return: a unit, zero offset coordinate system transformed by the given matrix
        :rtype: :class:`CoordSystem`

        Individual rotation & translation matricies are:

        .. math::

            R_z & = \begin{bmatrix}
                cos(\alpha) & -sin(\alpha) & 0 & 0 \\
                sin(\alpha) & cos(\alpha) & 0 & 0 \\
                0 & 0 & 1 & 0 \\
                0 & 0 & 0 & 1
            \end{bmatrix} \qquad & R_y & = \begin{bmatrix}
                cos(\beta) & 0 & sin(\beta) & 0 \\
                0 & 1 & 0 & 0 \\
                -sin(\beta) & 0 & cos(\beta) & 0 \\
                0 & 0 & 0 & 1
            \end{bmatrix} \\
            \\
            R_x & = \begin{bmatrix}
                1 & 0 & 0 & 0 \\
                0 & cos(\gamma) & -sin(\gamma) & 0 \\
                0 & sin(\gamma) & cos(\gamma) & 0 \\
                0 & 0 & 0 & 1
            \end{bmatrix} \qquad & T_{\text{xyz}} & = \begin{bmatrix}
                1 & 0 & 0 & \delta x \\
                0 & 1 & 0 & \delta y \\
                0 & 0 & 1 & \delta z \\
                0 & 0 & 0 & 1
            \end{bmatrix}

        The ``transform`` is the combination of these:

        .. math::

            transform = T_{\text{xyz}} \cdot R_z \cdot R_y \cdot R_x = \begin{bmatrix}
                a & b & c & \delta x \\
                d & e & f & \delta y \\
                g & h & i & \delta z \\
                0 & 0 & 0 & 1
            \end{bmatrix}

        Where:

        .. math::

            a & = cos(\alpha) cos(\beta) \\
            b & = cos(\alpha) sin(\beta) sin(\gamma) - sin(\alpha) cos(\gamma) \\
            c & = cos(\alpha) sin(\beta) cos(\gamma) + sin(\alpha) sin(\gamma) \\
            d & = sin(\alpha) cos(\beta) \\
            e & = sin(\alpha) sin(\beta) sin(\gamma) + cos(\alpha) cos(\gamma) \\
            f & = sin(\alpha) sin(\beta) cos(\gamma) - cos(\alpha) sin(\gamma) \\
            g & = -sin(\beta) \\
            h & = cos(\beta) sin(\gamma) \\
            i & = cos(\beta) cos(\gamma)
        """
        # Create reference points at origin
        offset = FreeCAD.Vector(0, 0, 0)
        x_vertex = FreeCAD.Vector(1, 0, 0)  # vertex along +X-axis
        z_vertex = FreeCAD.Vector(0, 0, 1)  # vertex along +Z-axis

        # Transform reference points
        offset = matrix.multiply(offset)
        x_vertex = matrix.multiply(x_vertex)
        z_vertex = matrix.multiply(z_vertex)

        # Get axis vectors (relative to offset vertex)
        x_axis = x_vertex - offset
        z_axis = z_vertex - offset

        # Return new instance
        vect_tuple = lambda v: (v.x, v.y, v.z)
        return cls(
            origin=vect_tuple(offset),
            xDir=vect_tuple(x_axis),
            normal=vect_tuple(z_axis),
        )