My float map library
Diff: fmap.h
- Revision:
- 0:1e9eea14a6b9
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fmap.h Thu Dec 09 14:19:12 2010 +0000 @@ -0,0 +1,26 @@ +#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