function tmax = show_raptorchase3(theta)

[tmax,sol] = raptorchase3(theta);
ndim = numel(theta)+1;
positions = deval(sol,sol.x)

nraptors = size(positions,1)/ndim - 1;
assert(ceil(nraptors) == nraptors) % integer operations are exact

cla;
hold on;
axis off;
if ndim==3
    plot3(positions(1,:),positions(2,:),positions(3,:),'k-', 'LineWidth', 3);
else
    plot(positions(1,:),positions(2,:),'k-', 'LineWidth', 3);
end
for i=1:nraptors
    if ndim==3
        plot3(positions(ndim*i+1,:),positions(ndim*i+2,:),positions(ndim*i+3,:),'r-', 'LineWidth', 2);
    else
        plot(positions(ndim*i+1,:),positions(ndim*i+2,:),'r-', 'LineWidth', 2);
    end
end
plot3(0,0,0,'r.','MarkerSize',12);
axis square;
hold off;

title(sprintf('Surival time = %.3f sec', tmax),'FontSize',20);
