**Ask for advice on a mathematical algorithm**

The coordinates of the three points p1(x0,y0),p2(x1,y1)p3(x2,y2) are known. the ratio d1,d2,d3 from the unknown point M(x,y) to the three points is calculated, and the coordinates of the unknown point are obtained

Remark: 1.M is not necessarily whether there is a fixed solution formula in the triangle formed by P1, p2 and P3. it is really impossible to prepare to go to school for squatting

$ $ \ frac {(x-x _ 0) 2 plus (y-y _ 0) 2} {(x-x _ 1) 2 plus (y-y _ 1) 2} = \ frac {d _ 1 2} {d _ 2 2 2} $

$ $ \ frac {(x-x _ 0) 2 plus (y-y _ 0) 2} {(x-x _ 2) 2 plus (y-y _ 2) 2} = \ frac {d _ 1 2} {d _ 3 2} $If the subject has the resources of the school, the general solution can be obtained by solving the 2 yuan quadratic equations with Matlab. (In fact, manual calculation is OK, but it is too long after it is started. I have not touched this for many years, for fear of making a mistake.)

However, it should be noted that one of the two groups of solutions obtained needs to be excluded. (in case of solution)In addition, through the Apollonius theorem, the problem can be transformed into finding the intersection of two circles, which is also 2 yuan’s quadratic equations.

Similarly, if two circles intersect, there are two intersections, and one needs to be excluded. (in case of solution)

Supplement: Find the intersection point where three circles intersect in pairs.

The following equations 1, 2 and 3 respectively describe three circles, which are combined into equations and solved to obtain intersection points (at least 0 intersection points and at most 6 intersection points)

Equation 1: $ $ \ frac {(x-x _ 0) 2 plus (y-y _ 0) 2} {(x-x _ 1) 2 plus (y-y _ 1) 2} = \ frac {d _ 1 2} {d _ 2 2 2} $

Equation 2: $ $ \ frac {(x-x _ 0) 2 plus (y-y _ 0) 2} {(x-x _ 2) 2 plus (y-y _ 2) 2} = \ frac {d _ 1 2} {d _ 3 2} $

Equation 3: $ $ \ frac {(x-x _ 1) 2 plus (y-y _ 1) 2} {(x-x _ 2) 2 plus (y-y _ 2) 2} = \ frac {d _ 2 2 2} {d _ 3 2} $

$$\left\{\begin{array}\\ equation 1\\ equation 2\end{array}\right.$$

$$\left\{\begin{array}\\ equation 1\\ equation 3\end{array}\right.$$

$$\left\{\begin{array}\\ equation 2\\ equation 3\end{array}\right.$$Then, the judgment logic about the result is more complicated. Here, under the assumption of classification first, we should cast a brick to attract jade as a reference.

Because of the two circles in the plane, there may be 2 intersection points, 1 intersection point or 0 intersection points, 3 cases.

If the number of intersection points is 6 and there is no coincidence point, the two intersect, and the approximate point may be in the triangle formed by the closer 3 points.

If the number of intersection points is 6 and 3 of them coincide, the coincidence point is an ideal solution.

If the number of intersection points is 5, two circles are tangent, and the other circle intersects the two circles respectively. The approximate point may be between the tangent point and the other 2 points.

If the number of intersection points is 4, two circles intersect and the other circle is tangent to the two circles respectively. The approximate point may be in the triangle formed by 2 tangent points and another closer intersection point.

If the number of intersection points is 4, there is another possibility that one circle intersects with the other two separately, and the other two circles have no intersection point. The situation is a bit complicated and the approximate point is unknown.

If the number of intersection points is 3, then 3 circles are tangent in pairs. The approximate points may be within the triangle formed by these three points.

If the number of intersection points is 3, another possibility is that two circles intersect and the other circle is tangent to one of them. The approximate point is unknown.

If the number of intersection points is 2, it may be 2 intersection points or 2 tangent points. The approximate point is unknown.

If the intersection point is 1, a tangent point, the approximate point is unknown.

If the number of intersection points is 0, 3 circles are separated from each other. The approximate point is unknown.

(I’m not sure I’ve considered it all, please remind me if there are any omissions ~ ~)If the problem of the subject is only solved occasionally, then the software can draw 3 circles, which is better to judge.

If it is necessary to use the program to automatically calculate, then the logic is more complex. All kinds of situations need to be fully considered and well designed.

-Again-

Today, I just saw some knowledge about overdetermined equations and found some problems applicable to the subject.

The overdetermined equations refer to the equations whose number is greater than the number of unknown variables.

The overdetermined equation is generally a contradictory equation with no solution.

For example, if the given three points are not on a straight line, we will not be able to get such a straight line so that the straight line passes through the given three points at the same time. In other words, the given conditions (restrictions) are too strict, resulting in the solution does not exist. Solving overdetermined equations is very common in experimental data processing and curve fitting. The mos t commonly used method is the least square method. Visually speaking, it is to find the closest solution under the condition that the given conditions cannot be fully met.

Equations 1, 2 and 3 listed above contain two unknowns, i.e. overdetermined equations.

However, the least square method is used to solve the linear overdetermined equations. The main problem here is the nonlinear overdetermined equations.

Try the method of searching page inside, there are many Matlab solutionsResults of searching for nonlinear overdetermined equations