atand
Compute the angle corresponding to the arctangent of the input real number.
Interface Definition
C interface:
float atandf(float x);
double atand(double x);
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
x |
|
Floating-point value of the input data. |
Input |
Return Value
- Normal range: The angle y corresponding to the arctangent of the input x is returned, that is, y = atan(x) * 180/π. y ∈ [-90, +90]
- Special values: See the following table.
Input Value (x)
Output Value (y)
+0
+0
-0
-0
+inf
90
-inf
-90
NaN
NaN
Dependency
C: "km.h"
Example
C interface:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | // typical usage float x1 = -1.0, x2 = 1.0, x3 = 0.5, x4 = -0.5; // special handling float a = 0.0, b = INFINITY, c = -INFINITY, d = NAN; // print result printf("atand(1.0) = %.15f\n", atand(x1)); printf("atand(-1.0) = %.15f\n", atand(x2)); printf("atand(0.5) = %.15f\n", atand(x3)); printf("atand(-0.5) = %.15f\n", atand(x4)); printf("atand(0.0) = %.15f\n", atand(a)); printf("atand(-0.0) = %.15f\n", atand(-a)); printf("atand(INFINITY) = %.15f\n", atand(b)); printf("atand(-INFINITY) = %.15f\n", atand(c)); printf("atand(NAN) = %.15f\n", atand(d)); /* * atand(1.0) = -45.000000000000000 * atand(-1.0) = 45.000000000000000 * atand(0.5) = 26.565051177077990 * atand(-0.5) = -26.565051177077990 * atand(0.0) = 0.000000000000000 * atand(-0.0) = -0.000000000000000 * atand(INFINITY) = 90.000000000000000 * atand(-INFINITY) = -90.000000000000000 * atand(NAN) = nan * * */ |
Parent topic: Trigonometric Functions