PHP 7.2.7 Released


(PHP 4, PHP 5)

acosOblicza arcus cosinus liczby


float acos ( float $argument )

Zwraca w radianach arcus cosinus argumentu. Funkcja acos() jest dopełniającą do funkcji cos(), co oznacza, że a==cos(acos(a)) dla każdej wartości z dziedziny funkcji acos().



Argument do przetworzenia

Zwracane wartości

Arcus cosinus argumentu w radianach.

Zobacz też:

  • cos() - Oblicza cosinus kąta
  • acosh() - Area cosinus hiperboliczny
  • asin() - Oblicza arcus sinus liczby
  • atan() - Oblicza arcus tangens liczby

add a note add a note

User Contributed Notes 2 notes

nurlanovic at gmail dot com
6 months ago
With this function you can get the number PI.
This is done like this: acos(-1) === M_PI
zoltan dot szentesi at nokia dot com
11 years ago
Wondering what is the use of 'acos' function?

It is essential in games, animations and drawings to determine the location of two objects relating to each other.

To the point: the angle of two vectors is calculated by

           v1X*v2X + v1Y*v2Y
  acos(--------------------------)=angle between two vectors.
               |v1| * |v2|

|v1| and |v2| are the length of the vectors and calculated using Pithagoras-formula: |v1|=sqrt(v1X*v1X + v1Y*v1Y)

This helped me to calculate and share given space for 'n' amount of objects so that they don't overlap.

Enjoy! :-)
To Top