示例#1
0
文件: Lente01.cs 项目: Fred68/Lente01
		private void test5ToolStripMenuItem_Click(object sender,EventArgs e)
			{
			Line2D lin = new Line2D(0,0,1,1);
			Raggio ray0 = new Raggio(lin,700);

			Matrix mm = Matrix.Lower(4);
			Matrix mm1 = !mm;

            Point2D p1 = new Point2D(1, 0);
            Point2D p2 = new Point2D(0, 1);
            Point2D p3 = new Point2D (0,2);
            Point2D pc = new Point2D (0,0);
            Point2D p4 = new Point2D (2, 1);
            Point2D p1w = new Point2D(1, -0.01);

            Arc2D ar1 = new Arc2D(pc, p1, p2);
            Line2D ln1 = new Line2D(p2, p3);
            Line2D ln2 = new Line2D(p4, p3);
            Line2D ln3;
            ln3 = new Line2D(p4,p1);

			CorpoOttico cc = new CorpoOttico(new MaterialeOttico("vetro",1.4));
			cc.Add(new Contorno(ln3));
			cc.Add(new Contorno(ln2));
			cc.Add(new Contorno(ln1));
			cc.Add(new Contorno(ar1));
			cc.Validate();

			Point2D po = new Point2D(1.5, -1);

			Arc2D cerchio = new Arc2D(po, 4);
			

			Raggio ray;
			ray = new Raggio(new Line2D(po, p1 + new Point2D(0.05,0)),Ottica.LunghezzaOnda.Rosso);

			List<Intersection> intersezioni = cc.TrovaIntersezioniPositive(ray);
			Contorno xx = cc.Contorno(intersezioni[0].tr2);
			
			#pragma warning disable
			int tmp;
			tmp = 1;
			
			}
示例#2
0
文件: Lente01.cs 项目: Fred68/Lente01
		private void test4ToolStripMenuItem_Click(object sender,EventArgs e)
			{
			Point2D p1 = new Point2D(1, 0);
			Point2D p2 = new Point2D(0, 1);
			Point2D p3 = new Point2D (0,2);
			Point2D pc = new Point2D (0,0);
			Point2D p4 = new Point2D (2, 1);
			Point2D p1w = new Point2D(1, -0.01);

			Arc2D ar1 = new Arc2D(pc, p1, p2);
			Line2D ln1 = new Line2D(p2, p3);
			Line2D ln2 = new Line2D(p4, p3);
			Line2D ln3;
			ln3 = new Line2D(p4,p1);
//			ln3 = new Line2D(p4,p1w);

			CorpoOttico cc = new CorpoOttico(new MaterialeOttico("vetro",1.4));
			cc.Add(new Contorno(ln3));
			cc.Add(new Contorno(ln2));
			cc.Add(new Contorno(ln1));
			cc.Add(new Contorno(ar1));
			cc.Validate();

			Point2D po = new Point2D(1.5, -1);

			Line2D ray;
			ray = new Line2D(po, p1 + new Point2D(0.05,0));
			ray.Normalize();
			List<Intersection> intersezioni = cc.TrovaIntersezioniPositive(ray);

			#pragma warning disable
			int tmp;
			tmp = 1;
			#pragma warning restore

			}