Math.acos( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
Math.acos( ) Method Flash 5; can be used when exporting Flash 4 movies

compute the arc cosine of a number
Math.acos(x)

Arguments

x

A number between -1.0 and 1.0 (the cosine of an angle).

Returns

The angle, in radians, whose cosine is x. If x is not in the range -1.0 to 1.0, returns NaN.

Description

The arc cosine function (sometimes written as cos-1) is the inverse of the cosine function. It returns the angle whose cosine has the specified value, in radians. The return value is in the range of 0 to figs/u03c0.gif (i.e., 0 to 3.14159).

Example

trace (Math.acos(1.0));  // Displays: 0 trace (Math.acos(0.0));  // Displays: 1.5707... (i.e., pi/2)

See Also

Math.asin( ), Math.atan( ), Math.cos( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net