Go to main content

acos

This function computes the arc cosine of x.

ACOS

NAME

acos - This function computes the arc cosine of x.

SYNOPSIS

acos(number)

DESCRIPTION

This mathematical function allows the user to compute the arc cosine of x. Its answer is the angle whose cosine is x, the argument of the function. The argument needs to be between -1 and 1, in agreement with 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 acos function.

RETURN

The acos 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={_{
%include "/includes/extenso.sn";
function rad2deg(value)
        return value * 57.3;
endf
acos(-1.);"\n";
b=rad2deg(acos(-1.));
b;
}}.),
q(res=PI.));

B would give the answer in degrees. Here the answer is 180.

With radians:

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

With an answer given in integers:

test(q(res={_{acos(.525322);}}.),q(res=45.));

Note that we used the answer to cos(45), which is presented in the cos
section. However, one can notice that the argument (the expected value of the
cos function) could be different. Cos(45) gives the same answer as cos(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;
acos(b);
}}.),
q(res=1.5708.));

With an array:

test(q(res={_{acos(-1,1,0);}}.),q(res=\[3.14159,0,1.5708\].));

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.