Last 5.3 release ever available: PHP 5.3.29 - 5.3 now EOL


(PHP 4, PHP 5)

atanTangente Inversa (arco tangente)


float atan ( float $arg )

Retorna o inverso da tangente de arg em radianos. atan() é a função complementar de tan(), o que significa que var == tan(atan(var)) para qualquer valor de a que esteja dentro dos limites de atan().



O argumento para processar

Valor Retornado

O arco tangente de arg em radianos.

Veja Também

  • tan() - Tangente
  • atanh() - Tangente hiperbólica inversa
  • asin() - Seno Inverso (arco seno)
  • acos() - Cosseno Inverso (arco cosseno)

add a note add a note

User Contributed Notes 2 notes

darren_wheatley at hotmail dot com
10 years ago
Arc Tan curve manipulation.

I used this formula to help with increasing and then diminishing return for y given an increasing x for a game.

Ie: Food production (output) is y. Food research is x.

The more research you put into x the more you produce, however after a certain point you get less reward.

y = atan(x - pi()) + pi()/2;

The + pi()/2 moves it up the y axis so you'd add more if you want it to start higher.

The x - pi() moves it to the right so you'd minus more to move it more.

If you want stretched along the y axis change it to 2 * atan( ...... )

Dunno how useful it is... but it's there.

joelperr at kiwi-interactif dot com
8 years ago
to obtain the direction of the line, you are better to use the <? atan2((y2-y1)/(x2-x1)) ?> function, since the regular atan function will only return arguments in the half-plane, ie. if y2-y1 and x2-x1 are negative, atan will give you an angle measurement less than 90 degrees, while it really should be  between 180 and 270
To Top