30 #ifndef GOBY_UTIL_SEAWATER_PRESSURE_H
31 #define GOBY_UTIL_SEAWATER_PRESSURE_H
52 template <
typename DepthUnit = boost::units::si::length,
53 typename LatitudeUnit = boost::units::degree::plane_angle>
54 inline boost::units::quantity<decltype(boost::units::si::deci *
bar)>
55 pressure(boost::units::quantity<DepthUnit>
depth, boost::units::quantity<LatitudeUnit> latitude)
75 double DPTH = quantity<boost::units::si::length>(
depth).value();
76 double XLAT = quantity<degree::plane_angle>(latitude).value();
78 const double pi = goby::util::pi<double>;
80 double PLAT = std::abs(XLAT *
pi / 180);
81 double D = std::sin(PLAT);
82 double C1 = (5.92E-3) + (D * D) * (5.25E-3);
83 double P80 = ((1 - C1) - sqrt(((1 - C1) * (1 - C1)) - ((8.84E-6) * DPTH))) / 4.42E-6;
85 return P80 * boost::units::si::deci *
bar;