function dtscale = dtscale2D();

% compute inscribed circle diameter as characteristic for grid to choose timestep

Globals2D;

vmask1 = find(abs(r + s + 2) < NODETOL);
vmask2 = find(abs(r - 1) < NODETOL);
vmask3 = find(abs(s - 1) < NODETOL);
vmask = [vmask1; vmask2; vmask3];
vx = x(vmask,:); vy = y(vmask,:);

lengths1 = sqrt((vx(1,:) - vx(2,:)) .^ 2 + (vy(1,:) - vy(2,:)) .^ 2);
lengths2 = sqrt((vx(2,:) - vx(3,:)) .^ 2 + (vy(2,:) - vy(3,:)) .^ 2);
lengths3 = sqrt((vx(3,:) - vx(1,:)) .^ 2 + (vy(3,:) - vy(1,:)) .^ 2);
semiperimeters = (lengths1 + lengths2 + lengths3) / 2;
% Heron's formulace for triangle area
areas = sqrt(semiperimeters .* (semiperimeters - lengths1) .* (semiperimeters - lengths2) .* (semiperimeters - lengths3));

dtscale = areas ./ semiperimeters;

end