using System; namespace Science.Physics.GeneralPhysics { /// /// Optics /// public class Optics { public Optics() { } private double theta1, theta2, theta3, thetac, thetap, theta, thetamin; // radian private double n1 = 1.0, n2, d, y, L, lambda, D; private int m = 1; public double AngleOfIncidence { get{return theta1;} set{theta1 = value;} } public double AngleOfReflection { get{return theta2;} set{theta2 = value;} } public double AngleOfRefraction { get{return theta3;} set{theta3 = value;} } public void Reflection() { theta2 = theta1; } public void RefractionOfSnellLaw() { theta3 = Math.Asin(n1/n2*Math.Sin(theta1)); } public double IndexOfRefractionForMedium1 { get{return n1;} set{n1 = value;} } public double IndexOfRefractionForMedium2 { get{return n2;} set{n2 = value;} } public void FindIndexOfRefractionForMedium2() { n2 = n1*Math.Sin(theta1)/Math.Sin(theta3); } public void TotalInternalReflection() { thetac = Math.Asin(n2/n1); } public double CriticalAngle { get{return thetac;} set{thetac = value;} } public void PolarizationOfBrewsterLaw() { thetap = Math.Atan(n2/n1); } public double BrewsterAngle { get{return thetap;} set{thetap = value;} } public double AngleOfLine { get{return theta;} set{theta = value;} } public double DistanceOfFringe { get{return y;} set{y = value;} } public double DistanceToScreen { get{return L;} set{L = value;} } public double DistanceOfSlitSeperation { get{return d;} set{d = value;} } public int OrderNumber { get{return m;} set{m = value;} } public double WaveLength { get{return lambda;} set{lambda = value;} } public void FindWaveLengthInYoungExperiment() { lambda = y*d/L/(double)m; } public void FindFringeInYoungExperiment() { y = L*Math.Asin(m*lambda/d); } public void FindAngleInGratingDiffraction() { theta = Math.Asin(m*lambda/d); } public double WaveLengthInMedium { get{return lambda/n1;} } public double SpeedOfLightInMedium { get{return Constant.SpeedOfLightInVacuum/n1;} } public void ResolutionOfCircularAperture() { thetamin = 1.22*lambda/D; } public double MinimumAngleOfResolution { get{return thetamin;} set{thetamin = value;} } public double DiameterOfAperture { get{return D;} set{D = value;} } } }