Math Winkelfunktionen liefern komische werte???



  • Morgen,

    folgender Code:

    Debug.WriteLine("Sin" + Math.Sin(30.0));
    			Debug.WriteLine("Sinh" + Math.Sinh(30.0));
    			Debug.WriteLine("Cos" + Math.Cos(30.0));
    			Debug.WriteLine("Cosh" + Math.Cosh(30.0));
    			Debug.WriteLine("Tan" + Math.Tan(30.0));
    			Debug.WriteLine("Tanh" + Math.Tanh(30.0));
    

    lieferen die werte:

    Sin-0,988031624092862
    Sinh5343237290762,23
    Cos0,154251449887584
    Cosh5343237290762,23
    Tan-6,40533119664628

    Wobei bspw. Sin(30) = 0.5 geben msüse.. hier -0.98???



  • Musst du da nicht das Bogenmaß (statt Gradmaß) übergeben?



  • MSDN schrieb:

    The angle, a, must be in radians. Multiply by Math..::.PI/180 to convert degrees to radians.

    Acceptable values of a range from approximately -9223372036854775295 to approximately 9223372036854775295. For values outside of this range, the Sin method returns a unchanged rather than throwing an exception.

    MfG 😉


Anmelden zum Antworten