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

search for in the

atan> <asinh
Last updated: Sun, 25 Nov 2007

view this page in

atan2

(PHP 4, PHP 5)

atan2 — 두 변수의 아크 탄젠트

설명

float atan2 ( float $y , float $x )

두 변수 xy 의 아크 탄젠트를 계산합니다. 이것은 각 인자의 부호가 4분구간을 결정한다는 점을 제외하면 y / x 의 아크 탄젠트와 동일합니다.

라디안으로 결과를 반환합니다. 그 값은 -PI와 PI(포함) 사이입니다.

참고: acos(), atan().



add a note add a note User Contributed Notes
atan2
Monte Shaffer
08-Jun-2007 11:35
Here is a function that will return a new point [Rotate around non-origin pivot point]

(x,y) is current point
(cx,cy) is pivot point to rotate
=a= is angle in degrees

    $_rotation     = 1;      # -1 = counter, 1 = clockwise
    $_precision    = 2;      # two decimal places

function returnRotatedPoint($x,$y,$cx,$cy,$a)
    {
    # http://mathforum.org/library/drmath/view/63184.html
    global $_rotation;     # -1 = counter, 1 = clockwise
    global $_precision;    # two decimal places

   
            // radius using distance formula
            $r = sqrt(pow(($x-$cx),2)+pow(($y-$cy),2));
            // initial angle in relation to center
            $iA = $_rotation * rad2deg(atan2(($y-$cy),($x-$cx)));

            $nx = number_format($r * cos(deg2rad($_rotation * $a + $iA)),$_precision);
            $ny = number_format($r * sin(deg2rad($_rotation * $a + $iA)),$_precision);

    return array("x"=>$cx+$nx,"y"=>$cy+$ny);
    }
reubs at idsdatanet dot com
23-May-2003 01:01
Just a note:

PHP's atan2 function receives parameters in (y,x) and Excel receives it in (x,y) format. Just in case you are porting formulas across. :)

atan> <asinh
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites