function [OccFrac, VoidFrac, PckDensity] = AreaFraction(xyHoney, xyZoneGranules, PrintBool)
    % Outputs - 
    %    OccFrac - Occupied area fraction (xyHoneyArea/Total box area)
    %    VoidFrac - Void area fraction ((Total box area - total viscous zones' area)/Total box area)
    %    PckDensity - Packing density (number of granules/Total box area)
    %
    % Inputs - 
    %    xyHoney - Cell containing arrays corresponding to viscous zones
    %    xLimit - Box length
    %    yLimit - Box width
    %    PrintBool - logical; 1 => Print OccFrac, VoidFrac, PckDensity values
    % Usage - 
    %    [OF, VF, PD] = AreaFraction(xyHoney, 1, 0.45, false);

    xyZoneGranules = xyZoneGranules{1};
    TotalArea = xyZoneGranules(3)*xyZoneGranules(4);
    
    %% Calculate total viscous area (sum of the areas of all granules)
    xyHoneyArea = 0;
    for i = 1:size(xyHoney,1)
        if iscell(xyHoney)
            xyHoneyArea = xyHoneyArea + (pi*(xyHoney{i}(3)^2));
        elseif ismatrix(xyHoney)
            xyHoneyArea = xyHoneyArea + (pi*(xyHoney(i,3)^2));
        end
    end
    
    %% Output
    OccFrac = xyHoneyArea/TotalArea;
    VoidFrac = (TotalArea-xyHoneyArea)/TotalArea;
    PckDensity = size(xyHoney,1)/TotalArea;
    if PrintBool
        fprintf("Occupied area fraction is: %.4g\n", OccFrac);
        fprintf("Void area fraction is: %.4g\n", VoidFrac);
        fprintf("Packing density is: %.4g\n", PckDensity);
    end
end
