Step 1: Understanding the Concept:
If a vector of magnitude \(r\) makes angles \(\alpha,\beta,\gamma\) with the axes, its components are \(r\cos\alpha,\ r\cos\beta,\ r\cos\gamma\) and \(\cos^2\alpha+\cos^2\beta+\cos^2\gamma=1\).
Step 2: Use the given angles:
With the \(y\)-axis: \(\beta=\dfrac\pi4\). With the \(z\)-axis: \(\gamma=\dfrac\pi2\). So \(\cos\beta=\dfrac1{\sqrt2}\) and \(\cos\gamma=0\).
Step 3: Find cos alpha:
\(\cos^2\alpha=1-\tfrac12-0=\tfrac12\), so \(\cos\alpha=\pm\dfrac1{\sqrt2}\).
Step 4: Components:
\(x\): \(3\sqrt2\times\left(\pm\frac1{\sqrt2}\right)=\pm3\). \(y\): \(3\sqrt2\times\frac1{\sqrt2}=3\). \(z\): \(0\).
Step 5: Choose:
\(\vec r=\pm3\hat i+3\hat j\), option (D). The magnitude check: \(\sqrt{9+9}=3\sqrt2\). Option (B) has magnitude \(\sqrt2\) and (A) has \(\sqrt{10}\).
Final Answer:
The vector is plus or minus 3i + 3j.
\[ \boxed{\pm3\hat i+3\hat j} \]