Ejemplo n.º 1
0
        public int CalAreaIndex(Point p0, Point p1)
        {
            //pbm> the distance is in pixel unit.
            // should be in metric unit;

            double dx  = GestureCommon.cDx(p1, p0);
            double dy  = GestureCommon.cDy(p1, p0);
            double dis = GestureCommon.calDistance(p1, p0);
            double cos = dx / dis;

            //Console.WriteLine("(dx,dy,dis,cos)=" + dx.ToString() + "," + dy.ToString()
            //    + "," + dis.ToString("{.00}") + "," + cos.ToString("{0.0000}"));

            return(ckArea(cos, dy >= 0));
        }
        public void ts_dis(MouseEventArgs e)
        {
            mv.X = e.X;
            mv.Y = e.Y;

            int    dis  = (int)GestureCommon.calDistance(mv, mo);
            int    dis2 = GestureCommon.cDis2(mv, mo);
            int    dx   = GestureCommon.cDx(mv, mo);
            int    dy   = GestureCommon.cDy(mv, mo);
            double tan  = GestureCommon.cTan(mv, mo);

            Console.Out.WriteLine(" (dis,dis2,dx,dy,tan)=("
                                  + dis.ToString() + ","
                                  + dis2.ToString() + ","
                                  + dx.ToString() + ","
                                  + dy.ToString() + ","
                                  + tan.ToString("{0.00}") + ")");
        }