atan
7-24
Polar Arc Tangent
atan
Syntax
#include <math.h>
double
atan
(double x);
Defined in
atan.c in rts.src
Description
The atan function returns the arc tangent of a floating-point argument x. The
return value is an angle in the range [
−
π
/2,
π
/2] radians.
Example
double realval, radians;
realval = 1.0;
radians = atan(realval);
/* return value = 0 */
Cartesian Arc Tangent
atan2
Syntax
#include <math.h>
double
atan2
(double y, double x);
Defined in
atan.c in rts.src
Description
The atan2 function returns the arc tangent of
y/x. The function uses the signs
of the arguments to determine the quadrant of the return value. Both argu-
ments cannot be 0. The return value is an angle in the range [
−
π
,
π
] radians.
Example
atan2
(1.0, 1.0)
/* returns
π
/4 */
atan2
(1.0, −1.0)
/* returns 3
π
/4 */
atan2
(−1.0, 1.0)
/* returns
−π
/4 */
atan2
(−1.0, −1.0)
/* returns −3
π
/4 */
Register Function Callec by Exit()
atexit
Syntax
#include <stdlib.h>
void
atexit
(void (*fun)(void));
Defined in
exit.c in rts.src
Description
The atexit function registers the function that is pointed to by
fun, to be called
without arguments at normal program termination. Up to 32 functions can be
registered.
When the program exits through a call to the exit function, a call to abort, or
a return from the main function, the functions that were registered are called
without arguments in reverse order of their registration.
Summary of Contents for TMS320C2x
Page 8: ...viii...
Page 69: ...2 47 C Compiler Description...
Page 159: ...6 36...
Page 226: ...8 6...