function pbeDefinition = growthDensitySampleUniform

%% call common definition
pbeDefinition = growthDensityCommon;


%% Initial distribution
rng(1);
% discrete sampling
%! ToDo: I need to understand cov to lay out the normal distribution
%        properly.
% Design code:
% stdX=1e-1;stdY=5e-1;corr=1/sqrt(2);
% disD = obtainDistributionDiscrete('normal', 'mean', [3 3], 'cov', [stdX^2 corr*stdX*stdY; corr*stdX*stdY stdY^2], 'nSample', 1e3)
% plot(disD.positionMatrix(1,:), disD.positionMatrix(2,:), 'r.')
%%
% xlim([0 2]),ylim([0 2])
% obtain polytope to sample from..
%   ..the right shape:
vrep = obtainVrep('polygon', 5, 2);
vrep = stretchPolytope(vrep, [2, 1]);
vrep = rotatePolytope(vrep, '', pi/4);
%   ..the right size and position
vrep = stretchPolytope(vrep, pbeDefinition.seeding.mean1(1)*0.5);
vrep = movePolytope(vrep, pbeDefinition.seeding.mean1*1.1);
pbeDefinition.seeding.vrep = vrep;

disD = obtainDistributionDiscrete('poly', ...
    'nSample', pbeDefinition.seeding.nSample, ...
    'poly', vrep);

%%
% application to pbeDefinition
pbeDefinition.seeding.positionMatrix = disD.positionMatrix;       % m
pbeDefinition.seeding.numberVector = ...
    pbeDefinition.seeding.fhandle(disD.positionMatrix) ./ ...
    disD.probabilityVector; % #
pbeDefinition.seeding.probabilityVector = disD.probabilityVector;    

close all
plot3(disD.positionMatrix(1,:), disD.positionMatrix(2,:), ...
    pbeDefinition.seeding.fhandle(disD.positionMatrix), 'r.')