Trusted answers to developer questions

harris910

The returns the inverse tangent of a number. To be more specific,

`atan()`

function`arc tangent`

function`atan()`

returns the inverse tangent of a number in radians.This means that

`tan(atan(x))`

would be equal to`x`

.

Figure 1 shows the mathematical representation of the `atan()`

function.

To convert `radians`

to `degrees`

, use:

```
degrees = radians * ( 180.0 / M_PI )
```

Below is the graphical representation of the `atan`

function.

Graphical representation of atan() function

```
float atan(num)
```

This function requires a number as a parameter.

`atan()`

will return the inverse tangent of a number (in radians) that is sent as a parameter. The return value lies within `[-pi/2,pi/2]`

radians.

<?php #Positive number in radians echo("atan(0.5): "); echo (atan(0.5)); echo(" Radians") ?> <?php #Negative number in radians echo("atan(-0.5): "); echo (atan(-0.5)); echo(" Radians") ?> <?php #tan(atan(x)) echo("tan(atan(0.5)): "); echo (tan(atan(0.5))); echo(" Radians") ?> <?php #applying atan() and then converting the result in radians to degrees #radians = 1 echo("atan(1) * (180.0 / M_PI)): "); echo (atan(1) * (180.0 / M_PI)); echo(" Degrees") ?>

RELATED TAGS

php

math

tangent

communitycreator

CONTRIBUTOR

harris910

RELATED COURSES

View all Courses

Keep Exploring

Related Courses