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 - deg2rad

Trieda

Koreň \ Bez triedy

Metóda - deg2rad

(PHP 4, PHP 5, PHP 7)

This function converts degrees to radians.

Procedurálne

  • function deg2rad (float $number) : float

Parametre

NázovDátový typPredvolená hodnotaPopis
$numberfloat

The angular value in degrees.

Mávratovej hodnoty

Vracia: float

The resulting angle in radians returned as a float.

Príklady

<?php

$angles = [10, -10, 5.5, "itnetwork", 90];

foreach ($angles as $deg) {
    $rad = deg2rad($deg);
    echo ("$deg ° = $rad rad <br>");
}

This example outputs (if viewed from a web browser):

10 ° = 0.17453292519943 rad
-10 ° = -0.17453292519943 rad
5.5 ° = 0.095993108859688 rad


Warning:  deg2rad() expects parameter 1 to be a double, string given in (omitted).

itnetwork ° =  rad
90 ° = 1.5707963267949 rad

Súvisiace manuály

      • function rad2deg (float $number) : float
      Aktivity