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: tr2delta.m
    path of file: ./repos/Robotics-Toolbox/rvctools/release10.3.1/robot
    
    the code of the file until where you have to start completion: %TR2DELTA Convert homogeneous transform to differential motion
%
% D = TR2DELTA(T0, T
    
function delta = tr2delta(A, B)

    % handle arguments, convert all to 4x4 matrices
    if nargin > 0
        if isa(A, 'SE3')
            T1 = A.double;
        elseif ishomog(A)
            T1 = A;
        else
            error('RTB:tr2delta:badarg', 'T1 should be a homogeneous transformation');
        end