]> git.mxchange.org Git - simgear.git/blob - Math/interpolater.hxx
Modified Files:
[simgear.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
28 #ifndef _INTERPOLATER_H
29 #define _INTERPOLATER_H
30
31
32 #ifndef __cplusplus                                                          
33 # error This library requires C++
34 #endif                                   
35
36
37 #define MAX_TABLE_SIZE 32
38
39
40 class fgINTERPTABLE {
41     int size;
42     double table[MAX_TABLE_SIZE][2];
43
44 public:
45
46     // Constructor -- loads the interpolation table from the specified
47     // file
48     fgINTERPTABLE( char *file );
49
50     // Given an x value, linearly interpolate the y value from the table
51     double interpolate(double x);
52
53     // Destructor
54     ~fgINTERPTABLE( void );
55 };
56
57
58 #endif /* _INTERPOLATER_H */
59
60
61 /* $Log$
62 /* Revision 1.1  1998/04/21 19:14:23  curt
63 /* Modified Files:
64 /*     Makefile.am Makefile.in
65 /* Added Files:
66 /*     interpolater.cxx interpolater.hxx
67 /*
68  */