Is my geometric problem solvable through this matrix computation?

40 Views Asked by At

As a context, given 2D points $(x, y)$, $(x', y')$ and $(a, b)$, I'd like to determine whether point $(a, b)$ lies in half-plane $H$, where $H$ is obtained by cutting the plane with the line perpendicular to segment $((x, y), (x', y'))$ and having a distance of 1 to point $(x', y')$. $H$ is the half-plane not containing these points. As an example (which gives the intuition for the following paragraph), consider $(x, y) = (-42, 0)$, $(x', y') = (-1, 0)$. Now any $(a, b)$ with $a \geq 0$ lies in $H$.

I think my problem can be solved with matrices and linear algebra. Indeed, I want to compute matrix $M$, for which the following equations hold:

$$ \begin{pmatrix} x' & y' \end{pmatrix} M = \begin{pmatrix} -1 & 0 \end{pmatrix} $$ $$ \begin{pmatrix} x & y \end{pmatrix} M = \begin{pmatrix} -\sqrt{|x' - x|^2 + |y' - y|^2} - 1 & 0 \end{pmatrix} $$

If I then apply matrix $M$ to $\begin{pmatrix} a & b \end{pmatrix}$, obtaining $\begin{pmatrix}a' & b'\end{pmatrix}$, then I think checking if $a' \geq 0$ solves my problem.

My questions are as follows. First of all, is my reasoning thus far correct? Secondly, if my reasoning is correct, how to compute this matrix $M$?

1

There are 1 best solutions below

0
On BEST ANSWER

Matrix M is in fact the following linear transformation :

  • translate the plane such that $(x', y')$ maps to the origin $(0, 0)$.
  • rotate the plane around the origin until $(x, y)$ lies on the negative $x$-axis.
  • translate the plane such that $(x', y')$ maps to $(-1, 0)$.

After applying this linear transformation, checking if $(a, b)$ ends up with a positive $x$-coordinate does indeed solve the geometric problem. If needed I can detail the steps a bit more.