function [nvec,tvec] = linkage_vec(th)
%
% get unit vectors along links (that is along direction given by angles)
%
nlink = length(th);
%
nvec = zeros(2,nlink);
%
for i_link = 1:nlink;
	nvec(:,i_link) = [cos(th(i_link)) sin(th(i_link))]';
end;
%
if nargout > 1;
  %
  % also get vectors along k ^ n (where ^ indicates cross product)
  %
  tvec = zeros(2,nlink);
  %
  for i_link = 1:nlink;
	tvec(:,i_link) = [-sin(th(i_link)) cos(th(i_link))]';
  end;
  %
end;	
