Exemplo n.º 1
0
        public static List <double> Astigmatism(Light startLight, List <Lens> lenses, double diaphragm, double lightAngle1)
        {
            var    i1 = startLight.GetActualArgs(lenses[1], diaphragm / 2)[0]; //i1
            var    pa = startLight.L * Math.Sin(lightAngle1) / Math.Cos((i1 - lightAngle1) / 2);
            var    x  = pa * pa / 2 * lenses[1].Radius;
            double t;
            var    s = t = (lenses[0].Thickness - x) / Math.Cos(lightAngle1);
            double tNext = 0, sNext = 0;
            var    args  = startLight.GetActualArgs(lenses[1], diaphragm / 2);
            var    xNext = x;

            for (var i = 1; i < lenses.Count - 1; i++)
            {
                x     = xNext;
                tNext = lenses[i].Refractiond * Math.Pow(Math.Cos(args[1]), 2) /
                        ((lenses[i].Refractiond * Math.Cos(args[1]) - startLight.NowRefraction * Math.Cos(args[0])) /
                         lenses[i].Radius + startLight.NowRefraction * Math.Pow(Math.Cos(args[0]), 2) / t);
                sNext = lenses[i].Refractiond /
                        ((lenses[i].Refractiond * Math.Cos(args[1]) - startLight.NowRefraction * Math.Cos(args[0])) /
                         lenses[i].Radius + startLight.NowRefraction / s);
                startLight = startLight.Actual(lenses[i], diaphragm / 2, 'd');
                args       = startLight.GetActualArgs(lenses[i + 1], diaphragm / 2);
                pa         = startLight.L * Math.Sin(startLight.U) / Math.Cos((args[0] - startLight.U) / 2);
                xNext      = pa * pa / (2 * lenses[i + 1].Radius);
                var dv = (lenses[i].Thickness - x + xNext) / Math.Cos(startLight.U);

                t = tNext - dv;
                s = sNext - dv;
            }

            return(new List <double> {
                tNext, sNext, x
            });
        }
Exemplo n.º 2
0
        public static Light RepeatedLightActual(Light startLight, char ty, List <Lens> lenses, double a)
        {
            for (var i = 1; i < lenses.Count - 1; i++)
            {
                startLight = startLight.Actual(lenses[i], a, ty);
            }

            startLight.L = Math.Round(startLight.L, 10);

            return(startLight);
        }