% MATLAB demo: Testing, if equal to zero can be dangerous
p1 = [0;0];
v1 = [3;5];
p2 = p1 + v1;
v2 = [-v1(2);v1(1)]; v2 = v2/3.0; % Move orthogonal to v1
p3 = p2 + v2;
v3 = [-v2(2);v2(1)]; v3 = v3*3.0; % Move orthogonal to v2
p4 = p3 + v3;
v4 = [-v3(2);v3(1)]; v4 = v4/3.0; % Move orthogonal to v3
p5 = p4 + v4;

if (p5 == p1), disp('First point = final point');
else disp('First point does not coincide with final point');
end

plot([p1(1),p2(1),p3(1),p4(1),p5(1)],[p1(2),p2(2),p3(2),p4(2),p5(2)],'b+-');

        