]> git.mxchange.org Git - flightgear.git/blob - Math/interpolater.hxx
Converted to new logstream debugging facility. This allows release
[flightgear.git] / Math / interpolater.hxx
1 //
2 // interpolater.hxx -- routines to handle linear interpolation from a table of
3 //                     x,y   The table must be sorted by "x" in ascending order
4 //
5 // Written by Curtis Olson, started April 1998.
6 //
7 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //
23 // $Id$
24 // (Log is kept at end of this file)
25
26
27 #ifndef _INTERPOLATER_H
28 #define _INTERPOLATER_H
29
30
31 #ifndef __cplusplus                                                          
32 # error This library requires C++
33 #endif                                   
34
35
36 #include <string>
37
38
39 #define MAX_TABLE_SIZE 32
40
41
42 class fgINTERPTABLE {
43     int size;
44     double table[MAX_TABLE_SIZE][2];
45
46 public:
47
48     // Constructor -- loads the interpolation table from the specified
49     // file
50     fgINTERPTABLE( const string& file );
51
52     // Given an x value, linearly interpolate the y value from the table
53     double interpolate(double x);
54
55     // Destructor
56     ~fgINTERPTABLE( void );
57 };
58
59
60 #endif // _INTERPOLATER_H
61
62
63 // $Log$
64 // Revision 1.3  1998/11/06 21:17:28  curt
65 // Converted to new logstream debugging facility.  This allows release
66 // builds with no messages at all (and no performance impact) by using
67 // the -DFG_NDEBUG flag.
68 //
69 // Revision 1.2  1998/04/22 13:18:10  curt
70 // C++ - ified comments.  Make file open errors fatal.
71 //
72 // Revision 1.1  1998/04/21 19:14:23  curt
73 // Modified Files:
74 //     Makefile.am Makefile.in
75 // Added Files:
76 //     interpolater.cxx interpolater.hxx
77 //