note 87461 added to function.pi

From: Date: Fri, 05 Dec 2008 23:38:40 +0000
Subject: note 87461 added to function.pi
Groups: php.notes 
Request: Send a blank email to php-notes+get-147730@lists.php.net to get a copy of this message
/* Returns angle of line segment in degrees. Angle will be a positive value between 0 and 360. 0 will be north, 90 east, 180 south, 270 west Author: Robert Kohr */ function get_angle($x1, $y1, $x2, $y2, $negative_y_is_up=0){ //differences in x and y $x = $x2 - $x1; $y = $y2 - $y1; //y will need to be negated for where + y is down if($negative_y_is_up){ //useful in some applications $y = -$y; } return (rad2deg(atan2($x, $y))+360)%360; } ---- Server IP: 64.71.164.2 Probable Submitter: 216.207.44.2 ---- Manual Page -- http://www.php.net/manual/en/function.pi.php Edit -- https://master.php.net/note/edit/87461 Del: integrated -- https://master.php.net/note/delete/87461/integrated Del: useless -- https://master.php.net/note/delete/87461/useless Del: bad code -- https://master.php.net/note/delete/87461/bad+code Del: spam -- https://master.php.net/note/delete/87461/spam Del: non-english -- https://master.php.net/note/delete/87461/non-english Del: in docs -- https://master.php.net/note/delete/87461/in+docs Del: other reasons-- https://master.php.net/note/delete/87461 Reject -- https://master.php.net/note/reject/87461 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#147730) next »