I have 2 vectors and their start points. i.e.
$\vec p_1, \vec v_1$ and $\vec p_2, \vec v_2$
Now I want check if vectors intersect. I found this alghoritm.
$\vec c = \vec p_2 - \vec p_1$
$\vec n_1 = $ perpendicular of $\vec v_1$
$\vec n_2 = $ perpendicular of $\vec p$
$d = (\vec n_2 \cdot v_2) / (\vec n_1 \cdot \vec v_2)$
If d is between 0 and 1 then there is intersection on point
$\vec p = \vec p1 + (\vec v_1 \cdot d)$
But this seems to not work. Is there any other method?
First of all I need to know if 2 vectors intersect, and then get point of intersection.