JAVASCRIPT

 Home  Computers & Internet  Web Programming JAVASCRIPT
What is Javascript?
Javascript Placement
Syntax
Reserved Words
Variables
Data Types
Escaping Characters
Concatenation
Arithmetic Operators
Assignment Operators
Comparison Operators
Boolean Operators
Conditional Operator
If Statements
Else If Statements
If Else Statements
Switch Statements
While Loops
For Loops
Do While Loops
Break Statement
Continue Statement
prompt()
alert()
Date()
Event Handlers
String Object Methods
Math Object Methods
Window Object Methods
Arrays

JAVASCRIPT acos() MATH OBJECT METHODS

The acos() math object method returns the arccosine of a number.

The general format is:

Math.acos(x)

Parameter x is required and must be an integer between -1 and 1. If it is out of this -1 to 1 range, NaN is returned.

Example:

<script type="text/javascript">

document.write(Math.acos(0.5) + '<br>');

document.write(Math.acos(-1) + '<br>');

document.write(Math.acos(-0.75) + '<br>');

document.write(Math.acos(-2));

</script>

The above will output:



See Also:

abs(x)
To return the absolute value of x.

acos(x)
To return the arccosine of x.

asin(x)
To return the arcsine of x.

atan(x)
To return the arctangent of x.

atan2(y,x)
To return the angle between a point and the x axis.

ceil(x)
To return the next integer rounded up.

cos(x)
To return the cosine of x.

exp(x)
To return the value of E raised to the power of x.

floor(x)
To return the next integer rounded down.

log(x)
To return the natural log of x.

max(x,y)
To return the number with the highest value of x and y.

min(x,y)
To return the number with the lowest value of x and y.

pow(x,y)
To return the value of number x raised to the power of y.

random()
To return a random number between 0 and 1.

round(x)
Rounds x to the nearest integer

sin(x)
To return the sine of x.

sqrt(x)
To return the square root of x

tan(x)
To return the tangent of x.

Home | Privacy Policy | Terms Of Use | Contact Us