The dihedral angle is equal to the angle between the normal vectors of the two corresponding planes, so the cosine of the dihedral angle is equal to the cosine of the corresponding normal vectors of the two planes.
(One in, one out, note whether the angle is acute or obtuse.)