文字

acos

(PHP 4, PHP 5)

acos反余弦

说明

float acos ( float $arg )

返回 arg 的反余弦值,单位是弧度。 acos() cos() 的反函数,它的意思是在 acos() 范围里的每个值都是 a==cos(acos(a))

参数

arg

要处理的参数

返回值

arg 的反余弦弧度。

参见

  • cos() - 余弦
  • acosh() - 反双曲余弦
  • asin() - 反正弦
  • atan() - 反正切

用户评论:

[#1] zoltan dot szentesi at nokia dot com [2006-08-06 03:29:46]

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! :-)

上一篇: 下一篇: