The ATAN2 Function in C programming is one of the Math Library Function, used to calculate the Trigonometric Arc Tangent of y/x. Or you can say, it is used to returns the angle in radius from the X -Axis to the specified point (y, x). In this article we will show you, How to use this ATAN2 function with example.
Syntax of ATAN2 Function in C
The basic syntax of the atan2 in C Programming is as shown below.
double atan2(double y, double x);
ATAN2 Function in C Example
The atan2 Function in math library helps you to find the trigonometric Arc Tangent of multiple parameters. This C program, ask the user for two values, and then find the arc tangent value of those two parameters
/* Example for ATAN2 Function in C Programming */
double atan2Value, X, Y;
printf("\n Please Enter the Values for Y and X to calculate Arc Tangent of Y/X : \n ");
scanf("%lf %lf", &Y, &X);
atan2Value = atan2(Y, X);
printf("\n The Arc Tangent value of %lf and %lf = %f ", Y, X, atan2Value);
Thank You for Visiting Our Blog