GeoTessCPP  2.2.3
Software to facilitate storage and retrieval of 3D information about the Earth.
GeoTessUtils.h
Go to the documentation of this file.
1 //- ****************************************************************************
2 //-
3 //- Copyright 2009 National Technology & Engineering Solutions of Sandia, LLC
4 //- (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
5 //- Government retains certain rights in this software.
6 //-
7 //- BSD Open Source License
8 //- All rights reserved.
9 //-
10 //- Redistribution and use in source and binary forms, with or without
11 //- modification, are permitted provided that the following conditions are met:
12 //-
13 //- 1. Redistributions of source code must retain the above copyright notice,
14 //- this list of conditions and the following disclaimer.
15 //-
16 //- 2. Redistributions in binary form must reproduce the above copyright
17 //- notice, this list of conditions and the following disclaimer in the
18 //- documentation and/or other materials provided with the distribution.
19 //-
20 //- 3. Neither the name of the copyright holder nor the names of its
21 //- contributors may be used to endorse or promote products derived from
22 //- this software without specific prior written permission.
23 //-
24 //- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 //- AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 //- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 //- ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
28 //- LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 //- CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 //- SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 //- INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 //- CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 //- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 //- POSSIBILITY OF SUCH DAMAGE.
35 //-
36 //- ****************************************************************************
37 
38 #ifndef GEOTESSUTILS_OBJECT_H
39 #define GEOTESSUTILS_OBJECT_H
40 
41 // **** _SYSTEM INCLUDES_ ******************************************************
42 
43 #include <iostream>
44 #include <fstream>
45 #include <vector>
46 #include <map>
47 #include <string>
48 
49 // use standard library objects
50 using namespace std;
51 
52 // **** _LOCAL INCLUDES_ *******************************************************
53 
54 #include "CPPUtils.h"
55 
56 // **** _BEGIN GEOTESS NAMESPACE_ **********************************************
57 
58 namespace geotess
59 {
60 
61 // **** _FORWARD REFERENCES_ ***************************************************
62 
63 // **** _CLASS DEFINITION_ *****************************************************
64 
72 {
73 private:
74 
75  /*
76  * Private copy constructor. Not used.
77  */
78  GeoTessUtils(const GeoTessUtils& gtu) { }
79 
80  /*
81  * Private assignment operator. Not used.
82  */
83  GeoTessUtils& operator=(const GeoTessUtils& gtu) { return *this; }
84 
85 public:
86 
97  static bool approximateLatitudes;
98 
103 
107  virtual ~GeoTessUtils() { }
108 
113  static string class_name()
114  { return "GeoTessUtils"; }
115 
120  virtual int class_size() const
121  { return (int) sizeof(GeoTessUtils); }
122 
127  static string getVersion() { return "2.2.3"; }
128 
136  static double dot(const double* const v0, const double* const v1)
137  { return v0[0] * v1[0] + v0[1] * v1[1] + v0[2] * v1[2]; }
138 
148  static double scalarTripleProduct(const double* const v0,
149  const double* const v1, const double* const v2)
150  {
151  return v0[0] * v1[1] * v2[2] + v1[0] * v2[1] * v0[2]
152  + v2[0] * v0[1] * v1[2] - v2[0] * v1[1] * v0[2]
153  - v0[0] * v2[1] * v1[2] - v1[0] * v0[1] * v2[2];
154  }
155 
163  static double getGeocentricLat(const double& lat);
164 
172  static double getGeographicLat(const double& lat);
173 
175 
184  static double getGeoCentricLatitude(const double& lat) { return getGeocentricLat(lat); }
185 
194  static double getGeoGraphicLatitude(const double& lat) { return getGeographicLat(lat); }
195 
197 
202  static string getLatLonString(const double* const v);
203 
208  static string getLonLatString(const double* const v);
209 
210 
225  static double azimuthDegrees(const double* const v1, const double* const v2,
226  double errorValue);
227 
242  static double azimuth(const double* const v1, const double* const v2,
243  double errorValue);
244 
259 static void rotate(const double* const x, const double* const p, double a,
260  double* const z);
261 
284  static double** getGreatCircle(const double* const v0,
285  const double* const v1);
286 
309  static void getGreatCircle(const double* const v0, const double* const v1,
310  double** const gc);
311 
336  static double** getGreatCircle(const double* const v, double azimuth);
337 
362  static void getGreatCircle(const double* const v, double azimuth,
363  double** const gc);
364 
377  static int getGreatCirclePoints(double* ptA, double* ptB,
378  const double& delta, const bool& onCenters);
379 
393  static double getGreatCirclePoints(double* ptA, double* ptB,
394  const int& npoints, const bool& onCenters, double** points);
395 
412  static double getGreatCirclePoints(double* ptA, double* ptB,
413  const double& delta, const bool& onCenters, double** points,
414  int& npoints);
415 
422  static double length(const double* const u)
423  {
424  double l = u[0] * u[0] + u[1] * u[1] + u[2] * u[2];
425  return l > 0 ? sqrt(l) : 0.;
426  }
427 
440  static void getTransform(const double* const u, const double* const v,
441  double** const t);
442 
458  static void transform(const double* x,
459  double const* const * const t, double* const g)
460  {
461  g[0] = x[0] * t[0][0] + x[1] * t[0][1] + x[2] * t[0][2];
462  g[1] = x[0] * t[1][0] + x[1] * t[1][1] + x[2] * t[1][2];
463  g[2] = x[0] * t[2][0] + x[1] * t[2][1] + x[2] * t[2][2];
464  }
465 
471  static void readString(string& s, ifstream& ifs)
472  {
473  int sze;
474  ifs >> sze;
475  char* c = new char[sze];
476  ifs.read(c, sze);
477  s = c;
478  delete[] c;
479  }
480 
486  static void writeString(ofstream& ofs, const string& s)
487  {
488  ofs << s.length();
489  ofs.write(s.c_str(), s.length());
490  }
491 
499  static double angle(const double* const v0,
500  const double* const v1)
501  {
502  double dot = v0[0] * v1[0] + v0[1] * v1[1] + v0[2] * v1[2];
503  if (dot >= 1.0)
504  return 0.0;
505  if (dot <= -1.0)
506  return PI;
507  return acos(dot);
508  }
509 
517  static double angleDegrees(const double* const v0,
518  const double* const v1)
519  {
520  double dot = v0[0] * v1[0] + v0[1] * v1[1] + v0[2] * v1[2];
521  if (dot >= 1.)
522  return 0.;
523  if (dot <= -1.)
524  return 180.;
525  return CPPUtils::toDegrees(acos(dot));
526  }
527 
539  static double getDistance3D(const double* const v0, double r0,
540  const double* const v1, double r1)
541  {
542  double v[3] = { v0[0] * r0 - v1[0] * r1, v0[1] * r0 - v1[1] * r1, v0[2] * r0
543  - v1[2] * r1 };
544  return length(v);
545  }
546 
555  static double getEarthRadius(const double* const v)
556  { return EARTH_A / sqrt(1. + EARTH_E / (1 - EARTH_E) * v[2] * v[2]); }
557 
565  static double getLat(const double* const v)
566  { return getGeographicLat(asin(v[2])); }
567 
574  static double getLon(const double* const v)
575  { return atan2(v[1], v[0]); }
576 
584  static double getLatDegrees(const double* const v)
585  {
586  // the constant 0.9933 is (1-e*e) where e is the eccentricity of the
587  // earth as defined by the WGS84 ellipsoid.
588  return CPPUtils::toDegrees(atan(tan(asin(v[2])) / 0.9933056199770992));
589  }
590 
597  static double getLonDegrees(const double* const v)
598  { return CPPUtils::toDegrees(atan2(v[1], v[0])); }
599 
612  static double* getVectorDegrees(const double& lat,
613  const double& lon)
614  { return getVector(CPPUtils::toRadians(lat), CPPUtils::toRadians(lon)); }
615 
627  static double* getVectorDegrees(const double& lat,
628  const double& lon, double* v)
629  { return getVector(CPPUtils::toRadians(lat), CPPUtils::toRadians(lon), v); }
630 
643  static double* getVector(const double& lat, const double& lon)
644  {
645  double* v = new double[3];
646  getVector(lat, lon, v);
647  return v;
648  }
649 
661  static double* getVector(const double& lat, const double& lon, double* v)
662  {
663  // convert lat from geographic to geocentric latitude.
664  double temp = getGeocentricLat(lat);
665 
666  // z component of v is sin of geocentric latitude.
667  v[2] = sin(temp);
668 
669  // set lat = to cos of geocentric latitude
670  temp = cos(temp);
671 
672  // compute x and y components of v
673  v[0] = temp * cos(lon);
674  v[1] = temp * sin(lon);
675 
676  return v;
677  }
678 
687  static void normalizeFast(double* const u)
688  {
689  double len = u[0] * u[0] + u[1] * u[1] + u[2] * u[2];
690  len = sqrt(len);
691  u[0] /= len;
692  u[1] /= len;
693  u[2] /= len;
694  }
695 
703  static double normalize(double* const u)
704  {
705  double len = u[0] * u[0] + u[1] * u[1] + u[2] * u[2];
706  if (len > 0.)
707  {
708  len = sqrt(len);
709  u[0] /= len;
710  u[1] /= len;
711  u[2] /= len;
712  }
713  else
714  {
715  len = u[0] = u[1] = u[2] = 0.0;
716  }
717  return len;
718  }
719 
730  static void cross(const double* const v1, const double* const v2,
731  double* const rslt)
732  {
733  rslt[0] = v1[1] * v2[2] - v1[2] * v2[1];
734  rslt[1] = v1[2] * v2[0] - v1[0] * v2[2];
735  rslt[2] = v1[0] * v2[1] - v1[1] * v2[0];
736  }
737 
748  static double* crossNormal(const double* const u,
749  const double* const v)
750  {
751  double* w = new double[3];
752  w[0] = u[1] * v[2] - u[2] * v[1];
753  w[1] = u[2] * v[0] - u[0] * v[2];
754  w[2] = u[0] * v[1] - u[1] * v[0];
755  normalize(w);
756  return w;
757  }
758 
771  static double crossNormal(const double* const u,
772  const double* const v, double* const w)
773  {
774  w[0] = u[1] * v[2] - u[2] * v[1];
775  w[1] = u[2] * v[0] - u[0] * v[2];
776  w[2] = u[0] * v[1] - u[1] * v[0];
777  return normalize(w);
778  }
779 
792  static double crossNorth(const double* const u, double* const w)
793  {
794  double len = u[0] * u[0] + u[1] * u[1];
795  if (len <= 0.)
796  {
797  len = w[0] = w[1] = w[2] = 0.;
798  }
799  else
800  {
801  len = sqrt(len);
802  w[0] = u[1] / len;
803  w[1] = -u[0] / len;
804  w[2] = 0.;
805  }
806  return len;
807  }
808 
824  static bool vectorTripleProduct(const double* const v0,
825  const double* const v1, const double* const v2, double* const rslt)
826  {
827  // set q = v0 cross v1
828  double q0 = v0[1] * v1[2] - v0[2] * v1[1];
829  double q1 = v0[2] * v1[0] - v0[0] * v1[2];
830  double q2 = v0[0] * v1[1] - v0[1] * v1[0];
831 
832  // set w = q cross v2
833  double w0 = q1 * v2[2] - q2 * v2[1];
834  double w1 = q2 * v2[0] - q0 * v2[2];
835  double w2 = q0 * v2[1] - q1 * v2[0];
836 
837  // set rslt = w
838  rslt[0] = w0;
839  rslt[1] = w1;
840  rslt[2] = w2;
841 
842  // normalize rslt to unit length. if the length
843  // of v1 or v2 is zero or they are nearly parallel then
844  // rslt will = {0,0,0} and the function will return false;
845  return normalize(rslt) != 0.;
846  }
847 
858  static bool vectorTripleProductNorthPole(const double* const u,
859  double* const w)
860  {
861  w[0] = -u[0] * u[2];
862  w[1] = -u[1] * u[2];
863  w[2] = u[1] * u[1] + u[0] * u[0];
864  return normalize(w) != 0.;
865  }
866 
877  static void circumCenter(const double* const v0,
878  const double* const v1, const double* const v2, double* const vs)
879  {
880  vs[0] = v0[1] * (v2[2] - v1[2]) + v2[1] * (v1[2] - v0[2]) + v1[1] * (v0[2] - v2[2]);
881  vs[1] = v0[2] * (v2[0] - v1[0]) + v2[2] * (v1[0] - v0[0]) + v1[2] * (v0[0] - v2[0]);
882  vs[2] = v0[0] * (v2[1] - v1[1]) + v2[0] * (v1[1] - v0[1]) + v1[0] * (v0[1] - v2[1]);
883  double len = vs[0] * vs[0] + vs[1] * vs[1] + vs[2] * vs[2];
884  len = sqrt(len);
885  vs[0] /= len;
886  vs[1] /= len;
887  vs[2] /= len;
888  }
889 
902  static void circumCenterPlus(const double* const v0,
903  const double* const v1, const double* const v2, double* const vs)
904  {
905  vs[0] = v0[1] * (v2[2] - v1[2]) + v2[1] * (v1[2] - v0[2]) + v1[1] * (v0[2] - v2[2]);
906  vs[1] = v0[2] * (v2[0] - v1[0]) + v2[2] * (v1[0] - v0[0]) + v1[2] * (v0[0] - v2[0]);
907  vs[2] = v0[0] * (v2[1] - v1[1]) + v2[0] * (v1[1] - v0[1]) + v1[0] * (v0[1] - v2[1]);
908  double len = vs[0] * vs[0] + vs[1] * vs[1] + vs[2] * vs[2];
909  len = sqrt(len);
910  vs[0] /= len;
911  vs[1] /= len;
912  vs[2] /= len;
913  vs[3] = dot(vs, v0);
914  }
915 
931  static double* circumCenterPlus(const double* const v0,
932  const double* const v1, const double* const v2)
933  {
934  double* vs = new double[4];
935  vs[0] = v0[1] * (v2[2] - v1[2]) + v2[1] * (v1[2] - v0[2]) + v1[1] * (v0[2] - v2[2]);
936  vs[1] = v0[2] * (v2[0] - v1[0]) + v2[2] * (v1[0] - v0[0]) + v1[2] * (v0[0] - v2[0]);
937  vs[2] = v0[0] * (v2[1] - v1[1]) + v2[0] * (v1[1] - v0[1]) + v1[0] * (v0[1] - v2[1]);
938  double len = vs[0] * vs[0] + vs[1] * vs[1] + vs[2] * vs[2];
939  len = sqrt(len);
940  vs[0] /= len;
941  vs[1] /= len;
942  vs[2] /= len;
943  vs[3] = dot(vs, v0);
944  return vs;
945  }
946 
961  static void circumCenterPlus(double const* const * const t, double* const vs)
962  { circumCenterPlus(t[0], t[1], t[2], vs); }
963 
979  static bool moveDistAz(const double* const w, double distance,
980  double azimuth, double* const u)
981  {
982  double n[3] = { 0.0, 0.0, 0.0 };
983  if (moveNorth(w, distance, n))
984  {
985  rotate(n, w, azimuth, u);
986  return true;
987  }
988  u[0] = w[0];
989  u[1] = w[1];
990  u[2] = w[2];
991  return false;
992  }
993 
1007  static void move(const double* const w, const double* const vtp,
1008  double a, double* const u)
1009  {
1010  double cosa = cos(a);
1011  double sina = sin(a);
1012  u[0] = cosa * w[0] + sina * vtp[0];
1013  u[1] = cosa * w[1] + sina * vtp[1];
1014  u[2] = cosa * w[2] + sina * vtp[2];
1015  }
1016 
1031  static bool moveNorth(const double* const x, double distance,
1032  double* const z)
1033  {
1034  double vtp[3] = { 0.0, 0.0, 0.0 };
1035  if (vectorTripleProductNorthPole(x, vtp))
1036  {
1037  move(x, vtp, distance, z);
1038  return true;
1039  }
1040 
1041  z[0] = x[0];
1042  z[1] = x[1];
1043  z[2] = x[2];
1044  return false;
1045  }
1046 
1054  static bool isPole(const double* const u)
1055  {
1056  return (u[0] * u[0] + u[1] * u[1]) < 1.0e-15;
1057  }
1058 
1068  static bool parallel(const double* const u, const double* const v)
1069  {
1070  return 1.0 - abs(u[0] * v[0] + u[1] * v[1] + u[2] * v[2]) < 2.0e-15;
1071  }
1072 
1089  static double* getGreatCirclePoint(
1090  double const* const * const greatCircle, double distance)
1091  {
1092  double* v = new double[3];
1093  getGreatCirclePoint(greatCircle, distance, v);
1094  return v;
1095  }
1096 
1114  static void getGreatCirclePoint(
1115  double const* const * const greatCircle, double distance,
1116  double* const v)
1117  {
1118  double cosa = cos(distance);
1119  double sina = sin(distance);
1120  v[0] = cosa * greatCircle[0][0] + sina * greatCircle[1][0];
1121  v[1] = cosa * greatCircle[0][1] + sina * greatCircle[1][1];
1122  v[2] = cosa * greatCircle[0][2] + sina * greatCircle[1][2];
1123  }
1124 
1131  static double getTriangleArea(const double* const v0,
1132  const double* const v1, const double* const v2)
1133  {
1134  double v10[3] = { v1[0] - v0[0], v1[1] - v0[1], v1[2] - v0[2] };
1135  double v20[3] = { v2[0] - v0[0], v2[1] - v0[1], v2[2] - v0[2] };
1136  double u[3] = { v10[1] * v20[2] - v10[2] * v20[1], v10[2] * v20[0]
1137  - v10[0] * v20[2], v10[0] * v20[1] - v10[1] * v20[0] };
1138  return sqrt(u[0] * u[0] + u[1] * u[1] + u[2] * u[2]) / 2.;
1139  }
1140 
1150  static double getTriangleArea(const double* const v0,
1151  const double* const v1, const double* const v2, double* work1, double* work2, double* work3)
1152  {
1153  work1[0] = v1[0] - v0[0];
1154  work1[1] = v1[1] - v0[1];
1155  work1[2] = v1[2] - v0[2];
1156 
1157  work2[0] = v2[0] - v0[0];
1158  work2[1] = v2[1] - v0[1];
1159  work2[2] = v2[2] - v0[2];
1160 
1161  work3[0] = work1[1] * work2[2] - work1[2] * work2[1];
1162  work3[1] = work1[2] * work2[0] - work1[0] * work2[2];
1163  work3[2] = work1[0] * work2[1] - work1[1] * work2[0];
1164 
1165  return sqrt(work3[0] * work3[0] + work3[1] * work3[1] + work3[2] * work3[2]) / 2.;
1166  }
1167 
1175  static double* center(double const * const * const v, int n)
1176  {
1177  double* x = new double[3];
1178  x[0] = x[1] = x[2] = 0.0;
1179  if (n == 0)
1180  return x;
1181 
1182  for (int i = 0; i < n; ++i)
1183  {
1184  x[0] += v[i][0];
1185  x[1] += v[i][1];
1186  x[2] += v[i][2];
1187  }
1188  normalize(x);
1189  return x;
1190  }
1191 
1199  static void center(vector<double*> v, double* x)
1200  {
1201  x[0] = x[1] = x[2] = 0.0;
1202 
1203  for (size_t i = 0; i < v.size(); ++i)
1204  {
1205  x[0] += v[i][0];
1206  x[1] += v[i][1];
1207  x[2] += v[i][2];
1208  }
1209  normalize(x);
1210  }
1211 };
1212 // end class GeoTessUtils
1213 
1214 // **** _INLINE FUNCTION IMPLEMENTATIONS_ **************************************
1215 
1216 // conversion from geocentric to geographic latitude, in radians.
1217 static const double geographic[] = {
1218 -1.5707963267948966,
1219 -1.5707963267948966, -1.5677489031921250, -1.5647014788238576, -1.5616540529246252,
1220 -1.5586066247290158, -1.5555591934716986, -1.5525117583874544, -1.5494643187112020,
1221 -1.5464168736780266, -1.5433694225232062, -1.5403219644822410, -1.5372744987908793,
1222 -1.5342270246851464, -1.5311795414013718, -1.5281320481762162, -1.5250845442467005,
1223 -1.5220370288502316, -1.5189895012246317, -1.5159419606081646, -1.5128944062395640,
1224 -1.5098468373580602, -1.5067992532034090, -1.5037516530159180, -1.5007040360364745,
1225 -1.4976564015065728, -1.4946087486683413, -1.4915610767645720, -1.4885133850387440,
1226 -1.4854656727350555, -1.4824179390984470, -1.4793701833746320, -1.4763224048101213,
1227 -1.4732746026522530, -1.4702267761492180, -1.4671789245500877, -1.4641310471048419,
1228 -1.4610831430643942, -1.4580352116806217, -1.4549872522063898, -1.4519392638955806,
1229 -1.4488912460031191, -1.4458431977850015, -1.4427951184983205, -1.4397470074012940,
1230 -1.4366988637532907, -1.4336506868148570, -1.4306024758477454, -1.4275542301149386,
1231 -1.4245059488806797, -1.4214576314104954, -1.4184092769712255, -1.4153608848310480,
1232 -1.4123124542595058, -1.4092639845275337, -1.4062154749074850, -1.4031669246731584,
1233 -1.4001183330998220, -1.3970696994642429, -1.3940210230447112, -1.3909723031210681,
1234 -1.3879235389747300, -1.3848747298887172, -1.3818258751476769, -1.3787769740379130,
1235 -1.3757280258474085, -1.3726790298658542, -1.3696299853846736, -1.3665808916970477,
1236 -1.3635317480979430, -1.3604825538841352, -1.3574333083542363, -1.3543840108087190,
1237 -1.3513346605499443, -1.3482852568821840, -1.3452357991116488, -1.3421862865465124,
1238 -1.3391367184969374, -1.3360870942751000, -1.3330374131952152, -1.3299876745735633,
1239 -1.3269378777285121, -1.3238880219805456, -1.3208381066522850, -1.3177881310685170,
1240 -1.3147380945562173, -1.3116879964445736, -1.3086378360650126, -1.3055876127512245,
1241 -1.3025373258391855, -1.2994869746671844, -1.2964365585758457, -1.2933860769081540,
1242 -1.2903355290094787, -1.2872849142275975, -1.2842342319127213, -1.2811834814175174,
1243 -1.2781326620971334, -1.2750817733092212, -1.2720308144139612, -1.2689797847740851,
1244 -1.2659286837548998, -1.2628775107243113, -1.2598262650528476, -1.2567749461136817,
1245 -1.2537235532826554, -1.2506720859383025, -1.2476205434618720, -1.2445689252373493,
1246 -1.2415172306514815, -1.2384654590937990, -1.2354136099566380, -1.2323616826351630,
1247 -1.2293096765273912, -1.2262575910342110, -1.2232054255594090, -1.2201531795096878,
1248 -1.2171008522946918, -1.2140484433270270, -1.2109959520222835, -1.2079433777990571,
1249 -1.2048907200789720, -1.2018379782867012, -1.1987851518499886, -1.1957322401996706,
1250 -1.1926792427696968, -1.1896261589971520, -1.1865729883222764, -1.1835197301884879,
1251 -1.1804663840424017, -1.1774129493338514, -1.1743594255159102, -1.1713058120449116,
1252 -1.1682521083804690, -1.1651983139854960, -1.1621444283262286, -1.1590904508722426,
1253 -1.1560363810964758, -1.1529822184752465, -1.1499279624882743, -1.1468736126186994,
1254 -1.1438191683531016, -1.1407646291815210, -1.1377099945974760, -1.1346552640979840,
1255 -1.1316004371835788, -1.1285455133583318, -1.1254904921298676, -1.1224353730093866,
1256 -1.1193801555116805, -1.1163248391551530, -1.1132694234618365, -1.1102139079574118,
1257 -1.1071582921712249, -1.1041025756363059, -1.1010467578893872, -1.0979908384709198,
1258 -1.0949348169250928, -1.0918786927998494, -1.0888224656469052, -1.0857661350217649,
1259 -1.0827097004837398, -1.0796531615959652, -1.0765965179254158, -1.0735397690429236,
1260 -1.0704829145231949, -1.0674259539448256, -1.0643688868903185, -1.0613117129460985,
1261 -1.0582544317025300, -1.0551970427539317, -1.0521395456985925, -1.0490819401387883,
1262 -1.0460242256807961, -1.0429664019349100, -1.0399084685154565, -1.0368504250408095,
1263 -1.0337922711334060, -1.0307340064197588, -1.0276756305304735, -1.0246171431002629,
1264 -1.0215585437679590, -1.0184998321765302, -1.0154410079730933, -1.0123820708089293,
1265 -1.0093230203394952, -1.0062638562244390, -1.0032045781276135, -1.0001451857170887,
1266 -0.9970856786651652, -0.9940260566483880, -0.9909663193475587, -0.9879064664477488,
1267 -0.9848464976383120, -0.9817864126128968, -0.9787262110694590, -0.9756658927102736,
1268 -0.9726054572419468, -0.9695449043754286, -0.9664842338260234, -0.9634234453134026,
1269 -0.9603625385616154, -0.9573015132991002, -0.9542403692586956, -0.9511791061776521,
1270 -0.9481177237976417, -0.9450562218647695, -0.9419946001295835, -0.9389328583470855,
1271 -0.9358709962767409, -0.9328090136824890, -0.9297469103327525, -0.9266846860004473,
1272 -0.9236223404629921, -0.9205598735023176, -0.9174972849048763, -0.9144345744616503,
1273 -0.9113717419681617, -0.9083087872244800, -0.9052457100352315, -0.9021825102096069,
1274 -0.8991191875613709, -0.8960557419088682, -0.8929921730750334, -0.8899284808873974,
1275 -0.8868646651780957, -0.8838007257838750, -0.8807366625461014, -0.8776724753107666,
1276 -0.8746081639284953, -0.8715437282545516, -0.8684791681488458, -0.8654144834759410,
1277 -0.8623496741050579, -0.8592847399100833, -0.8562196807695732, -0.8531544965667609,
1278 -0.8500891871895607, -0.8470237525305747, -0.8439581924870967, -0.8408925069611178,
1279 -0.8378266958593319, -0.8347607590931386, -0.8316946965786500, -0.8286285082366928,
1280 -0.8255621939928134, -0.8224957537772827, -0.8194291875250981, -0.8163624951759885,
1281 -0.8132956766744170, -0.8102287319695851, -0.8071616610154342, -0.8040944637706497,
1282 -0.8010271401986641, -0.7979596902676580, -0.7948921139505637, -0.7918244112250671,
1283 -0.7887565820736097, -0.7856886264833902, -0.7826205444463665, -0.7795523359592570,
1284 -0.7764840010235420, -0.7734155396454647, -0.7703469518360321, -0.7672782376110162,
1285 -0.7642093969909539, -0.7611404300011481, -0.7580713366716669, -0.7550021170373452,
1286 -0.7519327711377832, -0.7488632990173464, -0.7457937007251657, -0.7427239763151360,
1287 -0.7396541258459155, -0.7365841493809252, -0.7335140469883469, -0.7304438187411222,
1288 -0.7273734647169510, -0.7243029849982892, -0.7212323796723475, -0.7181616488310889,
1289 -0.7150907925712262, -0.7120198109942198, -0.7089487042062748, -0.7058774723183379,
1290 -0.7028061154460953, -0.6997346337099688, -0.6966630272351121, -0.6935912961514075,
1291 -0.6905194405934625, -0.6874474607006055, -0.6843753566168813, -0.6813031284910476,
1292 -0.6782307764765696, -0.6751583007316160, -0.6720857014190538, -0.6690129787064436,
1293 -0.6659401327660337, -0.6628671637747551, -0.6597940719142159, -0.6567208573706956,
1294 -0.6536475203351388, -0.6505740610031495, -0.6475004795749841, -0.6444267762555459,
1295 -0.6413529512543770, -0.6382790047856527, -0.6352049370681742, -0.6321307483253605,
1296 -0.6290564387852420, -0.6259820086804524, -0.6229074582482208, -0.6198327877303641,
1297 -0.6167579973732786, -0.6136830874279318, -0.6106080581498534, -0.6075329097991277,
1298 -0.6044576426403837, -0.6013822569427861, -0.5983067529800269, -0.5952311310303151,
1299 -0.5921553913763675, -0.5890795343053987, -0.5860035601091116, -0.5829274690836870,
1300 -0.5798512615297728, -0.5767749377524746, -0.5736984980613438, -0.5706219427703677,
1301 -0.5675452721979585, -0.5644684866669408, -0.5613915865045422, -0.5583145720423796,
1302 -0.5552374436164493, -0.5521602015671145, -0.5490828462390925, -0.5460053779814434,
1303 -0.5429277971475571, -0.5398501040951412, -0.5367722991862070, -0.5336943827870587,
1304 -0.5306163552682779, -0.5275382170047123, -0.5244599683754603, -0.5213816097638592,
1305 -0.5183031415574704, -0.5152245641480652, -0.5121458779316114, -0.5090670833082580,
1306 -0.5059881806823221, -0.5029091704622723, -0.4998300530607160, -0.4967508288943822,
1307 -0.4936714983841087, -0.4905920619548242, -0.4875125200355348, -0.4844328730593077,
1308 -0.4813531214632545, -0.4782732656885168, -0.4751933061802482, -0.4721132433875999,
1309 -0.4690330777637020, -0.4659528097656490, -0.4628724398544813, -0.4597919684951693,
1310 -0.4567113961565957, -0.4536307233115377, -0.4505499504366511, -0.4474690780124505,
1311 -0.4443881065232937, -0.4413070364573617, -0.4382258683066425, -0.4351446025669108,
1312 -0.4320632397377119, -0.4289817803223404, -0.4259002248278240, -0.4228185737649034,
1313 -0.4197368276480125, -0.4166549869952609, -0.4135730523284130, -0.4104910241728699,
1314 -0.4074089030576480, -0.4043266895153610, -0.4012443840821984, -0.3981619872979068,
1315 -0.3950794997057681, -0.3919969218525802, -0.3889142542886367, -0.3858314975677045,
1316 -0.3827486522470051, -0.3796657188871915, -0.3765826980523292, -0.3734995903098728,
1317 -0.3704163962306467, -0.3673331163888213, -0.3642497513618933, -0.3611663017306622,
1318 -0.3580827680792097, -0.3549991509948770, -0.3519154510682416, -0.3488316688930969,
1319 -0.3457478050664276, -0.3426638601883887, -0.3395798348622813, -0.3364957296945312,
1320 -0.3334115452946638, -0.3303272822752831, -0.3272429412520464, -0.3241585228436426,
1321 -0.3210740276717675, -0.3179894563610997, -0.3149048095392786, -0.3118200878368778,
1322 -0.3087352918873839, -0.3056504223271693, -0.3025654797954709, -0.2994804649343629,
1323 -0.2963953783887339, -0.2933102208062620, -0.2902249928373890, -0.2871396951352969,
1324 -0.2840543283558812, -0.2809688931577279, -0.2778833902020855, -0.2747978201528420,
1325 -0.2717121836764979, -0.2686264814421417, -0.2655407141214227, -0.2624548823885265,
1326 -0.2593689869201489, -0.2562830283954686, -0.2531970074961227, -0.2501109249061789,
1327 -0.2470247813121108, -0.2439385774027693, -0.2408523138693584, -0.2377659914054063,
1328 -0.2346796107067404, -0.2315931724714588, -0.2285066773999049, -0.2254201261946395,
1329 -0.2223335195604130, -0.2192468582041398, -0.2161601428348690, -0.2130733741637589,
1330 -0.2099865529040473, -0.2068996797710264, -0.2038127554820124, -0.2007257807563200,
1331 -0.1976387563152328, -0.1945516828819765, -0.1914645611816903, -0.1883773919413984,
1332 -0.1852901758899828, -0.1822029137581537, -0.1791156062784226, -0.1760282541850719,
1333 -0.1729408582141288, -0.1698534191033340, -0.1667659375921156, -0.1636784144215582,
1334 -0.1605908503343753, -0.1575032460748804, -0.1544156023889568, -0.1513279200240304,
1335 -0.1482401997290386, -0.1451524422544033, -0.1420646483519993, -0.1389768187751272,
1336 -0.1358889542784822, -0.1328010556181263, -0.1297131235514570, -0.1266251588371797,
1337 -0.1235371622352770, -0.1204491345069784, -0.1173610764147325, -0.1142729887221751,
1338 -0.1111848721941013, -0.1080967275964339, -0.1050085556961953, -0.1019203572614753,
1339 -0.0988321330614037, -0.0957438838661177, -0.0926556104467337, -0.0895673135753164,
1340 -0.0864789940248483, -0.0833906525692003, -0.0803022899831004, -0.0772139070421047,
1341 -0.0741255045225655, -0.0710370832016027, -0.0679486438570714, -0.0648601872675336,
1342 -0.0617717142122262, -0.0586832254710305, -0.0555947218244430, -0.0525062040535433,
1343 -0.0494176729399648, -0.0463291292658628, -0.0432405738138854, -0.0401520073671412,
1344 -0.0370634307091703, -0.0339748446239121, -0.0308862498956756, -0.0277976473091088,
1345 -0.0247090376491666, -0.0216204217010820, -0.0185318002503333, -0.0154431740826154,
1346 -0.0123545439838071, -0.0092659107399420, -0.0061772751371762, -0.0030886379617588,
1347 0.0000000000000000, 0.0030886379617588, 0.0061772751371762, 0.0092659107399420,
1348 0.0123545439838071, 0.0154431740826154, 0.0185318002503333, 0.0216204217010820,
1349 0.0247090376491666, 0.0277976473091088, 0.0308862498956756, 0.0339748446239121,
1350 0.0370634307091703, 0.0401520073671412, 0.0432405738138854, 0.0463291292658628,
1351 0.0494176729399648, 0.0525062040535433, 0.0555947218244430, 0.0586832254710305,
1352 0.0617717142122262, 0.0648601872675336, 0.0679486438570714, 0.0710370832016027,
1353 0.0741255045225655, 0.0772139070421047, 0.0803022899831004, 0.0833906525692003,
1354 0.0864789940248483, 0.0895673135753164, 0.0926556104467337, 0.0957438838661177,
1355 0.0988321330614037, 0.1019203572614753, 0.1050085556961953, 0.1080967275964339,
1356 0.1111848721941013, 0.1142729887221751, 0.1173610764147325, 0.1204491345069784,
1357 0.1235371622352770, 0.1266251588371797, 0.1297131235514570, 0.1328010556181263,
1358 0.1358889542784822, 0.1389768187751272, 0.1420646483519993, 0.1451524422544033,
1359 0.1482401997290386, 0.1513279200240304, 0.1544156023889568, 0.1575032460748804,
1360 0.1605908503343753, 0.1636784144215582, 0.1667659375921156, 0.1698534191033340,
1361 0.1729408582141288, 0.1760282541850719, 0.1791156062784226, 0.1822029137581537,
1362 0.1852901758899828, 0.1883773919413984, 0.1914645611816903, 0.1945516828819765,
1363 0.1976387563152328, 0.2007257807563200, 0.2038127554820124, 0.2068996797710264,
1364 0.2099865529040473, 0.2130733741637589, 0.2161601428348690, 0.2192468582041398,
1365 0.2223335195604130, 0.2254201261946395, 0.2285066773999049, 0.2315931724714588,
1366 0.2346796107067404, 0.2377659914054063, 0.2408523138693584, 0.2439385774027693,
1367 0.2470247813121108, 0.2501109249061789, 0.2531970074961227, 0.2562830283954686,
1368 0.2593689869201489, 0.2624548823885265, 0.2655407141214227, 0.2686264814421417,
1369 0.2717121836764979, 0.2747978201528420, 0.2778833902020855, 0.2809688931577279,
1370 0.2840543283558812, 0.2871396951352969, 0.2902249928373890, 0.2933102208062620,
1371 0.2963953783887339, 0.2994804649343629, 0.3025654797954709, 0.3056504223271693,
1372 0.3087352918873839, 0.3118200878368778, 0.3149048095392786, 0.3179894563610997,
1373 0.3210740276717675, 0.3241585228436426, 0.3272429412520464, 0.3303272822752831,
1374 0.3334115452946638, 0.3364957296945312, 0.3395798348622813, 0.3426638601883887,
1375 0.3457478050664276, 0.3488316688930969, 0.3519154510682416, 0.3549991509948770,
1376 0.3580827680792097, 0.3611663017306622, 0.3642497513618933, 0.3673331163888213,
1377 0.3704163962306467, 0.3734995903098728, 0.3765826980523292, 0.3796657188871915,
1378 0.3827486522470051, 0.3858314975677045, 0.3889142542886367, 0.3919969218525802,
1379 0.3950794997057681, 0.3981619872979068, 0.4012443840821984, 0.4043266895153610,
1380 0.4074089030576480, 0.4104910241728699, 0.4135730523284130, 0.4166549869952609,
1381 0.4197368276480125, 0.4228185737649034, 0.4259002248278240, 0.4289817803223404,
1382 0.4320632397377117, 0.4351446025669111, 0.4382258683066425, 0.4413070364573617,
1383 0.4443881065232935, 0.4474690780124507, 0.4505499504366511, 0.4536307233115377,
1384 0.4567113961565955, 0.4597919684951695, 0.4628724398544813, 0.4659528097656488,
1385 0.4690330777637022, 0.4721132433875999, 0.4751933061802482, 0.4782732656885166,
1386 0.4813531214632548, 0.4844328730593077, 0.4875125200355348, 0.4905920619548240,
1387 0.4936714983841087, 0.4967508288943822, 0.4998300530607158, 0.5029091704622726,
1388 0.5059881806823221, 0.5090670833082580, 0.5121458779316113, 0.5152245641480654,
1389 0.5183031415574704, 0.5213816097638592, 0.5244599683754600, 0.5275382170047123,
1390 0.5306163552682779, 0.5336943827870585, 0.5367722991862072, 0.5398501040951412,
1391 0.5429277971475571, 0.5460053779814433, 0.5490828462390928, 0.5521602015671145,
1392 0.5552374436164493, 0.5583145720423793, 0.5613915865045422, 0.5644684866669408,
1393 0.5675452721979584, 0.5706219427703679, 0.5736984980613438, 0.5767749377524745,
1394 0.5798512615297726, 0.5829274690836871, 0.5860035601091116, 0.5890795343053986,
1395 0.5921553913763673, 0.5952311310303152, 0.5983067529800269, 0.6013822569427860,
1396 0.6044576426403839, 0.6075329097991278, 0.6106080581498534, 0.6136830874279315,
1397 0.6167579973732787, 0.6198327877303641, 0.6229074582482207, 0.6259820086804526,
1398 0.6290564387852421, 0.6321307483253605, 0.6352049370681740, 0.6382790047856529,
1399 0.6413529512543770, 0.6444267762555458, 0.6475004795749840, 0.6505740610031496,
1400 0.6536475203351388, 0.6567208573706955, 0.6597940719142161, 0.6628671637747552,
1401 0.6659401327660337, 0.6690129787064435, 0.6720857014190540, 0.6751583007316160,
1402 0.6782307764765694, 0.6813031284910472, 0.6843753566168814, 0.6874474607006055,
1403 0.6905194405934625, 0.6935912961514077, 0.6966630272351122, 0.6997346337099688,
1404 0.7028061154460952, 0.7058774723183380, 0.7089487042062748, 0.7120198109942197,
1405 0.7150907925712261, 0.7181616488310891, 0.7212323796723475, 0.7243029849982890,
1406 0.7273734647169512, 0.7304438187411223, 0.7335140469883469, 0.7365841493809251,
1407 0.7396541258459156, 0.7427239763151360, 0.7457937007251656, 0.7488632990173463,
1408 0.7519327711377833, 0.7550021170373452, 0.7580713366716668, 0.7611404300011482,
1409 0.7642093969909540, 0.7672782376110162, 0.7703469518360320, 0.7734155396454648,
1410 0.7764840010235420, 0.7795523359592569, 0.7826205444463663, 0.7856886264833903,
1411 0.7887565820736097, 0.7918244112250670, 0.7948921139505639, 0.7979596902676581,
1412 0.8010271401986641, 0.8040944637706496, 0.8071616610154343, 0.8102287319695851,
1413 0.8132956766744170, 0.8163624951759882, 0.8194291875250982, 0.8224957537772827,
1414 0.8255621939928133, 0.8286285082366929, 0.8316946965786500, 0.8347607590931386,
1415 0.8378266958593317, 0.8408925069611180, 0.8439581924870967, 0.8470237525305746,
1416 0.8500891871895606, 0.8531544965667610, 0.8562196807695732, 0.8592847399100831,
1417 0.8623496741050583, 0.8654144834759411, 0.8684791681488458, 0.8715437282545514,
1418 0.8746081639284954, 0.8776724753107666, 0.8807366625461013, 0.8838007257838747,
1419 0.8868646651780958, 0.8899284808873974, 0.8929921730750333, 0.8960557419088684,
1420 0.8991191875613709, 0.9021825102096069, 0.9052457100352312, 0.9083087872244802,
1421 0.9113717419681617, 0.9144345744616502, 0.9174972849048760, 0.9205598735023178,
1422 0.9236223404629921, 0.9266846860004472, 0.9297469103327527, 0.9328090136824891,
1423 0.9358709962767409, 0.9389328583470853, 0.9419946001295836, 0.9450562218647695,
1424 0.9481177237976417, 0.9511791061776519, 0.9542403692586957, 0.9573015132991002,
1425 0.9603625385616152, 0.9634234453134028, 0.9664842338260234, 0.9695449043754285,
1426 0.9726054572419467, 0.9756658927102736, 0.9787262110694590, 0.9817864126128968,
1427 0.9848464976383122, 0.9879064664477489, 0.9909663193475587, 0.9940260566483880,
1428 0.9970856786651654, 1.0001451857170889, 1.0032045781276135, 1.0062638562244390,
1429 1.0093230203394952, 1.0123820708089293, 1.0154410079730933, 1.0184998321765304,
1430 1.0215585437679590, 1.0246171431002629, 1.0276756305304735, 1.0307340064197590,
1431 1.0337922711334060, 1.0368504250408095, 1.0399084685154563, 1.0429664019349100,
1432 1.0460242256807961, 1.0490819401387883, 1.0521395456985927, 1.0551970427539317,
1433 1.0582544317025300, 1.0613117129460985, 1.0643688868903185, 1.0674259539448256,
1434 1.0704829145231949, 1.0735397690429234, 1.0765965179254158, 1.0796531615959652,
1435 1.0827097004837398, 1.0857661350217650, 1.0888224656469052, 1.0918786927998494,
1436 1.0949348169250925, 1.0979908384709200, 1.1010467578893872, 1.1041025756363059,
1437 1.1071582921712246, 1.1102139079574118, 1.1132694234618365, 1.1163248391551530,
1438 1.1193801555116807, 1.1224353730093866, 1.1254904921298676, 1.1285455133583315,
1439 1.1316004371835790, 1.1346552640979840, 1.1377099945974760, 1.1407646291815206,
1440 1.1438191683531016, 1.1468736126186994, 1.1499279624882743, 1.1529822184752467,
1441 1.1560363810964758, 1.1590904508722426, 1.1621444283262283, 1.1651983139854962,
1442 1.1682521083804690, 1.1713058120449116, 1.1743594255159100, 1.1774129493338514,
1443 1.1804663840424017, 1.1835197301884879, 1.1865729883222769, 1.1896261589971520,
1444 1.1926792427696968, 1.1957322401996704, 1.1987851518499888, 1.2018379782867012,
1445 1.2048907200789720, 1.2079433777990570, 1.2109959520222835, 1.2140484433270270,
1446 1.2171008522946918, 1.2201531795096880, 1.2232054255594090, 1.2262575910342110,
1447 1.2293096765273910, 1.2323616826351633, 1.2354136099566380, 1.2384654590937990,
1448 1.2415172306514812, 1.2445689252373493, 1.2476205434618720, 1.2506720859383025,
1449 1.2537235532826556, 1.2567749461136817, 1.2598262650528476, 1.2628775107243113,
1450 1.2659286837549000, 1.2689797847740851, 1.2720308144139612, 1.2750817733092210,
1451 1.2781326620971334, 1.2811834814175174, 1.2842342319127213, 1.2872849142275977,
1452 1.2903355290094787, 1.2933860769081540, 1.2964365585758455, 1.2994869746671847,
1453 1.3025373258391855, 1.3055876127512245, 1.3086378360650124, 1.3116879964445736,
1454 1.3147380945562173, 1.3177881310685170, 1.3208381066522852, 1.3238880219805456,
1455 1.3269378777285121, 1.3299876745735630, 1.3330374131952154, 1.3360870942751000,
1456 1.3391367184969374, 1.3421862865465122, 1.3452357991116488, 1.3482852568821840,
1457 1.3513346605499441, 1.3543840108087193, 1.3574333083542363, 1.3604825538841352,
1458 1.3635317480979428, 1.3665808916970479, 1.3696299853846736, 1.3726790298658542,
1459 1.3757280258474083, 1.3787769740379130, 1.3818258751476769, 1.3848747298887170,
1460 1.3879235389747302, 1.3909723031210681, 1.3940210230447112, 1.3970696994642426,
1461 1.4001183330998221, 1.4031669246731584, 1.4062154749074850, 1.4092639845275339,
1462 1.4123124542595058, 1.4153608848310480, 1.4184092769712255, 1.4214576314104956,
1463 1.4245059488806797, 1.4275542301149386, 1.4306024758477451, 1.4336506868148573,
1464 1.4366988637532907, 1.4397470074012940, 1.4427951184983208, 1.4458431977850015,
1465 1.4488912460031191, 1.4519392638955804, 1.4549872522063900, 1.4580352116806217,
1466 1.4610831430643942, 1.4641310471048417, 1.4671789245500880, 1.4702267761492180,
1467 1.4732746026522530, 1.4763224048101216, 1.4793701833746320, 1.4824179390984470,
1468 1.4854656727350553, 1.4885133850387442, 1.4915610767645720, 1.4946087486683413,
1469 1.4976564015065725, 1.5007040360364747, 1.5037516530159180, 1.5067992532034090,
1470 1.5098468373580605, 1.5128944062395640, 1.5159419606081646, 1.5189895012246315,
1471 1.5220370288502318, 1.5250845442467005, 1.5281320481762162, 1.5311795414013716,
1472 1.5342270246851466, 1.5372744987908793, 1.5403219644822408, 1.5433694225232064,
1473 1.5464168736780266, 1.5494643187112020, 1.5525117583874541, 1.5555591934716988,
1474 1.5586066247290158, 1.5616540529246252, 1.5647014788238574, 1.5677489031921252,
1475 1.5707963267948966, 1.5707963267948966 };
1476 
1477 // conversion from geographic to geocentric latitude, in radians.
1478 
1479 static const double geocentric[] = {
1480 -1.5707963267948966,
1481 -1.5707963267948966, -1.5677076888331378, -1.5646190516577203, -1.5615304160549546,
1482 -1.5584417828110895, -1.5553531527122813, -1.5522645265445634, -1.5491759050938145,
1483 -1.5460872891457300, -1.5429986794857877, -1.5399100768992209, -1.5368214821709845,
1484 -1.5337328960857262, -1.5306443194277555, -1.5275557529810110, -1.5244671975290338,
1485 -1.5213786538549317, -1.5182901227413532, -1.5152016049704535, -1.5121131013238660,
1486 -1.5090246125826705, -1.5059361395273627, -1.5028476829378250, -1.4997592435932938,
1487 -1.4966708222723310, -1.4935824197527918, -1.4904940368117963, -1.4874056742256963,
1488 -1.4843173327700483, -1.4812290132195800, -1.4781407163481628, -1.4750524429287788,
1489 -1.4719641937334929, -1.4688759695334213, -1.4657877710987013, -1.4626995991984626,
1490 -1.4596114546007952, -1.4565233380727216, -1.4534352503801642, -1.4503471922879183,
1491 -1.4472591645596196, -1.4441711679577170, -1.4410832032434395, -1.4379952711767703,
1492 -1.4349073725164143, -1.4318195080197693, -1.4287316784428974, -1.4256438845404933,
1493 -1.4225561270658580, -1.4194684067708663, -1.4163807244059399, -1.4132930807200161,
1494 -1.4102054764605212, -1.4071179123733384, -1.4040303892027810, -1.4009429076915625,
1495 -1.3978554685807678, -1.3947680726098246, -1.3916807205164740, -1.3885934130367428,
1496 -1.3855061509049138, -1.3824189348534980, -1.3793317656132063, -1.3762446439129201,
1497 -1.3731575704796637, -1.3700705460385765, -1.3669835713128842, -1.3638966470238703,
1498 -1.3608097738908493, -1.3577229526311376, -1.3546361839600276, -1.3515494685907568,
1499 -1.3484628072344835, -1.3453762006002570, -1.3422896493949916, -1.3392031543234377,
1500 -1.3361167160881562, -1.3330303353894903, -1.3299440129255382, -1.3268577493921272,
1501 -1.3237715454827859, -1.3206854018887175, -1.3175993192987738, -1.3145132983994277,
1502 -1.3114273398747476, -1.3083414444063700, -1.3052556126734738, -1.3021698453527548,
1503 -1.2990841431183986, -1.2959985066420545, -1.2929129365928111, -1.2898274336371687,
1504 -1.2867419984390154, -1.2836566316595996, -1.2805713339575073, -1.2774861059886347,
1505 -1.2744009484061627, -1.2713158618605336, -1.2682308469994257, -1.2651459044677273,
1506 -1.2620610349075128, -1.2589762389580188, -1.2558915172556180, -1.2528068704337967,
1507 -1.2497222991231292, -1.2466378039512538, -1.2435533855428500, -1.2404690445196138,
1508 -1.2373847815002328, -1.2343005971003653, -1.2312164919326152, -1.2281324666065077,
1509 -1.2250485217284690, -1.2219646579017995, -1.2188808757266550, -1.2157971758000197,
1510 -1.2127135587156865, -1.2096300250642344, -1.2065465754330034, -1.2034632104060754,
1511 -1.2003799305642500, -1.1972967364850238, -1.1942136287425673, -1.1911306079077050,
1512 -1.1880476745478916, -1.1849648292271922, -1.1818820725062600, -1.1787994049423160,
1513 -1.1757168270891285, -1.1726343394969900, -1.1695519427126981, -1.1664696372795356,
1514 -1.1633874237372486, -1.1603053026220267, -1.1572232744664834, -1.1541413397996356,
1515 -1.1510594991468840, -1.1479777530299930, -1.1448961019670723, -1.1418145464725562,
1516 -1.1387330870571848, -1.1356517242279858, -1.1325704584882540, -1.1294892903375349,
1517 -1.1264082202716028, -1.1233272487824462, -1.1202463763582455, -1.1171656034833588,
1518 -1.1140849306383010, -1.1110043582997270, -1.1079238869404153, -1.1048435170292479,
1519 -1.1017632490311946, -1.0986830834072967, -1.0956030206146483, -1.0925230611063799,
1520 -1.0894432053316420, -1.0863634537355888, -1.0832838067593618, -1.0802042648400725,
1521 -1.0771248284107880, -1.0740454979005143, -1.0709662737341807, -1.0678871563326242,
1522 -1.0648081461125745, -1.0617292434866386, -1.0586504488632850, -1.0555717626468313,
1523 -1.0524931852374262, -1.0494147170310375, -1.0463363584194363, -1.0432581097901843,
1524 -1.0401799715266187, -1.0371019440078382, -1.0340240276086896, -1.0309462226997554,
1525 -1.0278685296473395, -1.0247909488134530, -1.0217134805558040, -1.0186361252277820,
1526 -1.0155588831784472, -1.0124817547525171, -1.0094047402903543, -1.0063278401279556,
1527 -1.0032510545969382, -1.0001743840245287, -0.9970978287335528, -0.9940213890424220,
1528 -0.9909450652651237, -0.9878688577112096, -0.9847927666857850, -0.9817167924894978,
1529 -0.9786409354185291, -0.9755651957645814, -0.9724895738148697, -0.9694140698521104,
1530 -0.9663386841545130, -0.9632634169957689, -0.9601882686450431, -0.9571132393669648,
1531 -0.9540383294216180, -0.9509635390645325, -0.9478888685466756, -0.9448143181144442,
1532 -0.9417398880096545, -0.9386655784695360, -0.9355913897267224, -0.9325173220092438,
1533 -0.9294433755405196, -0.9263695505393507, -0.9232958472199123, -0.9202222657917470,
1534 -0.9171488064597577, -0.9140754694242008, -0.9110022548806807, -0.9079291630201415,
1535 -0.9048561940288629, -0.9017833480884530, -0.8987106253758427, -0.8956380260632806,
1536 -0.8925655503183270, -0.8894931983038491, -0.8864209701780152, -0.8833488660942911,
1537 -0.8802768862014340, -0.8772050306434891, -0.8741332995597845, -0.8710616930849278,
1538 -0.8679902113488013, -0.8649188544765588, -0.8618476225886219, -0.8587765158006768,
1539 -0.8557055342236701, -0.8526346779638075, -0.8495639471225490, -0.8464933417966074,
1540 -0.8434228620779456, -0.8403525080537744, -0.8372822798065497, -0.8342121774139714,
1541 -0.8311422009489811, -0.8280723504797606, -0.8250026260697307, -0.8219330277775502,
1542 -0.8188635556571134, -0.8157942097575512, -0.8127249901232296, -0.8096558967937485,
1543 -0.8065869298039426, -0.8035180891838803, -0.8004493749588645, -0.7973807871494317,
1544 -0.7943123257713546, -0.7912439908356396, -0.7881757823485300, -0.7851077003115063,
1545 -0.7820397447212868, -0.7789719155698294, -0.7759042128443329, -0.7728366365272386,
1546 -0.7697691865962324, -0.7667018630242468, -0.7636346657794624, -0.7605675948253116,
1547 -0.7575006501204794, -0.7544338316189082, -0.7513671392697986, -0.7483005730176139,
1548 -0.7452341328020831, -0.7421678185582038, -0.7391016302162466, -0.7360355677017578,
1549 -0.7329696309355647, -0.7299038198337787, -0.7268381343078000, -0.7237725742643218,
1550 -0.7207071396053357, -0.7176418302281357, -0.7145766460253233, -0.7115115868848132,
1551 -0.7084466526898385, -0.7053818433189556, -0.7023171586460507, -0.6992525985403449,
1552 -0.6961881628664013, -0.6931238514841299, -0.6900596642487952, -0.6869956010110216,
1553 -0.6839316616168009, -0.6808678459074992, -0.6778041537198631, -0.6747405848860284,
1554 -0.6716771392335258, -0.6686138165852896, -0.6655506167596651, -0.6624875395704165,
1555 -0.6594245848267348, -0.6563617523332462, -0.6532990418900204, -0.6502364532925790,
1556 -0.6471739863319046, -0.6441116407944493, -0.6410494164621440, -0.6379873131124075,
1557 -0.6349253305181557, -0.6318634684478110, -0.6288017266653131, -0.6257401049301271,
1558 -0.6226786029972549, -0.6196172206172444, -0.6165559575362010, -0.6134948134957965,
1559 -0.6104337882332812, -0.6073728814814939, -0.6043120929688732, -0.6012514224194678,
1560 -0.5981908695529498, -0.5951304340846230, -0.5920701157254376, -0.5890099141819997,
1561 -0.5859498291565846, -0.5828898603471477, -0.5798300074473378, -0.5767702701465086,
1562 -0.5737106481297314, -0.5706511410778079, -0.5675917486672830, -0.5645324705704574,
1563 -0.5614733064554015, -0.5584142559859673, -0.5553553188218032, -0.5522964946183664,
1564 -0.5492377830269375, -0.5461791836946337, -0.5431206962644228, -0.5400623203751378,
1565 -0.5370040556614907, -0.5339459017540870, -0.5308878582794401, -0.5278299248599867,
1566 -0.5247721011141006, -0.5217143866561084, -0.5186567810963040, -0.5155992840409649,
1567 -0.5125418950923666, -0.5094846138487980, -0.5064274399045782, -0.5033703728500708,
1568 -0.5003134122717017, -0.4972565577519730, -0.4941998088694810, -0.4911431651989314,
1569 -0.4880866263111567, -0.4850301917731316, -0.4819738611479913, -0.4789176339950472,
1570 -0.4758615098698037, -0.4728054883239767, -0.4697495689055093, -0.4666937511585906,
1571 -0.4636380346236717, -0.4605824188374848, -0.4575269033330600, -0.4544714876397434,
1572 -0.4514161712832160, -0.4483609537855100, -0.4453058346650290, -0.4422508134365649,
1573 -0.4391958896113176, -0.4361410626969126, -0.4330863321974207, -0.4300316976133757,
1574 -0.4269771584417951, -0.4239227141761973, -0.4208683643066221, -0.4178141083196501,
1575 -0.4147599456984207, -0.4117058759226540, -0.4086518984686680, -0.4055980128094006,
1576 -0.4025442184144278, -0.3994905147499850, -0.3964369012789863, -0.3933833774610454,
1577 -0.3903299427524949, -0.3872765966064085, -0.3842233384726200, -0.3811701677977445,
1578 -0.3781170840251998, -0.3750640865952259, -0.3720111749449079, -0.3689583485081953,
1579 -0.3659056067159246, -0.3628529489958394, -0.3598003747726132, -0.3567478834678695,
1580 -0.3536954745002046, -0.3506431472852087, -0.3475909012354876, -0.3445387357606854,
1581 -0.3414866502675054, -0.3384346441597333, -0.3353827168382586, -0.3323308677010977,
1582 -0.3292790961434151, -0.3262274015575475, -0.3231757833330247, -0.3201242408565939,
1583 -0.3170727735122413, -0.3140213806812149, -0.3109700617420491, -0.3079188160705851,
1584 -0.3048676430399968, -0.3018165420208114, -0.2987655123809355, -0.2957145534856753,
1585 -0.2926636646977631, -0.2896128453773791, -0.2865620948821750, -0.2835114125672991,
1586 -0.2804607977854179, -0.2774102498867426, -0.2743597682190509, -0.2713093521277122,
1587 -0.2682590009557110, -0.2652087140436722, -0.2621584907298840, -0.2591083303503231,
1588 -0.2560582322386794, -0.2530081957263792, -0.2499582201426115, -0.2469083048143511,
1589 -0.2438584490663844, -0.2408086522213333, -0.2377589135996813, -0.2347092325197966,
1590 -0.2316596082979593, -0.2286100402483842, -0.2255605276832478, -0.2225110699127127,
1591 -0.2194616662449523, -0.2164123159861774, -0.2133630184406603, -0.2103137729107614,
1592 -0.2072645786969535, -0.2042154350978488, -0.2011663414102229, -0.1981172969290423,
1593 -0.1950683009474881, -0.1920193527569836, -0.1889704516472197, -0.1859215969061795,
1594 -0.1828727878201665, -0.1798240236738284, -0.1767753037501854, -0.1737266273306537,
1595 -0.1706779936950747, -0.1676294021217382, -0.1645808518874114, -0.1615323422673629,
1596 -0.1584838725353908, -0.1554354419638487, -0.1523870498236709, -0.1493386953844011,
1597 -0.1462903779142168, -0.1432420966799579, -0.1401938509471512, -0.1371456399800395,
1598 -0.1340974630416059, -0.1310493193936025, -0.1280012082965759, -0.1249531290098951,
1599 -0.1219050807917775, -0.1188570628993160, -0.1158090745885068, -0.1127611151142748,
1600 -0.1097131837305024, -0.1066652796900548, -0.1036174022448089, -0.1005695506456786,
1601 -0.0975217241426437, -0.0944739219847753, -0.0914261434202646, -0.0883783876964495,
1602 -0.0853306540598411, -0.0822829417561525, -0.0792352500303247, -0.0761875781265552,
1603 -0.0731399252883239, -0.0700922907584221, -0.0670446737789784, -0.0639970735914873,
1604 -0.0609494894368364, -0.0579019205553327, -0.0548543661867321, -0.0518068255702648,
1605 -0.0487592979446650, -0.0457117825481961, -0.0426642786186804, -0.0396167853935248,
1606 -0.0365693021097503, -0.0335218280040174, -0.0304743623126556, -0.0274269042716904,
1607 -0.0243794531168700, -0.0213320080836945, -0.0182845684074421, -0.0152371333231980,
1608 -0.0121897020658807, -0.0091422738702712, -0.0060948479710391, -0.0030474236027716,
1609 0.0000000000000000, 0.0030474236027716, 0.0060948479710391, 0.0091422738702712,
1610 0.0121897020658807, 0.0152371333231980, 0.0182845684074421, 0.0213320080836945,
1611 0.0243794531168700, 0.0274269042716904, 0.0304743623126556, 0.0335218280040174,
1612 0.0365693021097503, 0.0396167853935248, 0.0426642786186804, 0.0457117825481961,
1613 0.0487592979446650, 0.0518068255702648, 0.0548543661867321, 0.0579019205553327,
1614 0.0609494894368364, 0.0639970735914873, 0.0670446737789784, 0.0700922907584221,
1615 0.0731399252883239, 0.0761875781265552, 0.0792352500303247, 0.0822829417561525,
1616 0.0853306540598411, 0.0883783876964495, 0.0914261434202646, 0.0944739219847753,
1617 0.0975217241426437, 0.1005695506456786, 0.1036174022448089, 0.1066652796900548,
1618 0.1097131837305024, 0.1127611151142748, 0.1158090745885068, 0.1188570628993160,
1619 0.1219050807917775, 0.1249531290098951, 0.1280012082965759, 0.1310493193936025,
1620 0.1340974630416059, 0.1371456399800395, 0.1401938509471512, 0.1432420966799579,
1621 0.1462903779142168, 0.1493386953844011, 0.1523870498236709, 0.1554354419638487,
1622 0.1584838725353908, 0.1615323422673629, 0.1645808518874114, 0.1676294021217382,
1623 0.1706779936950747, 0.1737266273306537, 0.1767753037501854, 0.1798240236738284,
1624 0.1828727878201665, 0.1859215969061795, 0.1889704516472197, 0.1920193527569836,
1625 0.1950683009474881, 0.1981172969290423, 0.2011663414102229, 0.2042154350978488,
1626 0.2072645786969535, 0.2103137729107614, 0.2133630184406603, 0.2164123159861774,
1627 0.2194616662449523, 0.2225110699127127, 0.2255605276832478, 0.2286100402483842,
1628 0.2316596082979593, 0.2347092325197966, 0.2377589135996813, 0.2408086522213333,
1629 0.2438584490663844, 0.2469083048143511, 0.2499582201426115, 0.2530081957263792,
1630 0.2560582322386794, 0.2591083303503231, 0.2621584907298840, 0.2652087140436722,
1631 0.2682590009557110, 0.2713093521277122, 0.2743597682190509, 0.2774102498867426,
1632 0.2804607977854179, 0.2835114125672991, 0.2865620948821750, 0.2896128453773791,
1633 0.2926636646977631, 0.2957145534856753, 0.2987655123809355, 0.3018165420208114,
1634 0.3048676430399968, 0.3079188160705851, 0.3109700617420491, 0.3140213806812149,
1635 0.3170727735122413, 0.3201242408565939, 0.3231757833330247, 0.3262274015575475,
1636 0.3292790961434151, 0.3323308677010977, 0.3353827168382586, 0.3384346441597333,
1637 0.3414866502675054, 0.3445387357606854, 0.3475909012354876, 0.3506431472852087,
1638 0.3536954745002046, 0.3567478834678695, 0.3598003747726132, 0.3628529489958394,
1639 0.3659056067159246, 0.3689583485081953, 0.3720111749449079, 0.3750640865952259,
1640 0.3781170840251998, 0.3811701677977445, 0.3842233384726200, 0.3872765966064085,
1641 0.3903299427524949, 0.3933833774610454, 0.3964369012789863, 0.3994905147499850,
1642 0.4025442184144278, 0.4055980128094006, 0.4086518984686680, 0.4117058759226540,
1643 0.4147599456984207, 0.4178141083196501, 0.4208683643066221, 0.4239227141761973,
1644 0.4269771584417949, 0.4300316976133759, 0.4330863321974207, 0.4361410626969126,
1645 0.4391958896113174, 0.4422508134365651, 0.4453058346650290, 0.4483609537855100,
1646 0.4514161712832158, 0.4544714876397437, 0.4575269033330600, 0.4605824188374846,
1647 0.4636380346236719, 0.4666937511585906, 0.4697495689055093, 0.4728054883239765,
1648 0.4758615098698039, 0.4789176339950472, 0.4819738611479913, 0.4850301917731313,
1649 0.4880866263111567, 0.4911431651989314, 0.4941998088694807, 0.4972565577519732,
1650 0.5003134122717017, 0.5033703728500708, 0.5064274399045780, 0.5094846138487981,
1651 0.5125418950923666, 0.5155992840409649, 0.5186567810963038, 0.5217143866561084,
1652 0.5247721011141006, 0.5278299248599865, 0.5308878582794403, 0.5339459017540870,
1653 0.5370040556614907, 0.5400623203751377, 0.5431206962644230, 0.5461791836946337,
1654 0.5492377830269375, 0.5522964946183662, 0.5553553188218032, 0.5584142559859673,
1655 0.5614733064554014, 0.5645324705704576, 0.5675917486672830, 0.5706511410778078,
1656 0.5737106481297312, 0.5767702701465087, 0.5798300074473378, 0.5828898603471476,
1657 0.5859498291565843, 0.5890099141819998, 0.5920701157254376, 0.5951304340846229,
1658 0.5981908695529500, 0.6012514224194680, 0.6043120929688731, 0.6073728814814937,
1659 0.6104337882332813, 0.6134948134957965, 0.6165559575362007, 0.6196172206172447,
1660 0.6226786029972549, 0.6257401049301271, 0.6288017266653130, 0.6318634684478113,
1661 0.6349253305181557, 0.6379873131124074, 0.6410494164621438, 0.6441116407944494,
1662 0.6471739863319046, 0.6502364532925788, 0.6532990418900205, 0.6563617523332463,
1663 0.6594245848267348, 0.6624875395704165, 0.6655506167596653, 0.6686138165852896,
1664 0.6716771392335257, 0.6747405848860282, 0.6778041537198634, 0.6808678459074992,
1665 0.6839316616168007, 0.6869956010110218, 0.6900596642487954, 0.6931238514841299,
1666 0.6961881628664012, 0.6992525985403450, 0.7023171586460507, 0.7053818433189555,
1667 0.7084466526898383, 0.7115115868848134, 0.7145766460253233, 0.7176418302281355,
1668 0.7207071396053360, 0.7237725742643220, 0.7268381343078000, 0.7299038198337786,
1669 0.7329696309355649, 0.7360355677017578, 0.7391016302162465, 0.7421678185582037,
1670 0.7452341328020832, 0.7483005730176139, 0.7513671392697985, 0.7544338316189083,
1671 0.7575006501204795, 0.7605675948253116, 0.7636346657794623, 0.7667018630242469,
1672 0.7697691865962324, 0.7728366365272384, 0.7759042128443326, 0.7789719155698295,
1673 0.7820397447212868, 0.7851077003115062, 0.7881757823485303, 0.7912439908356397,
1674 0.7943123257713546, 0.7973807871494316, 0.8004493749588646, 0.8035180891838803,
1675 0.8065869298039425, 0.8096558967937484, 0.8127249901232297, 0.8157942097575512,
1676 0.8188635556571133, 0.8219330277775504, 0.8250026260697310, 0.8280723504797606,
1677 0.8311422009489808, 0.8342121774139715, 0.8372822798065497, 0.8403525080537743,
1678 0.8434228620779455, 0.8464933417966075, 0.8495639471225490, 0.8526346779638074,
1679 0.8557055342236705, 0.8587765158006768, 0.8618476225886219, 0.8649188544765586,
1680 0.8679902113488013, 0.8710616930849278, 0.8741332995597844, 0.8772050306434889,
1681 0.8802768862014341, 0.8833488660942911, 0.8864209701780152, 0.8894931983038492,
1682 0.8925655503183271, 0.8956380260632806, 0.8987106253758426, 0.9017833480884531,
1683 0.9048561940288629, 0.9079291630201414, 0.9110022548806804, 0.9140754694242010,
1684 0.9171488064597577, 0.9202222657917469, 0.9232958472199125, 0.9263695505393509,
1685 0.9294433755405196, 0.9325173220092435, 0.9355913897267225, 0.9386655784695360,
1686 0.9417398880096545, 0.9448143181144439, 0.9478888685466759, 0.9509635390645325,
1687 0.9540383294216178, 0.9571132393669650, 0.9601882686450431, 0.9632634169957687,
1688 0.9663386841545127, 0.9694140698521105, 0.9724895738148697, 0.9755651957645813,
1689 0.9786409354185294, 0.9817167924894980, 0.9847927666857850, 0.9878688577112096,
1690 0.9909450652651239, 0.9940213890424222, 0.9970978287335528, 1.0001743840245285,
1691 1.0032510545969382, 1.0063278401279556, 1.0094047402903543, 1.0124817547525173,
1692 1.0155588831784472, 1.0186361252277820, 1.0217134805558040, 1.0247909488134532,
1693 1.0278685296473395, 1.0309462226997554, 1.0340240276086894, 1.0371019440078382,
1694 1.0401799715266187, 1.0432581097901843, 1.0463363584194365, 1.0494147170310375,
1695 1.0524931852374262, 1.0555717626468313, 1.0586504488632853, 1.0617292434866386,
1696 1.0648081461125745, 1.0678871563326240, 1.0709662737341807, 1.0740454979005143,
1697 1.0771248284107880, 1.0802042648400727, 1.0832838067593618, 1.0863634537355888,
1698 1.0894432053316419, 1.0925230611063800, 1.0956030206146483, 1.0986830834072967,
1699 1.1017632490311944, 1.1048435170292479, 1.1079238869404153, 1.1110043582997270,
1700 1.1140849306383012, 1.1171656034833588, 1.1202463763582455, 1.1233272487824457,
1701 1.1264082202716030, 1.1294892903375349, 1.1325704584882540, 1.1356517242279855,
1702 1.1387330870571848, 1.1418145464725562, 1.1448961019670723, 1.1479777530299933,
1703 1.1510594991468840, 1.1541413397996356, 1.1572232744664834, 1.1603053026220270,
1704 1.1633874237372486, 1.1664696372795356, 1.1695519427126980, 1.1726343394969900,
1705 1.1757168270891285, 1.1787994049423160, 1.1818820725062600, 1.1849648292271922,
1706 1.1880476745478916, 1.1911306079077049, 1.1942136287425678, 1.1972967364850238,
1707 1.2003799305642500, 1.2034632104060752, 1.2065465754330034, 1.2096300250642344,
1708 1.2127135587156865, 1.2157971758000200, 1.2188808757266550, 1.2219646579017995,
1709 1.2250485217284688, 1.2281324666065080, 1.2312164919326152, 1.2343005971003653,
1710 1.2373847815002326, 1.2404690445196138, 1.2435533855428500, 1.2466378039512538,
1711 1.2497222991231294, 1.2528068704337967, 1.2558915172556180, 1.2589762389580186,
1712 1.2620610349075130, 1.2651459044677273, 1.2682308469994257, 1.2713158618605336,
1713 1.2744009484061627, 1.2774861059886347, 1.2805713339575073, 1.2836566316595999,
1714 1.2867419984390154, 1.2898274336371687, 1.2929129365928110, 1.2959985066420547,
1715 1.2990841431183986, 1.3021698453527548, 1.3052556126734736, 1.3083414444063700,
1716 1.3114273398747476, 1.3145132983994277, 1.3175993192987740, 1.3206854018887175,
1717 1.3237715454827859, 1.3268577493921270, 1.3299440129255384, 1.3330303353894903,
1718 1.3361167160881562, 1.3392031543234375, 1.3422896493949916, 1.3453762006002570,
1719 1.3484628072344833, 1.3515494685907570, 1.3546361839600276, 1.3577229526311376,
1720 1.3608097738908491, 1.3638966470238705, 1.3669835713128842, 1.3700705460385765,
1721 1.3731575704796635, 1.3762446439129201, 1.3793317656132063, 1.3824189348534979,
1722 1.3855061509049140, 1.3885934130367428, 1.3916807205164740, 1.3947680726098244,
1723 1.3978554685807680, 1.4009429076915625, 1.4040303892027810, 1.4071179123733386,
1724 1.4102054764605212, 1.4132930807200161, 1.4163807244059394, 1.4194684067708665,
1725 1.4225561270658580, 1.4256438845404933, 1.4287316784428970, 1.4318195080197695,
1726 1.4349073725164143, 1.4379952711767703, 1.4410832032434397, 1.4441711679577170,
1727 1.4472591645596196, 1.4503471922879179, 1.4534352503801644, 1.4565233380727216,
1728 1.4596114546007952, 1.4626995991984624, 1.4657877710987015, 1.4688759695334213,
1729 1.4719641937334929, 1.4750524429287790, 1.4781407163481628, 1.4812290132195800,
1730 1.4843173327700480, 1.4874056742256965, 1.4904940368117963, 1.4935824197527918,
1731 1.4966708222723308, 1.4997592435932940, 1.5028476829378250, 1.5059361395273627,
1732 1.5090246125826707, 1.5121131013238660, 1.5152016049704535, 1.5182901227413530,
1733 1.5213786538549319, 1.5244671975290338, 1.5275557529810110, 1.5306443194277553,
1734 1.5337328960857264, 1.5368214821709845, 1.5399100768992207, 1.5429986794857880,
1735 1.5460872891457300, 1.5491759050938145, 1.5522645265445632, 1.5553531527122815,
1736 1.5584417828110895, 1.5615304160549546, 1.5646190516577200, 1.5677076888331380,
1737 1.5707963267948966, 1.5707963267948966 };
1738 
1739 // the two arrays above have 1027 elements each. The latitude spacing of the points
1740 // is GEOTESS_DLAT = PI/1024 radians. The first value is at -PI/2-GEOTESS_DLAT and
1741 // the last value is at PI/2+GEOTESS_DLAT. The extra elements on the ends account
1742 // for the possibility of small roundoff errors.
1743 
1744 static const double GEOTESS_DLAT = PI/1024.;
1745 
1746 static const double GEOTESS_LAT0 = -PI/2. - GEOTESS_DLAT;
1747 
1748 // GEOTESS_E is ( 1 - eccentricity squared) for the WGS84 ellipsoid.
1749 static const double GEOTESS_E = 0.99330562000985870000;
1750 
1751 inline double GeoTessUtils::getGeographicLat(const double& lat)
1752 {
1753  // convert lat from geocentric to geographic latitude.
1754  if (approximateLatitudes)
1755  {
1756  double tmp = (lat - GEOTESS_LAT0) / GEOTESS_DLAT;
1757  int i = (int) tmp;
1758  return geographic[i] + (tmp - i) * (geographic[i + 1] - geographic[i]);
1759  }
1760  return atan(tan(lat) / GEOTESS_E);
1761 }
1762 
1763 inline double GeoTessUtils::getGeocentricLat(const double& lat)
1764 {
1765  // convert lat from geographic to geocentric latitude.
1766  if (approximateLatitudes)
1767  {
1768  double tmp = (lat - GEOTESS_LAT0) / GEOTESS_DLAT;
1769  int i = (int) tmp;
1770  return geocentric[i] + (tmp - i) * (geocentric[i + 1] - geocentric[i]);
1771  }
1772  return atan(tan(lat) * GEOTESS_E);
1773 }
1774 
1775 } // end namespace geotess
1776 
1777 #endif // GEOTESSUTILS_OBJECT_H
1778 
geotess::GeoTessUtils::circumCenter
static void circumCenter(const double *const v0, const double *const v1, const double *const v2, double *const vs)
Definition: GeoTessUtils.h:877
geotess::GeoTessUtils::getGreatCirclePoints
static double getGreatCirclePoints(double *ptA, double *ptB, const double &delta, const bool &onCenters, double **points, int &npoints)
geotess::GeoTessUtils::normalize
static double normalize(double *const u)
Definition: GeoTessUtils.h:703
geotess::GeoTessUtils::getGreatCirclePoint
static double * getGreatCirclePoint(double const *const *const greatCircle, double distance)
Definition: GeoTessUtils.h:1089
geotess::GeoTessUtils::cross
static void cross(const double *const v1, const double *const v2, double *const rslt)
Definition: GeoTessUtils.h:730
geotess
Definition: ArrayReuse.h:57
geotess::GeoTessUtils::length
static double length(const double *const u)
Definition: GeoTessUtils.h:422
geotess::GeoTessUtils::getEarthRadius
static double getEarthRadius(const double *const v)
Definition: GeoTessUtils.h:555
geotess::GeoTessUtils::angleDegrees
static double angleDegrees(const double *const v0, const double *const v1)
Definition: GeoTessUtils.h:517
geotess::GeoTessUtils::getVectorDegrees
static double * getVectorDegrees(const double &lat, const double &lon, double *v)
Definition: GeoTessUtils.h:627
geotess::GeoTessUtils
Collection of static functions to manipulate geographic information.
Definition: GeoTessUtils.h:72
geotess::GeoTessUtils::class_name
static string class_name()
Definition: GeoTessUtils.h:113
geotess::GeoTessUtils::getLonLatString
static string getLonLatString(const double *const v)
geotess::GeoTessUtils::dot
static double dot(const double *const v0, const double *const v1)
Definition: GeoTessUtils.h:136
geotess::GeoTessUtils::vectorTripleProduct
static bool vectorTripleProduct(const double *const v0, const double *const v1, const double *const v2, double *const rslt)
Definition: GeoTessUtils.h:824
geotess::GeoTessUtils::getVersion
static string getVersion()
Definition: GeoTessUtils.h:127
geotess::GeoTessUtils::getLon
static double getLon(const double *const v)
Definition: GeoTessUtils.h:574
geotess::GeoTessUtils::circumCenterPlus
static double * circumCenterPlus(const double *const v0, const double *const v1, const double *const v2)
Definition: GeoTessUtils.h:931
geotess::GeoTessUtils::getLonDegrees
static double getLonDegrees(const double *const v)
Definition: GeoTessUtils.h:597
geotess::GeoTessUtils::azimuthDegrees
static double azimuthDegrees(const double *const v1, const double *const v2, double errorValue)
geotess::GeoTessUtils::rotate
static void rotate(const double *const x, const double *const p, double a, double *const z)
geotess::GeoTessUtils::getDistance3D
static double getDistance3D(const double *const v0, double r0, const double *const v1, double r1)
Definition: GeoTessUtils.h:539
geotess::GeoTessUtils::writeString
static void writeString(ofstream &ofs, const string &s)
Definition: GeoTessUtils.h:486
geotess::GeoTessUtils::readString
static void readString(string &s, ifstream &ifs)
Definition: GeoTessUtils.h:471
geotess::GeoTessUtils::getVectorDegrees
static double * getVectorDegrees(const double &lat, const double &lon)
Definition: GeoTessUtils.h:612
geotess::GeoTessUtils::moveNorth
static bool moveNorth(const double *const x, double distance, double *const z)
Definition: GeoTessUtils.h:1031
geotess::GeoTessUtils::getGreatCirclePoints
static int getGreatCirclePoints(double *ptA, double *ptB, const double &delta, const bool &onCenters)
geotess::GeoTessUtils::getLatDegrees
static double getLatDegrees(const double *const v)
Definition: GeoTessUtils.h:584
geotess::GeoTessUtils::azimuth
static double azimuth(const double *const v1, const double *const v2, double errorValue)
geotess::GeoTessUtils::angle
static double angle(const double *const v0, const double *const v1)
Definition: GeoTessUtils.h:499
geotess::GeoTessUtils::moveDistAz
static bool moveDistAz(const double *const w, double distance, double azimuth, double *const u)
Definition: GeoTessUtils.h:979
geotess::GeoTessUtils::class_size
virtual int class_size() const
Definition: GeoTessUtils.h:120
geotess::GeoTessUtils::center
static double * center(double const *const *const v, int n)
Definition: GeoTessUtils.h:1175
geotess::GeoTessUtils::approximateLatitudes
static bool approximateLatitudes
Definition: GeoTessUtils.h:97
geotess::GeoTessUtils::getGreatCircle
static void getGreatCircle(const double *const v0, const double *const v1, double **const gc)
GEOTESS_EXP_IMP
#define GEOTESS_EXP_IMP
Definition: CPPGlobals.h:73
geotess::GeoTessUtils::getGreatCircle
static void getGreatCircle(const double *const v, double azimuth, double **const gc)
geotess::GeoTessUtils::getGreatCircle
static double ** getGreatCircle(const double *const v0, const double *const v1)
geotess::GeoTessUtils::getGreatCircle
static double ** getGreatCircle(const double *const v, double azimuth)
geotess::GeoTessUtils::circumCenterPlus
static void circumCenterPlus(const double *const v0, const double *const v1, const double *const v2, double *const vs)
Definition: GeoTessUtils.h:902
geotess::GeoTessUtils::getVector
static double * getVector(const double &lat, const double &lon)
Definition: GeoTessUtils.h:643
geotess::GeoTessUtils::isPole
static bool isPole(const double *const u)
Definition: GeoTessUtils.h:1054
geotess::GeoTessUtils::GeoTessUtils
GeoTessUtils()
Definition: GeoTessUtils.h:102
geotess::GeoTessUtils::parallel
static bool parallel(const double *const u, const double *const v)
Definition: GeoTessUtils.h:1068
geotess::GeoTessUtils::normalizeFast
static void normalizeFast(double *const u)
Definition: GeoTessUtils.h:687
geotess::GeoTessUtils::crossNorth
static double crossNorth(const double *const u, double *const w)
Definition: GeoTessUtils.h:792
geotess::GeoTessUtils::getGreatCirclePoints
static double getGreatCirclePoints(double *ptA, double *ptB, const int &npoints, const bool &onCenters, double **points)
geotess::GeoTessUtils::~GeoTessUtils
virtual ~GeoTessUtils()
Definition: GeoTessUtils.h:107
geotess::GeoTessUtils::crossNormal
static double * crossNormal(const double *const u, const double *const v)
Definition: GeoTessUtils.h:748
geotess::GeoTessUtils::getTriangleArea
static double getTriangleArea(const double *const v0, const double *const v1, const double *const v2, double *work1, double *work2, double *work3)
Definition: GeoTessUtils.h:1150
geotess::GeoTessUtils::crossNormal
static double crossNormal(const double *const u, const double *const v, double *const w)
Definition: GeoTessUtils.h:771
geotess::GeoTessUtils::move
static void move(const double *const w, const double *const vtp, double a, double *const u)
Definition: GeoTessUtils.h:1007
geotess::GeoTessUtils::getLat
static double getLat(const double *const v)
Definition: GeoTessUtils.h:565
geotess::GeoTessUtils::getTransform
static void getTransform(const double *const u, const double *const v, double **const t)
geotess::GeoTessUtils::transform
static void transform(const double *x, double const *const *const t, double *const g)
Definition: GeoTessUtils.h:458
geotess::GeoTessUtils::center
static void center(vector< double * > v, double *x)
Definition: GeoTessUtils.h:1199
geotess::GeoTessUtils::getGreatCirclePoint
static void getGreatCirclePoint(double const *const *const greatCircle, double distance, double *const v)
Definition: GeoTessUtils.h:1114
geotess::GeoTessUtils::circumCenterPlus
static void circumCenterPlus(double const *const *const t, double *const vs)
Definition: GeoTessUtils.h:961
CPPUtils.h
geotess::GeoTessUtils::getVector
static double * getVector(const double &lat, const double &lon, double *v)
Definition: GeoTessUtils.h:661
geotess::GeoTessUtils::vectorTripleProductNorthPole
static bool vectorTripleProductNorthPole(const double *const u, double *const w)
Definition: GeoTessUtils.h:858
geotess::GeoTessUtils::getTriangleArea
static double getTriangleArea(const double *const v0, const double *const v1, const double *const v2)
Definition: GeoTessUtils.h:1131
geotess::GeoTessUtils::scalarTripleProduct
static double scalarTripleProduct(const double *const v0, const double *const v1, const double *const v2)
Definition: GeoTessUtils.h:148
geotess::GeoTessUtils::getLatLonString
static string getLatLonString(const double *const v)