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); }