Can someone tell me how to calculate the length 'd' from the below figure?

It is from Lecture 06 - Optical flow : https://www.youtube.com/watch?v=5VyLAH8BhF8&index=8&list=PLd3hlSJsX_Imk_BPmB_H3AQjFKZS9XgZm (At around 16:20 mins.)
Here vector p (to point (u,v)) is resolved into parallel and normal components. So I suppose d is supposed to be perpendicular to the line joining -ft/fy and -ft/fx.
The result for d is also shown in figure. I want to know how to arrive at that.
Hint: If $w$ is the angle at the lower right, then $\tan w=f_x/f_y$, so you can determine $w$. But then also $\sin w =-df_x/f_t$, so now you can determine $d$.