Perpendicular line that crosses specific point? I know the coordinates of line AB, I also have the coordinates of a point called C. 
I need to find the coordinates of the start of a line that is perpendicular to AB and that would cross point C. (Point D)
Also the coordinates of point A are always (0, 0)



Given $A(0,0)$ and $B(x_B, y_B)$, we have $$\nabla \vec {AB} = \frac{y_B-y_A}{x_B-x_A} = \frac{y_B-0}{x_B-0} = \frac{y_B}{x_B} $$ and since  $\nabla \vec {CD} \times \nabla \vec {AB} = -1$, given $CD\ \bot  \ AB $: $$ \nabla\vec {CD} = -\frac{x_B}{y_B}$$ Hence the equation of $\vec {CD}$ would be $y-y_C = -\frac{x_B}{y_B} (x-x_C)$ for some known $C(x_C,y_C)$.
Solving simultaneously, we substitute the equation for $\vec {AB}$, $\; y = \frac{y_B}{x_B}x$, and we obtain the intersection of $\vec{AB}$ and $\vec{CD}$, $D(x_D,y_D)$.
