To focus on your question, there is no one-time formula to do everything but a few to make the process easier. You will have to search around a whole host of math libraries to find them, though.
This is the theory underlying it.
Ok, so we require the latitude and longitude of point 3. I'm going to explain the theory behind it, because the code is just too much for me now.
To do this, we will use the support from one point to another. You can use this link to get this formula: Bearing formula
I assume that we know the distance between the device and each of the individual beacons, otherwise this is not possible if you do not want to use a kind of radar approach to identify this. I can not help it. If we know this, we can construct imaginary circles around two beacons, using the distance from them to the device as their radii.
eg. From the device to the lighthouse - 500 meters. From the device to the lighthouse 2 is 200 M. Draw an imaginary circle around the lighthouse with a radiooid of 500 M and an imaginary circle around the lighthouse with a radius of 200 m.
obviously, we cannot program these circles, it would be too tiring. Therefore, we will use the equation of the circle: (x -h) ^ 2 + (y - k) ^ 2 = r ^ 2.
A quick version of high school shows that h and k are the x and y coordinates of the center of the circle, offset from the Cartesian plain. we will focus our imaginary Cartesian plain at the first point. Now we will analyze the reference point to point two, using the distance from point to, to build a line from 0.0 on our Cartesian plane (point 1) to point 2. Using the tan of our bearing, we get the gradient of the line. Now we will use the cos and sine of our bearing and using the distance of our hypotenuse to obtain the position y and x of beacon 2 relative to beacon 1 on our Cartesian plane. Now we will return these values back to our circle equations:
your first equation will always be: (x -0) ^ 2 + (y - 0) ^ 2 = r ^ 2. Where r is the radius in this example 500M. the second equation is (x -h) ^ 2 + (y - k) ^ 2 = r ^ 2. Where r is the radius in this example 200M. Except now h is your calculated value of x above and y is the calculated value of y above.
Now for a complicated party. We need to find where these circles intersect. From our friends in the exchange of the mathematical stack, I received the formula. Intersection points
Now your circles can have zero 1 or two intersection points based on the position of the devices. If you get two results, you will have to run the whole thing again while the device is moving to see if we are moving closer or further from the centers of the circles. From this we can conclude which side is the correct point, and we can direct a straight line to lighthouse 1 on our Cartesian plain, get the gradient of the line, convert it to a bearing from lighthouse 1, and then rebuild the haversine and bearing formula to obtain the coordinates.
It is not very or simple, but in the end you will get there. This is most likely not the only solution, so feel free to look for others. Good luck.