2 WARNING - Do not remove this header.
4 This code is a templated version of the 'magic-software' spherical
5 interpolation code by Dave Eberly. The original (un-hacked) code can be
6 obtained from here: http://www.magic-software.com/gr_appr.htm
7 This code is derived from linintp2.h/cpp and sphrintp.h/cpp.
9 Dave Eberly says that the conditions for use are:
11 * You may distribute the original source code to others at no charge.
13 * You may modify the original source code and distribute it to others at
14 no charge. The modified code must be documented to indicate that it is
15 not part of the original package.
17 * You may use this code for non-commercial purposes. You may also
18 incorporate this code into commercial packages. However, you may not
19 sell any of your source code which contains my original and/or modified
20 source code. In such a case, you need to factor out my code and freely
23 * The original code comes with absolutely no warranty and no guarantee is
24 made that the code is bug-free.
26 This does not seem incompatible with GPL - so this modified version
27 is hereby placed under GPL along with the rest of FlightGear.
39 class SphereInterpolate
42 SphereInterpolate (int n, const double* x, const double* y,
43 const double* z, const T* f);
44 SphereInterpolate (int n, const sgVec2* p, const T* f);
46 ~SphereInterpolate ();
48 void GetSphericalCoords (const double x, const double y, const double z,
49 double& thetaAngle, double& phiAngle) const;
51 int Evaluate (const double x, const double y, const double z, T& f) const;
52 int Evaluate (const double thetaAngle, const double phiAngle, T& f) const;
54 T Evaluate(const sgVec2& p) const
57 Evaluate(p[1], p[0], retval);
61 T Evaluate(const sgVec3& p) const
64 Evaluate(p[1], p[0], retval);
73 mgcLinInterp2D<T>* pInterp;
76 #include "sphrintp.inl"