% Input:
% L: Matrix (containing row-wise direction vectors)
% results: Matrix
% x: Integer (specifying a dimension)
% y: Integer (specifying a dimension different from x)

% Output:
% L: Matrix (containing row-wise direction vectors)
% results: Matrix
% indexes: vector

% Description:
% Choses the vectors l from L, which have only entries in dimensions x and y 

function [L,results,indexes] = selectDirectionsInPlane(L,results,x,y)
% there are no checks for invalid values for x,y e.g. there are not enough
% rows in L and/or results or x == y

% choose the directions which lie in the plane to plot
    selector = ones(size(L,2),1);
    selector(x) = 0;
    selector(y) = 0;
    zero = zeros(size(L,2),1);
    
    Lold = L;
    resultsold = results;
    
    L = zeros(1,size(Lold,2));
    results = zeros(1,size(resultsold,2));
    indexes = [];
    iterator = 0;
    
    for k=1:1:size(Lold,1)
        if selector.*Lold(k,:)' == zero
            iterator = iterator +1;
            L(iterator,:) = Lold(k,:);
            results(iterator,:) = resultsold(k,:);
            indexes(iterator) = k;
        end;
    end;