FingerSlice.cs 871 B

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using bbiwarg.Utility;
  7. namespace bbiwarg.Detectors.Fingers
  8. {
  9. class FingerSlice
  10. {
  11. private Vector2D start;
  12. private Vector2D mid;
  13. private Vector2D end;
  14. public Vector2D Start { get { return start; } private set { start = value; } }
  15. public Vector2D Mid { get { return mid; } private set { mid = value; } }
  16. public Vector2D End { get { return end; } private set { end = value; } }
  17. public LineSegment2D Line { get { return new LineSegment2D(Start, End); } }
  18. public float Size { get { return Start.getDistanceTo(End); } }
  19. public FingerSlice(Vector2D start, Vector2D end) {
  20. Start = start;
  21. End = end;
  22. Mid = (start + end) / 2;
  23. }
  24. }
  25. }