tak by to, v rámci toho že jde o studnu, mohlo být "dostatečně" přesné

Nemá, fór tohoto rébusu je naopak v tom, že něco na první pohled tak triviálního je ve skutečnosti pěknej masakr
No jo, ale uměl bys to nakreslit?
Kód: Vybrat vše
<html>
<head>
<title>Studna</title>
<script>
const params = {
a: 60,
b: 80,
h: 25,
}
function checkX(x) {
const { a, b, h } = params;
return x * x * x * x
+ 2 * x * x * x
+ x * x * (b * b - a * a) / (h * h)
- 2 * x
- 1;
}
function xToK(x) {
return x / (x + 1);
}
function xToWidth(x) {
const { a, b, h } = params;
const k = xToK(x);
const b1 = b * k;
const a2 = a * (1 - k);
const w1 = Math.sqrt(b1 * b1 - h * h);
const w2 = Math.sqrt(a2 * a2 - h * h);
return w1 + w2;
}
let minDiff = 1;
let resultX = -1;
let resultW = -1;
for (let x = 0; x <= 1; x += 0.00001) {
const diff = Math.abs(checkX(x));
if (diff < minDiff) {
minDiff = diff;
resultX = x;
resultW = xToWidth(x);
}
}
console.info('minDiff', minDiff); // 0.000030332827259504924
console.info('resultX', resultX); // 0.6039699999995268
console.info('resultW', resultW); // 44.632169785795384
</script>
</head>
</html>
Presne tak. Najdes ho porad ve studni, podle zadani nemel sanci jeste vylezt ven.
ano, toto považuji za správný "výsledek" rébusu