beetlebug▾
/

tcl::mathfunc asin

Gives the arc sine of a number, in radians.

tcl::mathfunc::asin NUMBER
expr {asin(NUMBER)}

Description

Gives the angle from -pi/2 to pi/2 whose sine is NUMBER. NUMBER must be from -1 to 1.

Arguments

ArgumentTypeDefaultDescription
NUMBERnumberrequiredA number from -1 to 1.

Returns

A float from -pi/2 to pi/2.

Examples

% expr {asin(1)}
1.5707963267948966

% expr {asin(0.5)}
0.5235987755982989

Errors

% expr {asin(2)}
domain error: argument not in valid range
-errorcode ARITH DOMAIN {domain error: argument not in valid range}

# Tcl 9.1 only
% expr {asin("x")}
cannot use non-numeric string "x" as operand of "asin"
-errorcode ARITH DOMAIN {non-numeric string}

# Tcl 8.6 only
% expr {asin("x")}
can't use non-numeric string as operand of "asin"
-errorcode ARITH DOMAIN {non-numeric string}

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztcl 1.0.0-beta.1

See also