I develop some program and I encountered to this problem:

![enter image description here](https://i.stack.imgur.com/5reAv.png)

We know point **P**, **X**, and angle **a**. Range of angle is <0°,360°> between lines **p** and **o**. How I can determine in which side of line **o** is point **X**? Line **p** is always perpendicular to x axe. I thought that I would use this equation: (**Bx - Ax) \* (Cy - Ay) - (By - Ay) \* (Cx - Ax)** (slope) but second point of line **o** is missing and I have no idea how do this with given angle.
['https://math.stackexchange.com/questions/969292', 'https://math.stackexchange.com', 'https://math.stackexchange.com/users/183624/']
Equation for line $o$:
$$
u(t) = p + t q
$$
for $t \in \mathbb{R}$ with normed direction vector $q = (\sin a, \cos a)^T$ and vector $p = (x, y)^T$. Then
$$
v = x-p
$$
where $x = (a, b)^T$ (vector $x$, not coordinate $x$; coordinate $a$, not angle $a$) and $v$ is the vector from line $o$, at the end point of $p$, to the end point of $x$.

And now we decompose $v$ into two parts:
$$
v\_q = (v \cdot q) \, q
$$
is the part of $v$ in direction of $q$. Then
$$
v\_\perp = v - v\_q
$$
is the part of $v$ orthogonal to $o$'s direction vector $q$.
It should have a negative $y$ coordinate if $x$'s end point is below the line $o$, if the angle $a$ is non-zero, $a \in (0, 2\pi)$.

Otherwise ($a = 0$) check if it's $x$ coordinate is positive.

### Example

This is a vector on the line $o$:

```
octave> p = [2, 5]'
p =
  2
  5

```

Line $o$ has an $60^\circ$ angle $a$ regarding to the $y$-axis:

```
octave> a = 60 * 2 * pi / 360
  a =  1.0472

```

Vector $q$ is a normed direction vector of line $o$:

```
octave> q = [sin(a), cos(a)]'
  q =
    0.86603
    0.50000

```

This is an example vector below the line $o$:

```
octave> x = [4,3]'
  x =
    4
    3

```

Here we have the difference vector $v$ that would lead from $p$ to $x$:

```
octave> v = x - p
  v =
    2
   -2

```

This is $v\_q$, the part of $v$ in direction of $q$:

```
octave> vq = (v' * q) * q
  vq =
     0.63397
     0.36603

```

And this is $v\_\perp$, the part of $v$ orthogonal to $q$:

```
octave> vo = v - vq
  vo =
     1.3660
    -2.3660

```

A test:

```
octave> vo + vq
  ans =
      2.0000
     -2.0000

```

The $y$-coordinate is negative (and $a$ is non-zero):

```
octave> vo(2)
  ans = -2.3660

```

We can put the test into an octave function:

```
octave> function res = test(x)
> p=[2,5]'
> a = 60*2*pi/360
> q = [sin(a), cos(a)]'
> v = x - p
> vq = (v'*q)*q
> vo = v - vq
> if (vo(2) == 0)
> res = 0
> else
> res = vo(2)/abs(vo(2))
> endif
> endfunction

```

Some applications:

```
octave> x2 = [ -2, 7]'
octave> test(x2)
..
ans =  1

```

which means $x\_2$ is above line $o$. And then

```
octave> test(p)
ans = 0

```

which means $p$ is on the line $o$.
Another way (renamed the angle as "A" to avoid confussion with the coordinate "a"): if (a-x)\*tan(A)>b-y then X is below the line.