function [a,b,c] = rsttoabc(r,s,t)
  
% function [a,b,c] = rsttoabc(r,s,t)
% Purpose: Transfer from (r,s,t) -> (a,b,c) coordinates in triangle  

N_p = length(r);
a = zeros(1,N_p); b = zeros(1,N_p);

for i = 1:N_p  
	if(s(i)+t(i) ~= 0)
    	a(i) = -2 * (1 + r(i)) / (s(i) + t(i)) - 1;
  	else
    	a(i) = -1;
  	end
  	if(t(i) ~= 1)
    	b(i) = 2 * (1 + s(i)) / (1 - t(i)) - 1;
  	else
    	b(i) = -1;
  	end
end
c = t;

end