The vector dot product is your friend.