public float getDistance(TuioPoint pt) { float dx = xpos - pt.getX(); float dy = ypos - pt.getY(); return((float)Math.Sqrt(dx * dx + dy * dy)); }
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); }
public void update(TuioPoint p) { this.xpos = p.getX(); this.ypos = p.getY(); }
public TuioPoint(TuioPoint p) { this.xpos = p.getX(); this.ypos = p.getY(); }