
Given:
A = 8,4
B = 4,8
C = 4,4
D = ?,?
From point C (4,4) (red dot) how would I find the coordinate that would be perpendicular to AB and CD being parallel to AB? (green dot)
In the end I just need to find the coordinates of point D.

Given:
A = 8,4
B = 4,8
C = 4,4
D = ?,?
From point C (4,4) (red dot) how would I find the coordinate that would be perpendicular to AB and CD being parallel to AB? (green dot)
In the end I just need to find the coordinates of point D.
On
Let $A=(ax,ay), B=(bx,by), C=(cx,cy), D=(dx,dy)$. Then vectors are $BD=(dx-bx,dy-by), CD=(dx-cx,dy-cy), AB=(bx-ax, by-ay)$.
Let $|BD|, |CD|, |AB|$ be lengths of corresponding vectors.
Point D satisfies two conditions: (1) $CD$ is parallel to $AB$; (2) $CD$ is perpendicular to $BD$.
Rewriting those using dot products gives:
(1) $(dx-cx)(bx-ax)+(dy-cy)(by-ay)= \\ \sqrt{(dx-cx)^2+(dy-cy)^2} \cdot \sqrt{(bx-ax)^2+(by-ay)^2} $
and
(2) $(dx-cx)(dx-bx)+(dy-cy)(dy-by)=0$.
Solve the system of (1) and (2) for $dx$ and $dy$ for given $ax,ay,bx,by,cx,cy$.
Shortest distance would be zero . Since the point C does not lie on AB, there definitely exists a line CD perpendicular to AB.