Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: atan - Manual
[go: Go Back, main page]

PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

atanh" width="11" height="7"/> <atan2
Last updated: Sun, 25 Nov 2007

view this page in

atan

(PHP 4, PHP 5)

atan — 逆正接(アークタンジェント)

説明

float atan ( float $arg )

arg のアークタンジェントをラジアンで返します。 atan() is the は tan() の逆関数で、 atan() がとりうる範囲内のすべての a について a==tan(atan(a)) が成立します。

パラメータ

arg

処理する引数。

返り値

arg のアークタンジェントをラジアンで返します。



atanh" width="11" height="7"/> <atan2
Last updated: Sun, 25 Nov 2007
 
add a note add a note User Contributed Notes
atan
joelperr at kiwi-interactif dot com
12-Jan-2006 10:12
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
darren_wheatley at hotmail dot com
28-Nov-2003 11:24
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.

Daz
jmartin at columbiaservices dot net
21-Nov-2003 05:10
I looked for hours trying to come up with a formula to solve the direction that a line was heading (in degrees) when x1,y1 were the starting points, and x2,y2 are the ending points. Here is the equasion I was given, I hope this helps anyone in need of the same one.

$angle = rad2deg(atan2(($y2 - $y1), ($x2 - x1)));

atanh" width="11" height="7"/> <atan2
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | sitemap | contact | advertising | mirror sites