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:57 +0100 Lines: 34 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 dHrGwpUHHADBnI/vgGIO9Qk6ee4IQJ+W++xK5u861WAxXJ+WH1 Cancel-Lock: sha1:YcXVxsdMHvtVRrECVhZno3EayYQ= 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:5292 Leo Baumann: > Am 29.11.2021 um 16:56 schrieb Arno Welzel: >>> 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. > > Darum bin ich aktuell auch verzweifelt und konfus. Definitiv sind > cos(bb) sowie sin(h) ungleich Null und alle anderen sind gültige Werte. Ja - aber Math.acos(x) will für x einen Wert von -1 bis 1 haben. Das ist für den Ausdruck Math.sin(bs) - Math.sin(bb) * cose1 / Math.cos(bb) / Math.sin(h) nicht garantiert. -- Arno Welzel https://arnowelzel.de