Find X location using 3 known (X,Y) location using trilateration

Use the distance equation. If your unknown point is $(x,y)$, your known points are $(x_i, y_i)$ which are distances $r_i$ from your unknown point, then you get three equations:

$$(x-x_1)^2 + (y-y_1)^2 = r_{1}^2 \\ (x-x_2)^2 + (y-y_2)^2 = r_{2}^2 \\ (x-x_3)^2 + (y-y_3)^2 = r_{3}^2$$

We can expand out the squares in each one:

$$x^2 - 2x_1x + x_1^2 + y^2 - 2y_1y + y_1^2 = r_1^2 \\ x^2 - 2x_2x + x_2^2 + y^2 - 2y_2y + y_2^2 = r_2^2 \\ x^2 - 2x_3x + x_3^2 + y^2 - 2y_3y + y_3^2 = r_3^2$$

If we subtract the second equation from the first, we get

$$(-2x_1 + 2x_2)x + (-2y_1 + 2y_2)y = r_1^2 - r_2^2 - x_1^2 + x_2^2 - y_1^2 + y_2^2 .$$

Likewise, subtracting the third equation from the second,

$$(-2x_2 + 2x_3)x + (-2y_2 + 2y_3)y = r_2^2 - r_3^2 - x_2^2 + x_3^2 - y_2^2 + y_3^2 .$$

This is a system of two equations in two unknowns:

$$Ax + By = C \\ Dx + Ey = F$$

which has the solution:

$$x = \frac{CE-FB}{EA-BD} \\ y = \frac{CD-AF}{BD-AE}$$