3 #include "core/cl/scene_structs.h" 25 constexpr T absorption_to_energy_reflectance(T t) {
30 T absorption_to_pressure_reflectance(T t) {
32 return sqrt(absorption_to_energy_reflectance(t));
36 constexpr T pressure_reflectance_to_average_wall_impedance(T t) {
37 return (1 + t) / (1 - t);
41 constexpr T average_wall_impedance_to_pressure_reflectance(T t,
43 if (cos_angle < 0 || 1 < cos_angle) {
44 throw std::runtime_error{
"Cos angle is outside valid range."};
46 const T tmp = t * cos_angle;
47 const T ret = (tmp - 1) / (tmp + 1);
57 template <
typename T,
typename U>
58 constexpr T scattered_pressure(T total_reflected, U scattering) {
59 return total_reflected * scattering;
62 template <
typename T,
typename U>
63 constexpr T specular_pressure(T total_reflected, U scattering) {
64 return total_reflected * (1 - scattering);
Definition: capsule_base.h:9