The distance r i = C 1,i is the distance between atom i and b(i), the angle α i = C 2,i is the angle between atom i, b(i), and a(i) and the dihedral δ i = C 3,i is the dihedral between atom i, b(i), a(i), and d(i). Let X ∈ R 3,n be the matrix of all atom positions. Let X R ∈ R n+3,3 be the matrix of all atom positions plus the three absolute references. (This means that the row index of X R starts at -2.) So X :,i and X R :,i are the position of the i-th atom. The position of the i-th atom is given by: