REF.Image
Let OABCDEFG be a cube
with vertices O(0,0,0)A(a,0,0)B(a,a,0)
C(0,a,0)D(0,a,a)E(0,0,a)F(a,0,a)
G(a,a,a)
There are 4 diagonals OG,CF,AD & BE
It A(x1,y1,z1) & B(x2,y2,z2) then
¯AB=(x2−x1)^i+(y2−y1)^j+(z2−z1)^k
¯OG=(a−0)^i+(a−0)^j+(a−0)^k=a^i+a^j+a^k
¯AD=(0−a)^i+(a−0)^j+(a−0)^k=−a^i+a^j+a^k
∣∣¯OG∣∣=√a2+a2+a2
=√3a
∣∣¯AD∣∣=√−a2+a2+a2
=√3a
¯OG.¯AD=−a2+a2+a2=a2
Angle between them cos−1(¯a.¯b|¯a|.∣∣¯b∣∣)
Angle between 2 diagonals ¯OG and ¯AD=cos−1(a2√3a.√3a)
=cos−1a23a2=cos−113