Anotate the displacements dx, dy and dz.

Then rotate the line P1P2 around P1, such that P1P2 coincides with the Z axis. P2 will be P2=(0,0,L), being L=lenght of P1P2.

Anotate the angles ax, ay and az and the order of ratation (1st, 2nd, 3rd)

Construct your circle by using the circle equation y² = R² - x² , being R the Radius.

Rotate back the line (and the circle) by using the inverse ordem (3rd, 2nd, 1st)

Move back both, by using -dx, -dy, -dz .

Jose