function [xline,yline] = MakeLine(initial_x,intial_y,angle,numPixels_x,numPixels_y)

% this function makes a line at an arbitrary angle, then projects it onto
% the discretized pixel grid, and makes a list of pixels it should travel
% throug

% longest posible length of a line (in number of pixels)
lineLength = 2*max([numPixels_x,numPixels_y]);

% x distance of longest line
dx = lineLength*sind(angle);

% y distance of longest line
dy = lineLength*cosd(angle);

% final x,y coordoinates of the line
final_x = initial_x + dx;
final_y = intial_y + dy;

% list of x,y locations, (step size close to 1 pixel / step)
x = linspace(initial_x,final_x,lineLength);
y = linspace(intial_y,final_y,lineLength);

% identify and remove any any x,y positions that are duplicates (due to projecting a
% smooth line into pixelated space)
B = unique([round(x)',round(y)'],'rows','stable');
xline = B(:,1)';
yline = B(:,2)';

end