Je voudrais savoir comment me servir de tan-1, cos-1 et sin-1 en c++. Est-ce-que

ndubien Messages postés 557 Date d'inscription dimanche 25 septembre 2005 Statut Membre Dernière intervention 10 mai 2014 - 17 juin 2006 à 22:07
wxccxw Messages postés 755 Date d'inscription samedi 15 mai 2004 Statut Membre Dernière intervention 30 janvier 2011 - 19 juin 2006 à 17:22
Bonjour,


Je voudrais savoir comment me servir de , cos-1sin-1 en c++.
Est-ce-que quelqu'un peut m'aider?
SVP

Merci, d'avance.

Nico

4 réponses

niketou Messages postés 295 Date d'inscription dimanche 4 mai 2003 Statut Membre Dernière intervention 6 décembre 2010
17 juin 2006 à 22:17
#include <cmath>

atan( x )
0
deck_bsd Messages postés 1243 Date d'inscription jeudi 31 mars 2005 Statut Membre Dernière intervention 3 août 2016 2
18 juin 2006 à 10:02
google est ton amis ne l'oublie jamais mdr :D :

http://www.cplusplus.com/ref/cmath/atan.html
et tant que on y ait :

http://www.cplusplus.com/ref/cmath/

C'est encore mieu ;)

++
0
wxccxw Messages postés 755 Date d'inscription samedi 15 mai 2004 Statut Membre Dernière intervention 30 janvier 2011
19 juin 2006 à 12:55
sinon ya une fonction recherche sur le site !! plein de source ;) de plus la msdn peut aussi t'aider
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/default.asp
0
wxccxw Messages postés 755 Date d'inscription samedi 15 mai 2004 Statut Membre Dernière intervention 30 janvier 2011
19 juin 2006 à 17:22
Calculates the arctangent of x (atan or atanf) or the arctangent of y/x (atan2 or 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


);


Parameters

* x, y : Any numbers.

Return Value


atan returns the arctangent of x in the range of –p/2 to p/2 radians.atan2 returns the arctangent of y/x in the range –p to p radians. If x is 0, atan returns 0. If both parameters of atan2 are 0, the function returns 0.



atan2 uses the signs of both parameters to determine the quadrant of the return value.




Input |
SEH Exception |
Matherr Exception |

----

± QNAN,IND,
none,
_DOMAIN



Remarks

The atan function calculates the arctangent of x. atan2 calculates the arctangent of y/x. atan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0.



atan has an implementation that uses Streaming SIMD Extensions 2 (SSE2). See _set_SSE2_enable for information and restrictions on using the SSE2 implementation.


C++ allows overloading, so you can call overloads of atan and atan2. In a C program, atan and atan2 always take and return doubles.


Requirements



Routine |
Required header |
Compatibility |

----

atan, atan2, atanf, atan2f,
<math.h>,
ANSI, Win 98, Win Me, Win NT, Win 2000, Win XP



For additional compatibility information, see Compatibility in the Introduction.



Libraries


All versions of the C run-time libraries.


Example

// crt_atan.c
// arguments: 0.5 5
#include <math.h>
#include <stdio.h>
#include <errno.h>

int main( int ac, char* av[] )
{
double x1, x2, y;
if( ac != 3 ){
fprintf( stderr, "Usage: %s <x1> <x2>\n", av[0] );
return;
}
x1 = atof( av[1] );
y = atan( x1 );
printf( "Arctangent of %f: %f\n", x1, y );
x2 = atof( av[2] );
y = atan2( x1, x2 );
printf( "Arctangent of %f / %f: %f\n", x1, x2, y );
}


Output

Arctangent of 0.500000: 0.463648
Arctangent of 0.500000 / 5.000000: 0.099669
0
Rejoignez-nous