function advanced_arrowPT(T, idx, varargin)
% this function is supposed to draw a better facet normal than quiver does

[color, linewidth, markersize, ...
 markeredgewidth, arrowlength] = mapoptions(varargin,...
    'color', [0 0 0],...
    'linewidth', 1,...
    'markersize', 1,...
    'markeredgewidth', 1,...
    'arrowlength', 1);

[A h] = double(T);

a = A(idx,:);
a = a/norm(a) * arrowlength;

plot3([0 a(1)], [0 a(2)], [0 a(3)], ...
     'color', color, 'linewidth', linewidth);

marker = objectPT('pyramid', 5); 
marker = stretchPT(marker, [1 1 3]*0.03*markersize);
M = getRotationMatrixFromVector(A(idx,:));
[A h] = double(marker);
A = A*M;
marker = convertHR2PT(A, h);
marker = movePT(marker, a);
%viewPolyTope(marker);
viewPolyTope(marker, 'color', color, 'shade', 1, 'linewidth', markeredgewidth);

