|
| JAVASCRIPT atan2() MATH OBJECT METHODS
The atan2() math object method returns the angle between a point and the x axis.
The general format is:
Math.atan2(y, x)
Parameter x and y are both required and must be an integer.
Example:
<script type="text/javascript">
document.write(Math.atan2(0.5, -0.5) + '<br>');
document.write(Math.atan2(-1, -2) + '<br>');
document.write(Math.atan2(-0.75, 0.60) + '<br>');
document.write(Math.atan2(-2, 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.
 |
|
|