Solution (source code)

= Solution

After subtracting the same training <sample mean>, E has vector $e=(1,-1,0)^{\mathsf T}$ and <principal component scores> $(0,\sqrt2)$. The difference from D lies entirely along the first <principal component>. Its <Euclidean distance> in the retained plane is
$$
\boxed{\sqrt{(2+\sqrt2)^2+(\sqrt2-\sqrt2)^2}=2+\sqrt2\simeq3.4142}.
$$
The new point must use the original centring and loadings; recomputing them with E included would change the question.