Latest web development tutorials

C-Bibliotheksfunktionen - acos ()

C Standard-Bibliothek - <math.h> C Standard - Bibliothek - <math.h>

Beschreibung

C - BibliotheksfunktionenDoppel acos (double x) Liefert den Arkuskosinus von xin Radiant.

Erklärung

Hier ist () Anweisung ACOS-Funktion.

double acos(double x)

Parameter

  • x - zwischen [-1, +1] Bereich von Fließkommawerte.

Rückgabewert

Diese Funktion gibt in Radiant x Arkuskosinus- ausgedrückt in Radiant Intervall [0, pi].

Beispiele

Das folgende Beispiel zeigt acos () Funktion verwendet wird.

#include <stdio.h>
#include <math.h>

#define PI 3.14159265

int main ()
{
   double x, ret, val;

   x = 0.9;
   val = 180.0 / PI;

   ret = acos(x) * val;
   printf("%lf 的反余弦是 %lf 度", x, ret);
   
   return(0);
}

Lassen Sie uns zusammenzustellen und um das obige Programm ausführen, die in der folgenden führen:

0.900000 的反余弦是 25.855040 度

C Standard-Bibliothek - <math.h> C Standard - Bibliothek - <math.h>