atan(): This function is available in the file math.h. This function takes one parameter. This function Compute arc tangent. It returns the principal value of the arc tangent of x, expressed in radians.
The atan() function takes a single mandatory argument (can be positive, negative, or zero)
The atan() function returns the value in the range of [-π/2, π/2].
Parameters: One parameter is required for this function.
__X: The value whose arc tangent value is to be determined.
Syntax:
atan(__X)
Example 1:In radians
Input: 58.98
Output: 1.55384
Example 2:In degrees
Input: 58.98
Output: 89.0738
Approach 1: In radians
C++
#include <bits/stdc++.h>using namespace std;int main(){double value = 58.98;cout << atan(value);return 0;}
Approach 2: In degrees
C++
#include <bits/stdc++.h>using namespace std;int main(){double value = 58.98;double radian = atan(value);double degrees = 180 * radian / 3.14;cout << degrees;return 0;}
No comments:
Post a Comment