GPS-position in room Given are GPS-positions (WGS84) "Point 1" and "Point 2".
I need to find out wether a person (I know the GPS-position of the person) is standing outside of one of the virtual walls A, B and C and on which virtual wall she left it.
The virtual walls are of endless height, A and B are parallel and right-angled to C.
This is totally above my math knowledge so I'd appreciate solutions but also basic insight on where to start.
I added my illustration here:

 A: If you have an implicit equation of an oriented line in 2D, you can test if a point is left or right of the line by checking the sign of the value you get if you put the point into the line equation.
Have a line through points $P$ and $Q$ (let it be oriented from $P$ to $Q$ so we know what's left and right). A point $r=(x,y)$ forms an oriented triangle $PQr$ with an oriented area (without the extra $1/2$ factor):
$$(Q-r)\times(P-r)$$
(cross product in 2D is just $a\times b = a_x b_y-a_yb_x$, an area of the parallelogram spanned by the vectors). If this is positive, $r$ is on the right. If it's negative, $r$ is on the left. If it's zero, it's on the plane. So we can rewrite the line equation as:
$$f(r)=Q\times P+r\times (Q-P)$$
if you have $P$ and $Q$, you have an implicit equation of a line:
$$f(x,y)=ax+by+c$$
where $c=Q_x P_y-Q_yP_x$, $a=Q_y-P_y$, $b=P_x-Q_x$. Put the point into $f(x,y)$ and the sign tells you on which side you are on.
With this, you can directly write down the equation for the $C$ wall and figure out on which side the person is. All you need now is to write the equation for the other two walls. You can do that in various ways: one way is to just find some point on the wall (other than the corner) to have two points necessary to write down the equation. Another way is to directly use the fact that the walls are perpendicular.
Let's think... if Point1=P and Point2=Q, then let's also have a point R on the left (visible) side of the wall B. The equation for wall B is then
$$f(r)=R\times Q+r\times (R-Q)$$
But we now know that the vector $R-Q$ is perpendicular to $Q-P$. In 2D, a counterclockwise rotation can be performed by exchanging the components and switching one sign:
$$T(x,y)=(-y,x)$$
if $T$ is now a symbol signifying $90^\circ$ rotation of a vector.
This means that you can write $(R-Q)=T(Q-P)$ and therefore
$$R=Q+T(Q-P)$$
so once you have points $P$ and $Q$, you can write also the plane B (by using the equation above to construct another point on the wall - $R$).
The same goes for wall A, where we need a point $S$ on the visible part of the wall, and the wall goes from $S$ to $P$ (again, "inside" is on the left, which is negative value of $f(x,y)$). Because the walls A and B are parallel, vector $R-Q$ can be simply the same as $S-P$, so $S=P+T(Q-P)$. In the correct orientation, the equation of wall A will be
$$f(r)=P\times S+r\times (P-S)$$
Pay attention to the order of $P$ and $S$: we now have a chain of three walls going from $S\to P \to Q \to R$ points, and the inside is always on the left.
This method is general and can be used for testing if a point is inside or outside of any convex in a plane (by testing if all the f(x,y) values are negative). For non-convex polygons, you can still use it, but the condition is no longer all negatives, but a more complicated rule.
A: Compute the signs of these three expressions:
$$S_A=(x-x_1)(x_2-x_1)+(y-y_1)(y_2-y_1),$$
$$S_B=(x-x_1)(y_2-y_1)-(x-x_2)(y_2-y_1),$$
$$S_C=(x-x_2)(x_2-x_1)+(y-y_2)(y_2-y_1).$$
Inside the room, the three signs are always the same (find which with a sample point).
