|
Dieser Artikel wurde maschinell übersetzt. Bewegen Sie den Mauszeiger über die Sätze im Artikel, um den Originaltext anzuzeigen. Weitere Informationen
|
Übersetzung
Original
|
atan, atanf, atan2, atan2f
double atan( double x ); float atan( float x ); // C++ only long double atan( long double x ); // C++ only double atan2( double y, double x ); float atan2( float y, float x ); // C++ only long double atan2( long double y, long double x ); // C++ only float atanf( float x ); float atan2f( float y, float x );
|
|
|
|
|---|---|---|
|
|
|
_DOMAIN |
// crt_atan.c
// arguments: 5 0.5
#include <math.h>
#include <stdio.h>
#include <errno.h>
int main( int ac, char* av[] )
{
double x, y, theta;
if( ac != 3 ){
fprintf( stderr, "Usage: %s <x> <y>\n", av[0] );
return 1;
}
x = atof( av[1] );
theta = atan( x );
printf( "Arctangent of %f: %f\n", x, theta );
y = atof( av[2] );
theta = atan2( y, x );
printf( "Arctangent of %f / %f: %f\n", y, x, theta );
return 0;
}
Arctangent of 5.000000: 1.373401
Arctangent of 0.500000 / 5.000000: 0.099669