My float map library

fmap.h

Committer:
est2fe
Date:
2010-12-09
Revision:
0:1e9eea14a6b9

File content as of revision 0:1e9eea14a6b9:

#ifndef __map_h__
#define __map_h__

typedef struct fmap_s // Map mit variabler Stuetzstellenanzahl 
  { 
      /* 
        Struktur: 
        Anzahl Stuetzstellen > = 2 
        float *Kennlinie; // wobei immer im Wechsel x1, y1, x2 y2, x3, y3, ... kommt 
      */ 
    int groesse; 
    float *kl;   // Feld mit floats (mind. 2 Stück) 
  } fmap_s; 

//#define  NAN -10000 

fmap_s *new_map       (int groesse); 

int   find_x_Bereich (float x, fmap_s *map); 
float calc_fix_map   (float x, int i, fmap_s *map); 
float calc_var_map   (float x, fmap_s *map);
int   set_map_val    (fmap_s *m, int index, float x, float y); 

void  free_map       (fmap_s *m); 

#endif