sub Axis { #2 sets of cartesian XYZ co-ordinates on the axis (\$Xl1, \$Yl1, \$Zl1, \$Xl2, \$Yl2, \$Zl2) = @_; \$Axx = \$Xl1 - \$Xl2; \$Axy = \$Yl1 - \$Yl2; \$Axz = \$Zl1 - \$Zl2; \$Vform = V(\$Axx,\$Axy,\$Axz); \$eq = sqrt(\$Axx**2 + \$Axy**2 + \$Axz**2); \$Unitvector = 1/\$eq * \$Vform; return(\$Vform, \$Unitvector); } ##```## sub rotator { (*xcord, *ycord, *zcord, *TotalnumberofCoords, \$lineUnitvector, \$Xlinecoord, \$Ylinecoord, \$Zlinecoord) = @_; \$angle = 9.4; \$translation = 0.4; \$coefl1 = 1-cos(\$angle); \$coefl2 = sin(\$angle); (\$LUVx, \$LUVy, \$LUVz) = &VectorBreakdown(\$lineUnitvector); for (my \$i = 0; \$i < @TotalnumberofCoords; \$i++) { \$Xco[\$i] = \$xcord[\$i] - \$Xlinecoord; \$Yco[\$i] = \$ycord[\$i] - \$Ylinecoord; \$Zco[\$i] = \$zcord[\$i] - \$Zlinecoord; \$Vector[\$i] = V(\$Xco[\$i], \$Yco[\$i], \$Zco[\$i]); \$scal[\$i] = \$lineUnitvector * \$Vector[\$i]; \$f[\$i] = \$scal[\$i] * (\$lineUnitvector - \$Vector[\$i]); \$f[\$i] = \$coefl1 * \$f[\$i]; \$s[\$i] = \$lineUnitvector x \$Vector[\$i]; \$s[\$i] = \$coefl2 * \$s[\$i]; (\$fx[\$i], \$fy[\$i], \$fz[\$i]) = &VectorBreakdown(\$f[\$i]); (\$sx[\$i], \$sy[\$i], \$sz[\$i]) = &VectorBreakdown(\$s[\$i]); \$xo[\$i] = \$xcord[\$i] + \$fx[\$i] + \$sx[\$i] + (\$transl * \$LUVx); \$yo[\$i] = \$ycord[\$i] + \$fy[\$i] + \$sy[\$i] + (\$transl * \$LUVy); \$zo[\$i] = \$zcord[\$i] + \$fz[\$i] + \$sz[\$i] + (\$transl * \$LUVz); \$xo[\$i] = sprintf("%.3f", \$xo[\$i]); \$yo[\$i] = sprintf("%.3f", \$yo[\$i]); \$zo[\$i] = sprintf("%.3f", \$zo[\$i]); } return(\@xo, \@yo, \@zo); } ```