WXP C++ Library Version 6.74.9
Loading...
Searching...
No Matches
Calc.h
1#ifndef _WINC_CALC
2#define _WINC_CALC
3
4#include <WXP/Const.h>
5#include <WXP/LclData.h>
6
7namespace WXP {
8 class Calc {
9 public:
10 static float windSpd( float u, float v );
11 static float windDir( float u, float v );
12 static float windU( float dir, float spd );
13 static float windV( float dir, float spd );
14 static float vaporPres( float t );
15 static float windChillTemp( float temp, float ws );
16 static float windChillTemp2( float temp, float ws );
17 static float windChill( float temp, float ws );
18 static float heatIndex( float temp, float dewp );
19 static float humiture( float temp, float dewp );
20 static float tempHumIndex( float temp, float dewp );
21 static float sfcPrAlt( float alt, float el );
22 static float presAlt( float pres );
23 static float mixRatio( float temp, float pr );
24 static float specHum( float temp, float pr );
25 static float dewTemp( float temp, float rh );
26 static float potTemp( float temp, float pr );
27 static float virtTemp( float temp, float dewp, float pr );
28 static float virtPotTemp( float temp, float dewp, float pr );
29 static float tempOnSatAd( float pot, float pr );
30 static float tempOnDryAd( float pot, float pr );
31 static float thetaeOnSatAd( float temp, float pr );
32 static float tempVaporPres( float e );
33 static float tempOnMixRat( float w, float pr );
34 static float relHum( float t, float td );
35 static float convTemp( float wbar, float pc, float pr );
36 static float lclPres( float ts, float tds, float ps);
37 static float lclTemp( float ts, float ps, float plcl);
38 static int lcl( float ts, float tds, float ps, LclData &ldat );
39 static LclData lcl( float ts, float tds, float ps);
40 static float equivPotTemp( float temp, float dewp, float pr );
41 static float wetBulb( float temp, float dewp, float pr );
42 static float wetBulbPotTemp( float temp, float dewp, float pr );
43 static float stdAtmsPres( float height );
44 static float interpLinear( float x,float x1,float x2,float y1,float y2 );
45 static float interpTemp( float t1, float t2, float p1, float p2, float pr);
46 static float earthDist( float lat1, float lon1, float lat2, float lon2);
47 static float earthAngle( float lat1, float lon1, float lat2, float lon2);
48 static float dist( float x1, float y1, float x2, float y2);
49
51 static inline float Min( float x, float y ){
52 return x < y ? x : y;}
54 static inline float Max( float x, float y ){
55 return x > y ? x : y;}
56
58 static inline float ADD( float x, float y ){
59 return x != Const::MISS && y != Const::MISS ? x+y : Const::MISS;}
61 static inline float DIF( float x, float y ){
62 return x != Const::MISS && y != Const::MISS ? x-y : Const::MISS;}
64 static inline float MUL( float x, float y ){
65 return x != Const::MISS && y != Const::MISS ? x*y : Const::MISS;}
67 static inline float DIV( float x, float y ){
68 return x != Const::MISS && y != Const::MISS ? x/y : Const::MISS;}
69 };
70}
71#endif
This class contains functions for doing simple meteorological computations.
Definition Calc.h:8
static float tempOnMixRat(float w, float pr)
Definition Calc.cc:463
static float sfcPrAlt(float alt, float el)
Definition Calc.cc:217
static float heatIndex(float temp, float dewp)
Definition Calc.cc:147
static float windV(float dir, float spd)
Definition Calc.cc:58
static float Min(float x, float y)
Definition Calc.h:51
static float wetBulb(float temp, float dewp, float pr)
Definition Calc.cc:616
static float earthDist(float lat1, float lon1, float lat2, float lon2)
Definition Calc.cc:737
static float lclPres(float ts, float tds, float ps)
Definition Calc.cc:568
static float DIF(float x, float y)
Definition Calc.h:61
static float windSpd(float u, float v)
Definition Calc.cc:24
static float specHum(float temp, float pr)
Definition Calc.cc:275
static float Max(float x, float y)
Definition Calc.h:54
static float vaporPres(float t)
Definition Calc.cc:67
static float DIV(float x, float y)
Definition Calc.h:67
static float tempOnDryAd(float pot, float pr)
Definition Calc.cc:412
static float equivPotTemp(float temp, float dewp, float pr)
Definition Calc.cc:594
static float tempVaporPres(float e)
Definition Calc.cc:444
static float tempHumIndex(float temp, float dewp)
Definition Calc.cc:202
static float windU(float dir, float spd)
Definition Calc.cc:48
static float windChillTemp(float temp, float ws)
Definition Calc.cc:88
static float mixRatio(float temp, float pr)
Definition Calc.cc:251
static float humiture(float temp, float dewp)
Definition Calc.cc:184
static int lcl(float ts, float tds, float ps, LclData &ldat)
Definition Calc.cc:524
static float dist(float x1, float y1, float x2, float y2)
Definition Calc.cc:750
static float tempOnSatAd(float pot, float pr)
Definition Calc.cc:380
static float wetBulbPotTemp(float temp, float dewp, float pr)
Definition Calc.cc:636
static float ADD(float x, float y)
Definition Calc.h:58
static float virtPotTemp(float temp, float dewp, float pr)
Definition Calc.cc:361
static float earthAngle(float lat1, float lon1, float lat2, float lon2)
Definition Calc.cc:711
static float windChillTemp2(float temp, float ws)
Definition Calc.cc:107
static float dewTemp(float temp, float rh)
Definition Calc.cc:299
static float interpTemp(float t1, float t2, float p1, float p2, float pr)
Definition Calc.cc:687
static float windChill(float temp, float ws)
Definition Calc.cc:125
static float windDir(float u, float v)
Definition Calc.cc:34
static float interpLinear(float x, float x1, float x2, float y1, float y2)
Definition Calc.cc:673
static float lclTemp(float ts, float ps, float plcl)
Definition Calc.cc:581
static float relHum(float t, float td)
Definition Calc.cc:483
static float potTemp(float temp, float pr)
Definition Calc.cc:321
static float thetaeOnSatAd(float temp, float pr)
Definition Calc.cc:427
static float presAlt(float pres)
Definition Calc.cc:232
static float virtTemp(float temp, float dewp, float pr)
Definition Calc.cc:339
static float convTemp(float wbar, float pc, float pr)
Definition Calc.cc:503
static float MUL(float x, float y)
Definition Calc.h:64
static const int MISS
Definition Const.h:7
All WXP classes fall under the WXP namespace.
Definition Angle.h:4
This struct stores output of LCL calculation.
Definition LclData.h:5