Javascript Array angle()

Description

Javascript Array angle()

Array.prototype.angle = function() {
  var a = Math.atan(this[1] / this[0])
  return  this[0] >= 0
    ? (this[1] > 0 ? 2*Math.PI - a : -a)
    : Math.PI - a//from   w w w . j  a  v a  2 s .  c  o m
}



PreviousNext

Related