/*
- * Copyright (C) 2009 Andy Spencer <spenceal@rose-hulman.edu>
+ * Copyright (C) 2009-2010 Andy Spencer <andy753421@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
(a[1]-b[1])*(a[1]-b[1]) +
(a[2]-b[2])*(a[2]-b[2]));
}
+
+gdouble lon_avg(gdouble a, gdouble b)
+{
+ gdouble diff = ABS(a-b);
+ gdouble avg = (a+b)/2;
+ if (diff > 180) {
+ if (avg >= 0)
+ avg -= 180;
+ else
+ avg += 180;
+ }
+ return avg;
+}