aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/units.h
blob: 1557bc0558713ab465cd3288ecc7898f204e5903 (plain) (blame)
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
30
/* SPDX-License-Identifier: MIT-0 */

#ifndef UNITS_H
#define UNITS_H

#define UNITS_DEFAULT METRIC
#define SURFACE_PRESSURE_DEFAULT 1.01325

/* types */
enum UNITS {
    METRIC,
    IMPERIAL,
};

/* global variables */
extern enum UNITS UNITS;
extern double SURFACE_PRESSURE;

/* functions */
double bar_to_msw(double bar);
double msw_to_bar(double msw);
double bar_to_fsw(double bar);
double fsw_to_bar(double msw);
double msw_or_fsw(double msw, double fsw);
double xsw_to_bar(double xsw);
double bar_to_xsw(double bar);
double abs_depth(double gd);
double gauge_depth(double ad);

#endif /* end of include guard: UNITS_H */