====== atan() ======
atan ist definiert in der ''[[start|math]]'', die in C über ''math.h'', bzw. in C++ über ''cmath'' eingebunden wird.
===== Funktion =====
atan() berechnet den Arcus Tangens des übergebenen Parameters. Der Arcus Tangens ist die Umkehrfunktion des [[c:lib:math:tan()|Tangens]].
===== Signatur =====
#include
double atan ( double x );
float atan ( float x ); // nur C++
long double atan ( long double x ); // nur C++
float atanf( float x );
long double atanl( long double x );
**x**: Wert, dessen Winkel bestimmt werden soll, gültig zwischen -1 und +1.
**Return value**: Winkel im Bereich von -π/2 bis +π/2([[wpde>Kreiszahl|Kreiszahl Pi]])
===== Fehlerquellen =====
Eine beliebte Fehlerquelle ist zu übersehen, dass der Computer Winkel im Bogenmaß berechnet, also von 0 bis π ([[wpde>Kreiszahl|Kreiszahl Pi]]). Winkel von 0 bis 180 Grad müssen [[theory:math:trigonometry:angular-dimensions|umgerechnet]] werden
===== Beispiel =====
#include // für EXIT_SUCCESS
#include // für atan
#include // für printf()
#define PI 3.141592654
int main( void )
{
double value, degree;
double length = 1.0;
value = atan( length );
degree = value * 180 / PI;
printf( "atan(%f) sind %f bzw. %f Grad\n", length, value, degree );
return EXIT_SUCCESS;
}
Ausgabe:
atan(1.000000) sind 0.785398 bzw. 45.000000 Grad
===== Hinweis =====
In C++ wird diese Funktion mit einem ValueArray-Template überladen.
===== siehe auch =====
[[c:lib:math:start|math]]: [[c:lib:math:asin()]], [[c:lib:math:acos()]], [[c:lib:math:sin()]], [[c:lib:math:cos()]], [[c:lib:math:tan()]], [[c:lib:math:tan2()]] \\
[[cpp:lib:valarray:start|ValArray]]: [[cpp:lib:valarray:asin()]], [[cpp:lib:valarray:acos()]], [[cpp:lib:valarray:atan()]], [[cpp:lib:valarray:sin()]], [[cpp:lib:valarray:cos()]], [[cpp:lib:valarray:tan()]] \\
[[theory:math:trigonometry:start|Trigometrie]]: [[theory:math:trigonometry:angular-dimensions|Winkelmaße]]