August 1999
Intermediate to advanced
1488 pages
72h 53m
English
math.atan2(num1, num2)
The atan2() method of the Math object is used to calculate the arctangent of the quotient of its parameters. It returns a numeric value between –PI and PI representing the angle theta of an (x,y) point.
Listing 6.155 shows an example how the atan2() method is used. The two inputs are taken and stored in variables, inputNum1 and inputNum2. The atan2() method is then called using the user input, and the result is stored in the variable result.
<html> <body> <script language="JavaScript"> <!–– Hide // function calculates the arctangent of the // quotient of the two ... |
Read now
Unlock full access