How to check if three coordinates form a line Assume I have three coordinates from a world map in Longitude + Latitude. Is there a way to determine these three coordinates form a straight line?
What if I was using a system with bounds that defines the 2 corners (northeast - southwest) in Long/Lat?
The long & lat are expressed in decimal degrees.

The following MATLAB code might do the trick
function result = collinear(lat1, lon1, lat2, lon2, lat3, lon3)
% result = collinear(lat1, lon1, lat2, lon2, lat3, lon3)
%
% returns a measure of the collinearity of the points (lat1,lon1),
% (lat2,lon2), (lat3,lon3) defined as follows:
%
% Find the middle point (opposite the longest edge); for the sake
% of illustration assume this is point 2.  Compute bearings at
% point 2 for the line from 1 to 2 and from 2 to 3.  If the points
% are collinear, these bearings are equal.  So use the difference
% in bearings (in degrees) as the measure of collinearity.
%
% Requires the package
%  http://www.mathworks.com/matlabcentral/fileexchange/39108
%
% This version is not vectorized.  It would be relatively easy to
% make it vectorized.
  lata = [lat1; lat2; lat3];  lona = [lon1; lon2; lon3];
  latb = [lat2; lat3; lat1];  lonb = [lon2; lon3; lon1];
  [s12, azi1, azi2] = geoddistance(lata, lona, latb, lonb);
  imax = find(s12 == max(s12));
  imax = imax(1);
  ia = mod(imax,3)+1; ib = mod(imax+1,3)+1;
  azia = azi2(ia); azib = azi1(ib);
  result = azib - azia;
  if result >= 180
    result = result - 360;
  elseif result < -180
    result = result + 360;
end

Alternatively you can divide the area of the triangle (given by geodarea) by the longest sides to get a measure of how far the opposite point is from the longest side.
