The simple analysis of combined angle (or compound angle) was described in this article.There the derivation was based on two deflection angles only. And hence the solution was approximate. For more accurate analysis, same approach can be used. The additional parameter included is the slope of incoming line.

However, a different approach which uses only coordinates can be used to calculate the actual deflection angle of two lines in 3D space. This approach will not only give the deflection angle but also provide accurate length of those lines.

Let us suppose three coordinates in space and let X be the angle between these two lines

A(x1,y1,z1)

B(x2,y2,z2)

C(x3,y3,z3)

The vector **AB** is given by

**AB**=(x2-x1)**i**+(y2-y1)**j**+(z2-z1)**k**

=(a1)**i**+(a2)**j**+(a3)**k**

Similarly BC is given by

**BC**=(x3-x2)**i**+(y3-y2)**j**+(z3-z2)**k**

=(b1)**i**+(b2)**j**+(b3)**k**

The dot product of vector is given by **AB.BC** =AB*BC*CosX

Here AB and BC=length of segment AB and BC respectively and is given by

L1=AB=sqrt(a1^2+a2^2+a3^2)

L2=BC=sqrt(b1^2+b2^2+b3^2)

Thus CosX=**AB.BC**/(L1*L2)

Total Lent of segment L=L1+L2

A worksheet using this approach can be **downloaded here. (combinedAngle_vectorMethod)** . The sheet also contains VBA codes to visualize the alignment.