0

I want to be able to check if a list of points will hit a screwed rectangle (rhombus I think).

I start out with 2 point P and T, I want to create a rectangle between the 2 points. I have used https://stackoverflow.com/questions/7854043/drawing-rectangle-between-two-points-with-arbitrary-width to do this. This gives me 4 points A, B, C and D of the new rectangle.

I then want to check if the point M is withing this rectangle.

enter image description here The two black dots are my points P and T, the black box is the rectangle I want to generate between the two dots, being X wide. I then want to test if the red dots are withing the black box.

Androme
  • 95
  • Added to the main post – Androme May 09 '16 at 04:29
  • Once we got your rectangle described properly, we could rotate the whole scene to get it orthogonally aligned to the coordinate axes. Then the test for inclusion is very simple. – mvw May 09 '16 at 04:37
  • Given $P$ and $T$ and the width $w$ of the rectangle is not enough information. Needed would be e.g. that $w$ is the length of the sides the points $P$ and $T$ sit on in the middle each. – mvw May 09 '16 at 04:43

1 Answers1

0

Once you got the coordinates of the vertices of your rectangle, you can proceed here

mvw
  • 34,562