Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: de.comp.lang.javascript Subject: Re: Fehler bei Berechnungen in JavaScript Date: Mon, 29 Nov 2021 17:02:03 +0100 Lines: 40 Message-ID: References: <1679766.OeldK439Yt@PointedEars.de> <2651122.v9v1EOSiMG@PointedEars.de> <10054887.QKATZ9b1sv@PointedEars.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net UQbtyup1TFy7DksWqJfsKg+6Kei1GAJ8ngc6EEkVaVpDeFbHJz Cancel-Lock: sha1:LkKWNzoX51PXaWlgVCyBcqC69vM= User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Betterbird/91.3.2 Content-Language: en-US In-Reply-To: Xref: csiph.com de.comp.lang.javascript:5291 Arno Welzel: > Leo Baumann: > >> Am 29.11.2021 um 16:12 schrieb Arno Welzel: >>> Was ist "grüner Bereich"? Relevant ist, ob folgendes erfüllt ist: >>> >>> Math.cos(bb) != 0 >>> Math.sin(h) != 0 >> >> Natürlich ist beides erfüllt, 10 x kontrolliert. :( > > Also: > > Du sagst, dass hier würde NaN ergeben: > > Math.abs( > Math.acos( > Math.sin(bs) - > Math.sin(bb) * cose1 / Math.cos(bb) / Math.sin(h) > ) > ) > > Und bs, bb, cose1 und h sind gültige numerische Werte und Math.cos(bb) > sowie Math.sin(h) sind ungleich 0. > > Das ist aus meiner Sicht unmöglich. I stand corrected. Math.acos(x) will für x einen Wert von -1 bis 1 haben. Alle Werte unter -1 oder über 1 liefern NaN. Siehe auch: -- Arno Welzel https://arnowelzel.de