Goto main content

atan

This function computes the inverse tan function of a number.

ATAN

NAME

atan - This function computes the inverse tan function of a number.

SYNOPSIS

atan(number)

DESCRIPTION

This mathematical function allows the user to compute the arc tan of x. Its answer is the angle whose tan is x, the argument of the function. The answer is given in agreement with the first answers of the trigonometric circle. The function gives an answer in radians. See the examples section for explanation on how to change the answer from radians to degrees.

PARAMETERS

number
Specify the number (float) used as argument for the atan function.

RETURN

The arctan value of the argument.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

One can use this function and find an answer in degrees (using a function
called rad2deg):

test(q(res={_{
function rad2deg(value)
        return value * 57.3;
endf
atan(1.);"\n";
b=rad2deg(atan(1.));
b;
}}.),
q(res=.785398));

B would give the answer in degrees. Here, b is 45.

With radians:

test(q(res={_{atan(1);}}.),q(res=PI/4.));

With an answer given in integers:

test(q(res=1.0177028.),q(res=45.));

Note that we used the answer to tan(45), which is presented in the tan
section. However, one can notice that the argument (the expected value of the
tan function) could be different. Tan(45) gives the same answer as tan(1.0177)
because it is simply the same value, plus a number of tours around the
trigonometric circle.


With other variables:

test(q(res={_{
%include "/includes/extenso.sn";
b=0;
atan(b);
}}.),
q(res=0.));

With arrays:

test(q(res={_{atan(1,0,-1);}}.),q(res=\[.785398,0,-.785398\].));

SEE ALSO

{{ include("includes/maths.sn") }}

AUTHOR

Written by Caroline Laplante, <claplante@sednove.com>

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2024 extenso Inc. All rights reserved.