atan function(Arc Tangent) in C Language – example and detail

In the C Programming Language, the atan function returns the arc tangent of x.

Syntax

The syntax for the atan characteristic in the C Language is:

double atan(double x);

Parameters or Arguments

x

The value used to calculate the arc tangent.

Returns

The atan function returns the arc tangent of a wide variety represented by using x. It will return a price between -π/2 and π/2.

Required Header

In the C Language, the required header for the atan characteristic is:

#include <math.h>

Applies To

In the C Language, the atan characteristic can be used in the following versions:

ANSI/ISO 9899-1990

atan Example

/* Example using atan by TechOnTheNet.com */

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

int main(int argc, const char * argv[])
{
    /* Define temporary variables */
    double value;
    double result;

    /* Assign the value we will find the atan of */
    value = 0.5;

    /* Calculate the Arc Tangent of value */
    result = atan(value);

    /* Display the result of the calculation */
    printf("The Arc Tangent of %f is %f\n", value, result);

    return 0;
}

When compiled and run, this application will output:

The Arc Tangent of 0.500000 is 0.463648

Similar Functions

Other C features that are similar to the atan function:

acos feature asin characteristic atan2 characteristic cos function sin characteristic tan characteristic