=0.65&&wavelength<0.75){
h = 0;
s =1;
}
else if( wavelength>=0.75 ) { // 0.8 is the limit for RED 750 nm
h = 0;
s =0;
//s = parseFloat(1-wavelength/0.35);//f;
// s = (1-wavelength/0.35);//f;
// rgbcolour = HSVtoRGB(h,s,parseFloat(i/255));
// colors[i] = "rgba("+rgbcolour.r+", "+rgbcolour.g+", "+rgbcolour.b+",1)";
// colors2.push([rgbcolour.r, rgbcolour.g, rgbcolour.b]);// from felix
// colorlookang = colors[i];
}
else if(wavelength<=0.35) {
h = 0;//f;
s = 0;//f;
// h = parseFloat(0.75);//f;
// s = parseFloat(wavelength/0.35);//f;
}
// else {
console.log(h,s)
rgbcolour = HSVtoRGB(h,s,parseFloat(i/255.0));
// rgbcolour = hsl2rgb(h,s,parseFloat(i/255));
colors[i] = "rgba("+rgbcolour.r+", "+rgbcolour.g+", "+rgbcolour.b+",1)";
console.log(colors[i])
// colors2.push([rgbcolour.r, rgbcolour.g, rgbcolour.b]);// from felix
colors2.push([rgbcolour.r, rgbcolour.g, rgbcolour.b]);// from felix
console.log(colors2)
colorlookang = colors[i];
// }
}
}
]]>
L) {
// outside screen draw zero
sum2[i][j]= 0.0;
}
}
}
}
]]>
The EJSS Multiple Slit Diffraction model allows the user to simulate Fraunhofer diffraction through single or multiple slits. The user can modify the number of slits N, the slit width a, the slit separation d and the wavelength λ of the incident light.
Plots of the light intensity of envelope or resultant intensity can be toggled on and off with checkboxes.
The Scale of the diffraction pattern can also be changed.
The minima of single slit diffraction are determined by:
D sinθ = mλ , where m = 0,1,2,3,..... where D is the single slit width.For double slit interference, constructive interference (bright spots) are found at
d sinθ = mλ , where m = 0,1,2,3,..... where d is the distance between slits.and destructive interference dark spots are located at:
d sinθ = (m+0.5)λ , where m = 0,1,2,3,..... where d is the distance between slits.Multiple slits will sharpen (narrow) the regions of constructive interference. The overall pattern from multiple slits will be the two-slit pattern multiplied by the single slit diffraction envelope.
]]>