FingerPoint.cs 876 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace bbiwarg.Detectors.Fingers
  7. {
  8. class FingerPoint
  9. {
  10. private int x;
  11. private int y;
  12. private Int16 depth;
  13. public FingerPoint(int x, int y, Int16 depth) {
  14. this.x = x;
  15. this.y = y;
  16. this.depth = depth;
  17. }
  18. public int getX() {
  19. return x;
  20. }
  21. public int getY() {
  22. return y;
  23. }
  24. public Int16 getDepth() {
  25. return depth;
  26. }
  27. public float getDistanceTo(FingerPoint fingerPoint) {
  28. int xDiff = x - fingerPoint.x;
  29. int yDiff = y - fingerPoint.y;
  30. float distance = (float)Math.Sqrt(xDiff * xDiff + yDiff * yDiff);
  31. return distance;
  32. }
  33. }
  34. }