function visCody820Solution(P,P2)

Px = P(:,1);
Py = P(:,2);

P2x = P2(:,1);
P2y = P2(:,2);

x_min = min(min(Px), min(P2x));
x_max = max(max(Px), max(P2x));
y_min = min(min(Py), min(P2y));
y_max = max(max(Py), max(P2y));

limits = [x_min-1, x_max+1, y_min-1, y_max+1];

subplot(1,2,1)
plot_P(P);
axis(limits);
title('P')

subplot(1,2,2)
plot_P(P2);
axis(limits);
title('P2')

function plot_P(P)

h = plot(P(:,1), P(:,2), '-s', 'LineWidth', 2);
c = get(h,'Color');

axis equal

hold on

plot(P(1,1), P(1,2), 's', ...
    'MarkerSize', 2*get(h,'MarkerSize'), ...
    'MarkerFaceColor', c);

for k = 1:size(P,1) - 1
    arrow(P(k,:),P(k+1,:),...
        'FaceColor', c, ...
        'EdgeColor', c);
end

hold off
