# cornerBall2D

    % The same as in cornerBallSparse2D but without the sparse edge.

    function q = cornerBall2D(X1,X2,varargin)
    seti = varargin{end};
    R = seti.rCD/2;

    n = sqrt(length(X1)); % n = nCD or nROI

    % -- corner: start
    qCorner = corner2D(X1,X2,seti); % size 1 x seti.nROI^2 or 1 x seti.nCD^2
    qCorner = 0.8*rot90(qCorner,2); % corner right top (0.8 as in twoCornersOneBall2D.m)

    % new layer...
    lspace = linspace(0,1,n); % values between 0 and 1
    L = repmat(lspace,[n 1]); % Layer: left high, right low...
    % L is a matrix... but we need a vector...
    L = reshape(L,[1 n^2]);
    L = 1.5.*L;

    qCorner = L.*qCorner;
    %-- corner: end

    % -- ball: start
    qBall = 1.0*((X2-15/32*R).^2 + (X1+15/32*R).^2 <= (1/16*R)^2);
    % -- ball: end

    % -- all 2 objects together --
    q = qCorner + qBall;
    q = double(q);

    end