Ejemplo n.º 1
0
 public LensWithTwoStops()
 {
     Lens     = new PinholeLens();
     BackStop = new Circle()
     {
         Z = 1
     };
     FrontStop = new Circle()
     {
         Z = -1
     };
 }
Ejemplo n.º 2
0
        public void LensTransform()
        {
            //ThinLens lens = new ThinLens(10, 1);
            PinholeLens lens = new PinholeLens();
            //ComplexLens lens = ComplexLens.CreatePetzvalLens(Materials.Fixed.AIR, 4.0);
            //ComplexLens lens = ComplexLens.CreateDoubleGaussLens(Materials.Fixed.AIR, 4.0);
            //ComplexLens lens = ComplexLens.CreateBiconvexLens(150, 100, 0);
            var sensorPos = new Vector3d(2.5, 3.5, 15.7);
            var lensPos = new Vector3d(0.5, 0.25, 0);

            //int samples = 10 * 1024 * 1024;
            int samples = 1000 * 1000;
            Stopwatch sw = Stopwatch.StartNew();
            for (int i = 0; i < samples; i++)
            {
                lens.Transfer(sensorPos, lensPos);
            }
            sw.Stop();

            Console.WriteLine("Total time: {0}", sw.ElapsedMilliseconds);
            Console.WriteLine("Thoughput: {0} smpl/sec", samples * (1000 / (float)sw.ElapsedMilliseconds));
        }
Ejemplo n.º 3
0
 public LensWithTwoStops()
 {
     Lens = new PinholeLens();
     BackStop = new Circle() { Z = 1 };
     FrontStop = new Circle() { Z = -1 };
 }