You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: POE2DH_Joint.m
    path of file: ./repos/Robotics-Toolbox/rvcdlcs/src/thirdparty/dh2poe/lib
    
    the code of the file until where you have to start completion: function [theta, d, alpha, a]=POE2DH_Joint (xi)
%POE2DH_Joint Conversion from a joint twist to DH parameters
%   
%   [theta, d, alpha, a]=POE2DH_Joint (xi)
%   xi:                     Joint twist, 6 x 1
%   theta, d, alpha, a:     DH parameters


    
function [theta, d, alpha, a]=POE2DH_Joint (xi)
%POE2DH_Joint Conversion from a joint twist to DH parameters
%   
%   [theta, d, alpha, a]=POE2DH_Joint (xi)
%   xi:                     Joint twist, 6 x 1
%   theta, d, alpha, a:     DH parameters

DELTA=10^(-12);

w=xi(1:3);
v=xi(4:6);    
if norm(w)~=0&&abs(norm(w)-1)>DELTA
    error('w should be normalized to a unit vector.')
elseif abs(w'*v)>DELTA
    error('v should be perpend