note 37807 added to function.atan
| From: | darren_wheatley at hotmail dot com | Date: | Thu, 27 Nov 2003 23:24:35 +0000 |
| Subject: | note 37807 added to function.atan | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-61051@lists.php.net to get a copy of this message | ||
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
----
Manual Page -- http://www.php.net/manual/en/function.atan.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37807
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37807&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37807&report=yes
Search -- http://master.php.net/manage/user-notes.php