function ballvsAball(A,p)
  
  figure

  nA=max([norm(A,1),norm(A,2),norm(A,inf)]);
  ax=[-nA,nA,-nA,nA];
  
  for k=1:30,
    subplot(1,2,1)
    loc_ball(p,k)
    axis(ax)
    
    subplot(1,2,2)
    loc_Aball(A,p,k)
    axis(ax)

    pause(max(1,6-k/2))
  end
  
  
  
  
  
  
  
  
function loc_ball(p,k)
  x1=cos(0:k-1);
  x2=sin(0:k-1);

  x=zeros(2,k);
  for i=1:k,
    x(:,i)=[x1(i);x2(i)]/norm([x1(i);x2(i)],p);
  end
  
  plot(x(1,end),x(2,end),'o','MarkerSize',14)  
  hold on
  plot([0,x(1,end)],[0,x(2,end)],'LineWidth',2)  
  if k>1
    plot(x(1,1:end-1),x(2,1:end-1),'*','MarkerSize',12)
  end
  grid on
  axis square
  title(['x \in \{x: || x ',sprintf('||_{%d}',p),' = 1\}'],'FontSize',14)
  hold off

function loc_Aball(A,p,k)
  x1=cos(0:k-1);
  x2=sin(0:k-1);

  x=zeros(2,k);
  for i=1:k,
    x(:,i)=[x1(i);x2(i)]/norm([x1(i);x2(i)],p);
  end
  
  b=A*x;
  plot(b(1,end),b(2,end),'o','MarkerSize',14)  
  hold on
  plot([0,b(1,end)],[0,b(2,end)],'LineWidth',2)  
  if k>1
    plot(b(1,1:end-1),b(2,1:end-1),'*','MarkerSize',12)
  end
  grid on
  axis square
  title(['y \in \{Ax: || x ',sprintf('||_{%d}',p),' = 1\}'],'FontSize',14)
  hold off
  
