The situation is as follows: I am creating a game in this game I have a line($A$ to $B$) and a mouse position $C$. Now I want to calculate point $D$ on line $A$$B$.
I know the coordinates of: $A$, $B$ and $C$ and the angle of point $B$. It should be possible to calculate point $D$ but I have no clue where to start. Can any one point me in a direction?
Note: it is possible that point $A$ and $B$ are on the same axis. For example: $A(1,1)$ and $B(1,3)$.

I think you should drop the a line starting from $C$ over line $AB$ and calculate the angle between those two lines. You stop at the point where you get a $90 ^\circ$ angle. Now, there are various coding approximations and best fit algorithms you need to make i.e. how many iterations the loop should have and from where should you be starting. I think you should divide the line $AB$ in two and keep on dividing until you get the required point. That's the best solution I feel. I had to implement same condition as yours but I was using some API's. I hope this solution helps you out. Let me know if you find some other solution to this.
Thanks