Goto main content

tan

This function computes the tan of a number.

TAN

NAME

tan - This function computes the tan of a number.

SYNOPSIS

tan(number)

DESCRIPTION

This mathematical function allows the user to compute the tan of an argument defined in radians. A radian is 57,3 degrees. For explanation on how to change your argument from radians to degrees, see the Examples section.

PARAMETERS

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

RETURN

The tan 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 with degrees (using this other function called deg2rad):

test(q(res={_{
%include "/includes/extenso.sn";
function deg2rad(value)
        return value / 57.3;
endf
tan(deg2rad(180));
}}.),
q(res=0.));

With radians:

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

With integers:

test(q(res={_{tan(45);}}.),q(res=1.61978.));

Note that when using a number greater than 2PI, the function will simply go around the
circle until reaching the number. For example, tan(4PI)=0 since it only means
that the function went around the circle twice. The only possible answers are
those of the trigonometric circle.

With other variables:

test(q(res={_{
%include "/includes/extenso.sn";
a=PI/4;
tan(a);
}}.),
q(res=1.));

With another trigonometric function:

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

With an array:

test(q(res={_{tan(PI,0,45);}}.),q(res=\[0,0,1.61978\].));

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

© 2021 extenso Inc. All rights reserved.