I am trying to solve a system of nonlinear equations in node.js

I am trying to solve the following equation programmatically:

(ax−x0)^2 + (ay−y0)^2 = r^2
(bx−x0)^2 + (by−y0)^2 = (r+330bs)^2
(cx−x0)^2 + (cy−y0)^2 = (r+330cs)^2

ax,bx,cx,ay,by,cy,bsand csare the parameters that I get at runtime. I try to find x0and y0, but when I write this in algorithm.js , this leads to errors. I am a high school student, so I have not studied high-class math (I found solutions to rotating matrices that I have not studied yet)

I would like to help with this, thanks in advance.

EDIT:

The code I used with algorithm.js was:

/*
    a = ax*
    b = bx*
    c = cx*
    d = ay*
    e = by*
    f = cy*
    g = x0
    h = y0
    i = r
    j = bs*
    k = cs*
*/
var eq = algebra.parse("(a−g)^2 + (d−h)^2 = i^2");
eq.solveFor("g");

Then I wanted to put the answer in the second equation and solve it, but that didn't work.

EDIT2:

The source of this equation is this , by the way.

+4
1

- . , .

console.log("−".charCodeAt());

8722 http://www.codetable.net/decimal/8722 ,

console.log("-".charCodeAt());

i get 45 http://www.codetable.net/decimal/45

charCode 45 ,

, , :)

+2

Source: https://habr.com/ru/post/1621695/


All Articles