summaryrefslogtreecommitdiffstats
path: root/include/drag_model.h
blob: 8c18bedf8acc884886554e291921c5dd8142ef6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef DRAG_MODEL_H
#define DRAG_MODEL_H

#include <stddef.h>

typedef enum {
	DRAG_G1,
	DRAG_G2,
	DRAG_G5,
	DRAG_G6,
	DRAG_G7,
	DRAG_G8,
	DRAG_COUNT
} DragFunction;

typedef struct {
	size_t num_points;
	const double *mach;
	const double *cd;
} DragModel;

extern const DragModel drag_models[DRAG_COUNT];

static inline const DragModel* get_drag_model(DragFunction func) {
	if (func >= DRAG_COUNT) return NULL;
	return &drag_models[func];
}

#endif