You have to use the determinant, not at my computer though so i cannot pull up a resource. Its really just about using either a matrix multiplier, to obtain the determinant or use the general formula to calculate the line intersection, this will sometimes be available on wikipedia, and is the formula specifically for calculating, that type of line intersection. If you want to get a feel for this type of program, you could check out, Dan Shiffmans recent coding challenge, where he made a ray caster, same sort of problem but with one dimension less (he would cast lines from a point and check if they had intersected another line), maybe an alternative would be one function to check the x component and another to check the y component, in 3d space.