Siebel VB Language Reference > Methods Reference for Siebel VB > Mathematical Methods >

Get Arctangent Method


The Get Arctangent method returns the angle in radians of the arctangent of a number that you specify. It assumes the value in the number argument is the ratio of two sides of a right triangle: the side opposite the angle to find and the side adjacent to the angle. It 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 any of the following numeric expressions:

  • Long
  • Variant
  • Double-precision

You can multiply a value by (180/PI) to convert radians to degrees. The value of PI is approximately 3.14159.

Format

Atn(number)

This method uses the same arguments as the Get Absolute Value method. For more information, see Get Absolute Value Method.

Example

The following example finds the roof angle necessary for a house that includes an attic ceiling height of 8 feet at the roof peak and a 16 foot span from the outside wall to the center of the house. The Get Arctangent method returns the angle in radians. It multiplies this value 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

Siebel VB Language Reference Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Legal Notices.