Tutorial Gateway

  • C
  • C#
  • Python
  • SQL
  • Java
  • JS
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs
  • MySQL

ATAN2 Function in C

The C ATAN2 Function is a C Math Library Function, used to calculate the Trigonometric Arc Tangent of y/x. Or you can say it returns the angle in radius from the X-Axis to the specified point (y, x). The syntax of the atan2 in C Programming is

double atan2(double y, double x);

ATAN2 Function in C Example

The atan2 function in the math library helps you to find the trigonometric Arc Tangent of multiple parameters. This atan2 program, ask the user for two values, and then find the arctangent value of those two parameters

TIP : Please refer to the C TAN Function article to see the program to calculate the Tangent value. And C ATAN Function to calculate the Arc Tangent Value of the specified C Programming expression.

/* Example for ATAN2 Function in C Programming */

#include <stdio.h>
#include <math.h>

int main()
{
  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);
  
  return 0;
}
ATAN2 Function in C Programming 1

Filed Under: C Programming

  • C Comments
  • C Escape Sequence
  • C Programming Operators
  • C Arithmetic Operators
  • C Assignment Operators
  • C Bitwise Operators
  • C Conditional Operator
  • C Increment & Decrement Optr
  • C Logical Operators
  • C Relational Operators
  • C Sizeof Operator
  • C If Statement
  • C IF ELSE Statement
  • C Else If Statement
  • C Nested If
  • C Break Statement
  • C Continue Statement
  • C Goto Statement
  • C Switch Case
  • C For Loop
  • C While Loop
  • C Do While Loop
  • C Arrays
  • C Two Dimensional Array
  • C Multi Dimensional Array
  • C String
  • C Structures
  • C Nested Structures
  • C Array of Structures
  • C Structures and Functions
  • C Union
  • C Structure & Union differences
  • C Pointers
  • C Pass Pointers to Functions
  • C GETS
  • C fgets Function
  • C fgetc
  • C fputs function
  • C fputc
  • C Functions
  • C Types of Functions
  • C Pass Array to Functions
  • Call By Value & Call By Reference
  • C Recursion
  • C Program Examples

Copyright © 2021· All Rights Reserved by Suresh.
About | Contact | Privacy Policy