Sun Chili!Soft ASP Sun Chili!Soft
ASP Sun Microsystems

 

VBScript Atn Function

Returns the arctangent of a number.

Syntax: VBScript Atn Function

Atn(number)

Arguments: VBScript Atn Function

number

Any valid numeric expression.

Remarks: VBScript Atn Function

The Atn function takes the ratio of two sides of a right triangle and returns the corresponding angle in radians. The ratio is the length of the side opposite the angle divided by the length of the side adjacent to the angle.

The range of the result is -pi/2 to pi/2 radians.

To convert degrees to radians, multiply degrees by pi/180. To convert radians to degrees, multiply radians by 180/pi.

The following example uses Atn to calculate the value of pi:

Dim pi

pi = 4 * Atn(1)   ' Calculate the value of pi.

Note

Atn is the inverse trigonometric function of Tan, which takes an angle as its argument and returns the ratio of two sides of a right triangle. Do not confuse Atn with the cotangent, which is the simple inverse of a tangent (1/tangent).

Copyright 2002 Sun Microsystems, Inc. All rights reserved. Legal Notice.