Acos

From Director Online Wiki
Jump to: navigation, search
--------------------------------------------
--calculate arc cos
--------------------------------------------
on acos ratio
  if ratio < 0 then
    return pi() + atan(sqrt(1.0 - (ratio * ratio))/ratio)
  else if ratio > 0 then
    return atan(sqrt(1.0 - (ratio * ratio))/ratio)
  else
    return pi()/2
  end if
end