% Forward model of projection for computed tomography.
function [projection, object_rotated] = forward(object, theta)
% object = An NxN element array. This could be emission measure
%     of the solar corona, or optical density of a human head, or
%     any other thing that is integrated through to make projections.
% theta = A projection angle in DEGREES.
% projection = The resulting N-element projection.

N = sqrt(numel(object));

object_rotated = imrotate(object, theta, 'bicubic', 'crop', 0);
   % The zero is the value to fill in for extrapolated pixels.
% object_rotated( find(isna(object_rotated)) )=0; % replace missing data (NA) with 0.0

projection = sum(object_rotated, 2); % summing along the y-direction
projection(find(projection<0))=0; % threshold >0
