Using cross product find direction vector of line joining point of intersection of line and plane and foot of perpendicular from line to plane. 
A line with equation $r=a+\lambda\vec{d}$ meets plane $\pi$ with equation $r.\hat{n}=k$ at point P.
Point Q lies in $\pi$ and is the foot of the perpendicular from A to $\pi$.
Find the direction vector of line PQ.

By solving $(a+\lambda\vec{d}).\hat{n}=k$, I was able to find the position vector of P. Then by finding the intersection of line AQ and plane I was able to find the position vector of Q and hence the direction vector PQ. 
However, the answer can be found simply by finding $(\hat{n}\times \vec{d})\times \hat{n}$ where $\times$ is cross-product. I don't understand why.

Here's what I know :
The cross-product of 2 vectors gives a 3rd vector perpendicular to the 2 vectors.
Line PQ lies on plane so direction vector PQ $\perp \hat{n}$. Also,
AQ is parallel to $\hat{n}$.
The first part $w=(\hat{n}\times \vec{d})$ gives a vector perpendicular to line and parallel to plane. Won't $w\times n$ give a vector perpendicular to the plane again?
I can't understand the geometric interpretation of $(\hat{n}\times \vec{d})\times \hat{n}$.
 A: Imagine this line $r=a+\lambda\vec{d}$  is intersecting plane $\pi: \vec{r}.\hat n = k$

*

*The cross product of $\hat n \times \hat{d} = \hat{u_1}$ this $\hat{u_1}$ will be the unit vector normal to the plane of line containing line $r=a+\lambda\vec{d}$ and plane $\pi: \vec{r}.\hat n = k$


*Now, we take the cross product of $\hat{u_1}$ and $\hat n$: $\hat {u_2} = \hat {u_1} \times \hat n$ will be the required unit vector.


*Note: Here the $\hat {u_2}$ depends on the unit vector $\hat d$ I mean
$\hat u_2  = \hat {u_1} \times \hat n $ or $\hat {u_2} =  \hat n \times \hat {u_1}$
Find the direction vector of line PQ.
Here, I used unit vectors only as you were interested in the direction of $\vec{PQ}$;
A: The segment $PQ$ lies in a plane that is spanned by the perpendicular to the plane  $n$  and the direction vector $d$, so the normal to this plane is $n \times d$.  But $PQ$ also lies in the plane whose normal is $n$, hence the direction vector of $PQ$ must be along the vector $(n \times d) \times n $
A: Let $\alpha$ be the angle between ${\bf n}$ and ${\bf d},$ and $\beta$ be the angle between ${\bf n}$ and the perpendicular to both ${\bf n}$ and ${\bf d}.$
$$( \hat{\bf n} \times {\bf d} ) \times \hat{\bf n}$$

*

*has magnitude $$\Big(\Vert\hat{\bf n}\Vert \,\Vert{\bf
    d}\Vert|\,\sin\alpha|\Big)\,\Vert\hat{\bf
    n}\Vert\,|\sin\beta|\\
    =\Vert\hat{\bf n}\Vert \,\Big(\Vert{\bf
    d}\Vert|\,\sin\alpha|\Big)\,\Vert\hat{\bf
    n}\Vert\,|\sin\beta|
    \\=(1)\,PQ\,(1)\,|\sin90^\circ |\\=PQ;$$


*

*

*is perpendicular to $\hat{\bf n},$

*and to the normal of the plane spanned by $\hat{\bf n}$ and ${\bf d},$ i.e., lies in the plane spanned by $\hat{\bf n}$ and ${\bf d};$
thus is collinear to $\vec{PQ}$ (which is also perpendicular to $\hat{\bf n}$).
