Tricky maths

OK, just for the moment, consider that the tube never points straight up and down, then you can use (0,1,0) as an up-vector. You need an up-vector so that all your angles start from the same place, ie. there's a common zero point. Then you can make the direction of the tube,
that's
dx = x2-x1
dy = y2-y1
dz = z2-z1
Take the unit vector of that:
U = unit(dx,dy,dz)
and take take the cross product with the up-vector, that gives
T = U x (0,1,0) = (-U.z, 0, U.x)
take the unit vector of that
T = unit(T)
Then the point (x,y,z) in your diagram is,
x = x2 + T.x * radius
y = y2 + T.y * radius
z = z2 + T.z * radius
Do you understand any of that, or do I need to go into more detail? Once you've got that single point, then you need to rotate it round the U vector by 'angle' to get more points.
The maths is very similar to the maths in these threads used for making a look-at matrix or aligning an object to an axis.
http://dbfinteractive.com/index.php?topic=2050.0http://dbfinteractive.com/index.php?topic=1874.0Jim
...
<edit>Straight from Q5.01 in the comp.graphics.algorithms faq.
How to create a rotation matrix which rotates around a vector.
Our vector U above is our axis, so we can then make
x = sin(angle/2) * U.x
y = sin(angle/2) * U.y
z = sin(angle/2) * U.z
w = cos(angle/2)
Then the matrix M which rotates 'angle' degrees around U is
M = {{1-2(yy+zz), 2(xy-wz), 2(xz+wy)},
{ 2(xy+wz),1-2(xx+zz), 2(yz-wx)},
{ 2(xz-wy), 2(yz+wx),1-2(xx+yy)}}.
If you want 10 segments, then angle is 36degrees (/180*pi for radians). Rotate T 10 times by this matrix to generate 10 points on the circle, add on x2,y2,z2 to make each point.
</edit>