Be two vectors vec(AB) and vec(AC):
vec(AB) * vec(AC) = (AB)(AC)cos(hat(BAC))
=(x_(AB)x_(AC))+(y_(AB)y_(AC))+(z_(AB)z_(AC))
We have:
P=(1;1;1)
Q=(-2;2;4)
R=(3;-4;2)
therefore
vec(QP)=(x_P-x_Q;y_P-y_Q;z_P-z_Q)=(3;-1;-3)
vec(QR)=(x_R-x_Q;y_R-y_Q;z_R-z_Q)=(5;-6;-2)
and
(QP)=sqrt((x_(QP))^2+(y_(QP))^2+(z_(QP))^2)=sqrt(9+1+9)=sqrt(19)
(QR)=sqrt((x_(QR))^2+(y_(QR))^2+(z_(QR))^2)=sqrt(25+36+4)=sqrt(65)
Therefore:
vec(QP)*vec(QR)=sqrt19sqrt65cos(hat(PQR))
=(3*5+(-1)(-6)+(-3)(-2))
rarr cos(hat(PQR))=(15+6+6)/(sqrt19sqrt65)=27/sqrt1235
rarr hat(PQR)=cos^(-1)(27/sqrt1235)