function D = expdist(S, M, angle, t1, t2)

    % rotation matrix
    R = [cos(angle) -sin(angle); sin(angle) cos(angle)];
    % translation vector
    t = [t1 t2];
    % transform the model
    Mt.points = M.points * R' + repmat(t, size(M.points,1), 1);
    Mt.sigma = M.sigma;
    
    % compute the Bhatacharya cost function
    D = mex_expdist(Mt.points, S.points, Mt.sigma, S.sigma);
    
end