NOVINKA: Najžiadanejšie rekvalifikačné kurzy teraz s 50% zľavou + kurz AI ZADARMO. Nečakaj, táto ponuka dlho nevydrží! Zisti viac:

PHP - atan

Trieda

Koreň \ Bez triedy

Metóda - atan

(PHP 4, PHP 5, PHP 7)

The function atan() returns a value of the goniometric function arc tangent. The arc tangent is the inverted value of the tangent (often referred as tan−1). It allows us to get back the angle, which means that a == tan(atan(a)).

Procedurálne

  • function atan (float $arg) : float

Parametre

NázovDátový typPredvolená hodnotaPopis
$argfloat

The value of tangent.

Mávratovej hodnoty

Vracia: float

The resulting angle in radians.

Príklady

<?php
// each 15° till 180
for ($i = 0; $i <= 180; $i += 15) {
    $tan = tan(deg2rad($i)); // converts the angle into radians and calculates its tangent
    $deg = rad2deg(atan($tan)); // calculates the angle in radians using the previous value and then converts it into degrees
    echo("tan({$i}°) = $tan ---> atan($tan) = {$deg}°<br />");
}

Súvisiace manuály

      • function acos (float $arg) : float
      • function asin (float $arg) : float
      • function atanh (float $arg) : float
      • function tan (float $arg) : float
      Aktivity