class thinfilmstack{ complex theta_incident_from_previous_film; complex n_previous_film; complex Mperp[3][3],Mpara[3][3]; //TN6 complex current_theta; double lambda; public: complex p,q; complexp1,q1; complexpl,ql; thinfilmstack::thinfilmstack(complexn1,complexn3, complex theta_in, double input_lambda, double data_array[],int numfilms); void AddLayer(double thickness, complex n); void MatMult( complexA[][3], complexB[][3], complexC[][3]); complex r_perp(void){ return ( ((Mperp[1][1]+Mperp[1][2]*pl)*p1-(Mperp[2][1]+Mperp[2][2]*pl)) / ((Mperp[1][1]+Mperp[1][2]*pl)*p1+(Mperp[2][1]+Mperp[2][2]*pl)) ); }; complex r_para(void){ return ( ((Mpara[1][1]+Mpara[1][2]*ql)*q1-(Mpara[2][1]+Mpara[2][2]*ql)) / ((Mpara[1][1]+Mpara[1][2]*ql)*q1+(Mpara[2][1]+Mpara[2][2]*ql)) ); }; complex t_perp(void){ return ( 2*p1 / ((Mperp[1][1]+Mperp[1][2]*pl)*p1+(Mperp[2][1]+Mperp[2][2]*pl)) ); }; complex t_para(void){ return ( 2*q1 / ((Mpara[1][1]+Mpara[1][2]*ql)*q1+(Mpara[2][1]+Mpara[2][2]*ql)) ); }; }; class reflection{ //Ref: M. Born and E. Wolf, "Principles of Optics", sixth edition, 1993, Chapter 13. // all notation per the reference complexn_hat; //n"hat" per Born and Wolf notation: complex index of refraction of transmitted medium complextheta_i; //incident angle. public: reflection(complex , complex);//n_hat and theta_i complex theta_t; //transmitted angle complex calc_theta_t(void){return arcsin(sin(theta_i)/n_hat);}; complex r_para(void){ //Technical Note TN3 see below return (sin(theta_i-theta_t)/cos(theta_i-theta_t))/(sin(theta_i+theta_t)/cos(theta_i+theta_t));}; complex r_perp(void){ return (sin(theta_i-theta_t)/sin(theta_i+theta_t));}; };