class optical_constant


The class that handles the storage of optical constants, n and k, and its conversion to dielectric constants. Functions that require this information can be prototyped with either optical_constant or dielectric_constant arguments, and the compiler will perform the conversion when necessary. Use of the classes optical_constant and dielectric_constant avoids one accidentally confusing the two when passing values to functions. To store information about the wavelength dependence of the optical constants, use the class dielectric_function.

Include file:

#include "optconst.h"

Source code:

optconst.h

See also:

SCATMECH Home,   Conventions,   dielectric_constant,   dielectric_function

M. Born and E. Wolf, Principles of Optics, (Pergamon, Oxford, 1980).

Definition of public elements:

class optical_constant {
    double n;
    double k;
    optical_constant();
    optical_constant(complex<double> x);
    optical_constant(double x, double y=0.);
    optical_constant(const dielectric_constant& e);
    operator complex<double>() const;
    friend istream& operator>>(istream& is, optical_constant& nn);
    friend ostream& operator<<(ostream& os, const optical_constant& nn);
};

double n
double k

The two optical constants. The convention in SCATMECH is k>0. (See Conventions.)

Top of Page

optical_constant()

Default constructor that initializes the optical constants n=1 and k=0.

Top of Page

optical_constant(complex<double> x)

Constructor that initializes the complex optical constant to be x.

Example:

optical_constant silicon(complex<double>(3.882,0.019));

Top of Page

optical_constant(double x, double y=0.)

Constructor that uses a pair of real numbers as n and k.

Example:

optical_constant glass(1.5,0);
optical_constant glass(1.5);  // Same thing.

Top of Page

optical_constant(const dielectric_constant& e)

Constructor that converts a dielectric_constant to an optical_constant.

Example:

dielectric_constant silicon(16.,0.);
optical_constant n(silicon);

Top of Page

operator complex<double>() const

Conversion from optical_constant to complex<double>. This operator is often useful if numerical calculations need to be carried out with a complex optical constant.

Example:

optical_constant oc;
complex<double> q=sqrt((complex<double>)oc*(complex<double>)oc-sin(theta)*sin(theta));

Top of Page

friend istream& operator>>(istream& is,optical_constant& nn)
friend ostream& operator<<(ostream& os,const optical_constant& nn)

Operators to input and output an optical_constant to or from an iostream.

Example:

optical_constant n;
cout << "Enter an optical constant:";
cin >> n;
cout << "You entered: " << n << endl;

Top of Page


For More Information

SCATMECH Technical Information and Questions
Optical Technology Division (OTD) Home Page
OTD Technical Inquiries
OTD Website Comments

Current SCATMECH version: 6.00 (February 2008)
This page first online: Version 1.00 (March 2000)
This page last modified: Version 6.00 (February 2008)