Siebel VB Language Reference > VB Language Reference >

Atn Function


This standard VB function returns the angle (in radians) for the arctangent of the specified number.

Syntax

Atn(number)

Argument
Description

number

Any valid numeric expression

Returns

The arctangent of number.

Usage

The Atn function assumes number is the ratio of two sides of a right triangle: the side opposite the angle to find and the side adjacent to the angle. The function returns a single-precision value for a ratio expressed as an integer, a currency, or a single-precision numeric expression. The return value is a double-precision value for a long, variant, or double-precision numeric expression.

To convert radians to degrees, multiply by (180/PI). The value of PI is approximately 3.14159.

Example

This example finds the roof angle necessary for a house with an attic ceiling of 8 feet (at the roof peak) and a 16-foot span from the outside wall to the center of the house. The Atn function returns the angle in radians; it is multiplied by 180/PI to convert it to degrees.

Sub Button_Click
   Dim height As Single, span As Single, angle As Single
   Dim PI As Single
   PI = 3.14159
   height = 8
   span = 16
   angle = Atn(height/span) * (180/PI)
End Sub

See Also

Cos Function
Sin Function
Tan Function
Derived Trigonometric Functions for Siebel VB

Siebel VB Language Reference