function secorder2(d,a1,b1,a2,b2);

X = -20:20;
Y = -20:20;
Z = zeros(length(X), length(Y));
for i = 1:length(X)
    for j = 1:length(Y)
        Z(i,j) = norm([X(i),Y(j)],d);
    end
end

figure;
surf(X,Y,Z);
hold on;

if nargin >= 3
    X = [-20,20];
    Y = [-20,20];
    Z = zeros(length(X), length(Y));
    for i = 1:length(X)
        for j = 1:length(Y)
            Z(i,j) = dot(a1,[X(i);Y(j)])+b1;
        end
    end
    surf(X,Y,Z);
end

if nargin >= 5
    X = [-20,20];
    Y = [-20,20];
    Z = zeros(length(X), length(Y));
    for i = 1:length(X)
        for j = 1:length(Y)
            Z(i,j) = dot(a2,[X(i);Y(j)])+b2;
        end
    end
    surf(X,Y,Z);
end
hold off;
