1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace bbiwarg.Detectors.Fingers
- {
- class FingerPoint
- {
- private int x;
- private int y;
- private Int16 depth;
- public FingerPoint(int x, int y, Int16 depth) {
- this.x = x;
- this.y = y;
- this.depth = depth;
- }
- public int getX() {
- return x;
- }
- public int getY() {
- return y;
- }
- public Int16 getDepth() {
- return depth;
- }
- public float getDistanceTo(FingerPoint fingerPoint) {
- int xDiff = x - fingerPoint.x;
- int yDiff = y - fingerPoint.y;
- float distance = (float)Math.Sqrt(xDiff * xDiff + yDiff * yDiff);
- return distance;
- }
- }
- }
|