aboutsummaryrefslogtreecommitdiff
path: root/optics.c
diff options
context:
space:
mode:
Diffstat (limited to 'optics.c')
-rw-r--r--optics.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/optics.c b/optics.c
index afcdd5e..23e043d 100644
--- a/optics.c
+++ b/optics.c
@@ -1,6 +1,7 @@
#include <math.h>
#include "optics.h"
+/* From Table 4 in the paper. */
static double A0 = 0.243905091;
static double A1 = 9.53518094e-3;
static double A2 = -3.64358110e-3;
@@ -14,11 +15,13 @@ static double IR = 5.432937;
double get_index(double p, double wavelength, double T)
{
- /* Returns the index of pure water for a given density, wavelength, and
- * temperature. The density should be in units of kg/m^3, the wavelength in
- * nm, and the temperature in Celsius. */
- /* normalize the density, temperature, and pressure */
- p = p/1000.0;
+ /* Returns the index of refraction of pure water for a given density,
+ * wavelength, and temperature. The density should be in units of g/cm^3,
+ * the wavelength in nm, and the temperature in Celsius.
+ *
+ * See "Refractive Index of Water and Steam as a function of Wavelength,
+ * Temperature, and Density" by Schiebener et al. 1990. */
+ /* normalize the temperature and pressure */
wavelength = wavelength/589.0;
T = (T+273.15)/273.15;