atan2l() in C++

atan2l(): This function is available in the file math.h. This function computes the arc tangent of x/y using the signs of arguments to determine the correct quadrant. This function returns the value in the range [-π,π]. 

Parameters: Two parameters are required for this function.

x - The value of x coordinate.

y - The value of y coordinate.

Syntax:

atan2l(x,y)

For Example:

atan2l(1,2) = > It returns the value 0.463648

Approach

C++

#include <bits/stdc++.h>
using namespace std;

int main()
{

    long double x = 1y = 2;
    cout << atan2l(xy<< "\n";

    return 0;
}


No comments:

Post a Comment