# The angle between two 3D lines

Can anyone tell me how can I calculate the angle between two lines in 3D. I need in my codings.
I know it has a simple solution. but I really have mixed up!!!
Thanks.

HallsofIvy
$$cos(\theta)= \frac{u\cdot v}{|u||v|}$$ where u and v are any vectors pointing in the direction of each line. You can use the point of intersection and one point on each line to define those vectors.