+int quaternionAroundWorldTest()
+{
+ wgs84 start(42.89, 85.56), p; // 42.89°N 85.56°W
+ quat q = quat(cos(M_PI_2l/18000), zAxis).normVec(); // Around the world at this latitude.
+
+ p = start;
+ for (int i=0; i<36000; ++i) p = q * p;
+ if ((start - p).dist() > 0.1) ERR(6, "Around world on latitude Quaternion test");
+
+ q = quat(cos(M_PI_2l/18000), zAxis.cross(start)).normVec(); // Polar around the world
+ p = start;
+ for (int i=0; i<36000; ++i) p = q * p;
+ if ((start - p).dist() > 0.25) ERR(6, "Polar around world Quaternion test");
+
+ q = quat(cos(M_PI_2l/18000), wgs84(0,0).cross(start)).normVec(); // Around world through N0, E0
+ p = start;
+ for (int i=0; i<36000; ++i) p = q * p;
+ if ((start - p).dist() > 0.25) ERR(6, "Around world through N0, W0 Quaternion test");
+
+ /*
+ std::cout << " " << p.x;
+ std::cout << " " << p.y;
+ std::cout << " " << p.z;
+ std::cout << " " << (start - p).dist();
+ std::cout << std::endl;
+ */
+
+ return 0;
+}
+
+