function r = Classify(tree, pt)
    % tree - decision tree, must be 5 columns
    % pt - 2D point to be classified, must be length 2
    % r - response of the decision tree, a real number. If r >= 0 then it is "1" else "0"

    index = 1;   

    while true
        r = tree(index, 1:3)*[pt 1]';

        if r >= 0
            index = tree(index, 4);
        else
            index = tree(index, 5);
        end
      
        if index == 0 
            break;
        end
    end
end
