Movatterモバイル変換


[0]ホーム

URL:


PHP 8.5.0 Alpha 2 available for testing
    acosh »
    « abs

    acos

    (PHP 4, PHP 5, PHP 7, PHP 8)

    acosArc cosine

    Description

    acos(float$num):float

    Returns the arc cosine ofnum in radians.acos() is the inverse function ofcos(), which means that$num == cos(acos($num)) for every value ofnum that is in the domain ofacos().

    Parameters

    num

    The argument to process

    Return Values

    The arc cosine ofnum in radians.

    See Also

    Found A Problem?

    Learn How To Improve This PageSubmit a Pull RequestReport a Bug
    add a note

    User Contributed Notes1 note

    isweet479338 at gmail dot com
    3 months ago
    Parameter:
    $num: A float value between -1 and 1. (Outside this range will return NAN)

    Returns:
    The arc cosine of the number in radians.

    NAN (Not A Number) if the input is outside [-1, 1].

    <?php
    $cosValue
    =0.5;
    $angle=acos($cosValue);// returns angle in radians
    echo$angle;// 1.0471975512 (which is ~60 degrees)

    echorad2deg($angle);// Convert to degrees: ~60
    ?>
    add a note
    To Top
    and to navigate •Enter to select •Esc to close
    PressEnter without selection to search using Google

    [8]ページ先頭

    ©2009-2025 Movatter.jp