Given points A and B, and a line p with its equation $p:\vec{r}=\vec{r_{p}}+t\vec{p}, t\in R$ such that $\vec{p}$ is not parallel to $\vec{AB}$. Find points C and D, as a function of $\vec{r_{a}}, \vec{r_{b}}, \vec{r_{p}}$ and $\vec{p}$ such that ABCD form a rectangle, whose intersection of diagonals lies on line p.
I'm kinda stuck at the beginning. It would be ideal if someone can give me the general way of thinking about this kinds of problems.
All you need to do is to find a line that is perpendicular to $AB$ and passes the midpoint of $AB$. By finding the intersection of the new line and the first line, you have the point in which the two diagonals of the rectangle meet (call it $M$).
The rest is pretty easy. one way is to find $AM$ first and then double it to find a vertex of the rectangle (for example $C$). Same can be done to $BM$ to find the other vertex.