A dihedral angle is the angle between two intersecting planes.
In Foldit, the most important dihedral angles are phi and psi, the angles of the protein backbone with respect to the the alpha carbon. These angles are seen in the Rama Map, and are most important in determining the shape of the backbone.
Phi and psi are also referred to as torsion angles because they represent torsion, meaning rotation or twisting, of the backbone around the alpha carbon.
A line is defined by two points. A plane is defined by three points. A dihedral angle between two planes is defined by only four points: two points defining the line of intersection between the planes, and one point in each of the planes.
For phi and psi, the points used are the 3D positions of atoms, their X-Y-Z coordinates. (Foldit never reveals the numeric values of atom coordinates to players.)
The atoms that go into determining phi for a segment are the carboxyl carbon of the previous segment (seg - 1), the amino nitrogen of the segment (seg), the alpha carbon of the segment, and the carbonyl carbon of the segment.
The atoms that go into determining psi for a segment are the amino nitrogen of the segment, the alpha carbon of the segment, and carboxyl carbon of the segment, and the amino nitrogen of the next segment (seg + 1).