note 37623 added to function.atan
| From: | jmartinatcolumbiaservicesdotnet at rn2 dot php dot net | Date: | Fri, 21 Nov 2003 05:10:47 +0000 |
| Subject: | note 37623 added to function.atan | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-60735@lists.php.net to get a copy of this message | ||
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)));
----
Manual Page -- http://www.php.net/manual/en/function.atan.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+37623
Delete -- http://master.php.net/manage/user-notes.php?action=delete+37623&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+37623&report=yes
Search -- http://master.php.net/manage/user-notes.php