예제 #1
0
        public float getDistance(TuioPoint pt)
        {
            float dx = xpos - pt.getX();
            float dy = ypos - pt.getY();

            return((float)Math.Sqrt(dx * dx + dy * dy));
        }
예제 #2
0
        public float getAngle(TuioPoint tuioPoint)
        {
            float side     = tuioPoint.getX() - xpos;
            float height   = tuioPoint.getY() - ypos;
            float distance = tuioPoint.getDistance(xpos, ypos);


            float angle = (float)(Math.Asin(side / distance) + Math.PI / 2);

            if (height < 0)
            {
                angle = 2.0f * (float)Math.PI - angle;
            }

            return(angle);
        }
예제 #3
0
 public void update(TuioPoint p)
 {
     this.xpos = p.getX();
     this.ypos = p.getY();
 }
예제 #4
0
 public TuioPoint(TuioPoint p)
 {
     this.xpos = p.getX();
     this.ypos = p.getY();
 }