6#include <Common/assertion.h>
26 PH_ASSERT_GE(temperatureK, 0);
27 PH_ASSERT_GT(wavelengthNM, 0);
36 using namespace constant;
38 const double nume = 2.0 * h_Planck<double> * c_light<double> * c_light<double>;
40 const double lambda = wavelengthNM * 1e-9;
41 const double lambda5 = (lambda * lambda) * (lambda * lambda) * lambda;
42 const double exp = (h_Planck<double> * c_light<double>) / (lambda * k_Boltzmann<double> * temperatureK);
43 const double deno = lambda5 * (std::exp(exp) - 1.0);
45 return static_cast<T
>(nume / deno);
62 const std::size_t numCurvePoints,
63 std::vector<T>*
const out_lambdaValues =
nullptr)
65 PH_ASSERT_GE(numCurvePoints, 2);
66 PH_ASSERT_GT(lambdaMaxNM, lambdaMinNM);
70 std::vector<T> radianceCurve(numCurvePoints, 0);
71 for(std::size_t i = 0; i < numCurvePoints; ++i)
78 *out_lambdaValues = std::move(lambdaValues);
Miscellaneous math utilities.
Math functions and utilities.
Definition TransformInfo.h:10
std::vector< T > black_body_spectral_radiance_curve(const T temperatureK, const T lambdaMinNM, const T lambdaMaxNM, const std::size_t numCurvePoints, std::vector< T > *const out_lambdaValues=nullptr)
Get a curve for Black-body radiation. Note that this function is not returning radiance but spectral ...
Definition black_body.h:58
std::vector< T > evenly_spaced_vector(const T min, const T max, const std::size_t n)
Definition math.h:570
T black_body_spectral_radiance_at(const T temperatureK, const T wavelengthNM)
Get Black-body spectral radiance at specific temperature and wavelength. Note that this function is n...
Definition black_body.h:24