function Bs = cumsum_config(As)
%concatinate relative 2D transformations

theta = cumsum([0 As(3,1:end-1)]);
Bs = zeros(size(As));
Bs(1,:) = cumsum(cos(theta).*As(1,:) -sin(theta).*As(2,:));
Bs(2,:) = cumsum(sin(theta).*As(1,:) +cos(theta).*As(2,:));
Bs(3,:) = [theta(2:end) theta(end)+As(3,end)];