First, we need to represent the equations of the planes; ax+by+cz=d, and ex+fy+gz=h, where a, b, c, d, e, f, g, h are coefficients (constants).
Now we need the normal vectors n1 and n2 for these planes: n1=(a,b,c) and n2=(e,f,g).
The vector product n1 X n2=(bg-cf,ce-ag,af-be).
This is the vector of the line of intersection.
We can find a point in common on both planes, which means that point will be on the line of intersection. All we need to do is put x, y or z to zero and solve for the remaining two variables. Let's put x=0, leaving by+cz=d and fy+gz=h.
fby+fcz=fd
bfy+bgz=bh
Subtract: and solve for z=(fd-bh)/(fc-bg).
Now we can find y: y=(d-cz)/b=(d-c(fd-bh)/(fc-bg))/b=(dfc-dbg-cfd+cbh)/(b(fc-bg))=(ch-dg)/(fc-bg).
The point on the line is therefore (x,y,z)=(0,(ch-dg)/(fc-bg),(fd-bh)/(fc-bg)). Call this point A.
We can now use this point and n1 X n2 with parameter t to write the parametrised equations:
W(t)=A+(n1 X n2)t=(0,(ch-dg)/(fc-bg),(fd-bh)/(fc-bg))+(bg-cf,ce-ag,af-be)t, from which:
x=(bg-cf)t, y=(ch-dg)/(fc-bg)+(ce-ag)t, z=(fd-bh)/(fc-bg)+(af-be)t.