% Input:
% point1, point2: 2x1 vector

% Output:
% k,t: double

% Description:
% Returns an equation of the form y=kx +t or x = t in case of a vertical
% line (with k = Inf)

function [k,t] = generateLineEquation(point1,point2)

k = (point2(2)-point1(2))/((point2(1)-point1(1)));

if k == Inf || k == -Inf
    t = point1(1);    
else
    t = point1(2) - k*point1(1);
end;