Siebel eScript Language Reference > Siebel eScript Commands > The Math Object >

Math.atan() Method


This method returns an implementation-dependent approximation of the arctangent of the argument.

Syntax

Math.atan(number)

Parameter
Description
number
A numeric literal or numeric variable

Returns

An implementation-dependent approximation of the arctangent of number, expressed in radians.

Usage

The Math.atan() function returns an implementation-dependent approximation of the arctangent of the argument. The return value is expressed in radians and ranges from -pi/2 to +pi/2.

The 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 value for the ratio.

To convert radians to degrees, multiply by 180/Math.PI.

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 Math.atan() function returns the angle in radians; it is multiplied by 180/PI to convert it to degrees. Compare the example in the discussion of Math.atan2() Method to understand how the two arctangent functions differ. Both examples return the same value.

function RoofBtn_Click ()
{
   var height = 8;
   var span = 16;
   var angle = Math.atan(height/span)*(180/Math.PI);

   TheApplication().RaiseErrorText("The angle is " +
      Clib.rsprintf("%5.2f", angle) + " degrees.")
}

See Also

Math.acos() Method, Math.asin() Method, Math.atan2() Method, Math.cos() Method, Math.sin() Method, and Math.tan() Method


 Siebel eScript Language Reference 
 Published: 18 April 2003