Пример #1
0
 public Form1()
 {
     InitializeComponent();
     //  plist.Add(new PointW(0, 0, 0, 0, 0));
     ;
     bs.DataSource = plist;
     dataGridView1.AutoGenerateColumns = false;
     dataGridView1.DataSource          = bs;
     cnv = new CoordConverter(plist);
     pictureBox1.MouseWheel += new MouseEventHandler(pictureBox1_MouseWheel);
 }
Пример #2
0
        private void Calc2Point(int px, int py, out double xx, out double yy)
        {
            PointW     p1  = plist[0];
            PointW     p2  = plist[1];
            int        vx  = p2.x - p1.x;
            int        vy  = p2.y - p1.y;
            double     wx  = p2.wx - p1.wx;
            double     wy  = p2.wy - p1.wy;
            PointW     p3  = new PointW(-1, p1.x - vy, p1.y + vx, p1.wx - wy, p1.wy + wx);
            PointWList plw = new PointWList();

            plw.Add(p1);
            plw.Add(p2);
            plw.Add(p3);

            CoordConverter cnv = new CoordConverter(plw);

            cnv.Calculate();
            cnv.ConvertPointD2W(px, py, out xx, out yy);
        }