diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2025-02-28 18:41:07 -0500 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2025-02-28 18:41:07 -0500 |
| commit | a7c99e7bed015db546969d5f9a87fc6ffd1f2ea8 (patch) | |
| tree | 82b11719cd67149d46e78e243d5b04634ae560d5 /unit.c | |
| parent | 5af0508c969105060871a8be0c9885c8c331fa98 (diff) | |
| download | volute-a7c99e7bed015db546969d5f9a87fc6ffd1f2ea8.zip | |
volume flow rate conversion functions
Diffstat (limited to 'unit.c')
| -rw-r--r-- | unit.c | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -12,6 +12,12 @@ /* Metres per inch. */ #define M_PER_IN 0.0254 +/* Metres per foot. */ +#define M_PER_FT 0.3048 + +/* Seconds per minute. */ +#define SEC_PER_MIN 60.0 + AngularSpeed rad_per_sec(double x) { @@ -133,3 +139,34 @@ double as_cubic_inch(double x) { return x / 1.6387064e-5; } + + +VolumeFlowRate +cubic_metre_per_sec(double x) { + return x; +} + +VolumeFlowRate +cubic_metre_per_min(double x) { + return x / SEC_PER_MIN; +} + +VolumeFlowRate +cubic_foot_per_min(double x) { + return x * pow(M_PER_FT, 3) / SEC_PER_MIN; +} + +double +as_cubic_metre_per_sec(VolumeFlowRate x) { + return x; +} + +double +as_cubic_metre_per_min(VolumeFlowRate x) { + return x * SEC_PER_MIN; +} + +double +as_cubic_foot_per_min(VolumeFlowRate x) { + return x * SEC_PER_MIN / pow(M_PER_FT, 3); +} |