%
% Computes the area of a slice of the torus parallel to the x-axis 
% taken at height y.
%
function a = areaSlice(y)

radiusOuter = 2 + sqrt(1 - y.^2); % radius of outer disk
radiusInner = 2 - sqrt(1 - y.^2); % radius of inner disk

% area = area of outer disk - area of inner disk
a = pi*(radiusOuter.^2 - radiusInner.^2);