Lingo Dictionary > A-C > atan() |  |

atan()

Syntax

    (number).atan
    atan (number)

Description

Math function; calculates the arctangent, which is the angle whose tangent is a specified number. The result is a value in radians between pi/2 and +pi/2.

Example

This statement displays the arctangent of 1:

    (1).atan

The result, to four decimal places, is 0.7854, or approximately pi/4.

Note that most trigonometric functions use radians, so you may want to convert from degrees to radians.

Example

This handler lets you convert between degrees and radians:

    on DegreesToRads degreeValue
    	return degreeValue * PI/180
    end

The handler displays the conversion of 30 degrees to radians in the Message window:

    put DegreesToRads(30)
    -- 0.5236

See also

`cos()`, `PI`, `sin()`