Skip to content

sin, asin

Sine, arcsine

sin x     sin[x]
asin x    asin[x]

Where x is numeric, returns

sin
the sine of x, taken to be in radians. The result is between -1 and 1, or null if the argument is null or infinity.
asin
the arcsine of x; that is, the value whose sine is x. The result is in radians and lies between \(-\frac{\pi}{2}\) and \(\frac{\pi}{2}\). (The range is approximate because of rounding errors.) The result is null if the argument is not between -1 and 1.
q)sin 0.5       / sine
0.4794255
q)sin 1%0
0n

q)asin 0.8      / arcsine
0.9272952
q)asin 2
0n

sin and asin are multithreaded primitives.

Implicit iteration

sin and asin are atomic functions.

q)sin (.2;.3 .4)
0.1986693
0.2955202 0.3894183

q)asin (.2;.3 .4)
0.2013579
0.3046927 0.4115168

q)sin `x`y`z!3 4#til[12]%10
x| 0         0.09983342 0.1986693 0.2955202
y| 0.3894183 0.4794255  0.5646425 0.6442177
z| 0.7173561 0.7833269  0.841471  0.8912074

Domain and range

The following shows the resulting output (range) type given the input (domain) type of x. For the character codes of the datatypes, refer to Datatypes.

domain: b g x h i j e f c s p m d z n u v t
range:  f . f f f f f f f . f f f z f f f f

cos, acos

Mathematics