====== asin() ====== asin ist definiert in der ''[[start|math]]'', die in C über ''math.h'', bzw. in C++ über ''cmath'' eingebunden wird. ===== Funktion ===== asin() berechnet den Arcus Sinus des übergebenen Parameters. Der Arcus Sinus ist die Umkehrfunktion des [[c:lib:math:sin()|Sinus]]. ===== Signatur ===== #include double asin ( double x ); float asin ( float x ); // nur C++ long double asin ( long double x ); // nur C++ float asinf( float x ); long double asinl( 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 asin #include // für printf() #define PI 3.141592654 int main( void ) { double value, degree; double length = 0.5; value = asin( length ); degree = value * 180 / PI; printf( "asin(%f) sind %f bzw. %f Grad\n", length, value, degree ); return EXIT_SUCCESS; } Ausgabe: asin(0.500000) sind 0.523599 bzw. 30.000000 Grad ===== Hinweis ===== In C++ wird diese Funktion mit einem ValueArray-Template überladen. ===== siehe auch ===== [[c:lib:math:start|math]]: [[c:lib:math:acos()]], [[c:lib:math:atan()]], [[c:lib:math:sin()]], [[c:lib:math:cos()]], [[c:lib:math:atan()]] \\ [[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]]