Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : Mathematical Functions : acos

acos

Arc cosine (PHP 4, PHP 5)
float acos ( float arg )


Code Examples / Notes » acos

zoltan dot szentesi

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


Change Language


Follow Navioo On Twitter
abs
acos
acosh
asin
asinh
atan2
atan
atanh
base_convert
bindec
ceil
cos
cosh
decbin
dechex
decoct
deg2rad
exp
expm1
floor
fmod
getrandmax
hexdec
hypot
is_finite
is_infinite
is_nan
lcg_value
log10
log1p
log
max
min
mt_getrandmax
mt_rand
mt_srand
octdec
pi
pow
rad2deg
rand
round
sin
sinh
sqrt
srand
tan
tanh
eXTReMe Tracker