Jump to content

Trigonometric functions: Difference between revisions

add BQN
(Trigonometric functions in various BASIC dialents)
(add BQN)
Line 803:
acos(-sqrt(2) / 2) = 135.00000000000000000000000000000000000000000000005500
atan(sqrt(3)) = 60.00000000000000000000000000000000000000000000002463</pre>
 
=={{header|BQN}}==
 
BQN has a system value <code>•math</code> which contains trigonometry functions. Inputs are given in radians. These functions can also be used with BQN's Inverse modifier (<code>⁼</code>) to get their respective defined inverses.
 
Some results may be inaccurate due to floating point issues.
 
The following is done in the BQN REPL:
<lang bqn> ⟨sin, cos, tan⟩ ← •math
Sin 0
0
Sin π÷2
1
Cos 0
1
Cos π÷2
6.123233995736766e¯17
Tan 0
0
Tan π÷2
16331239353195370
Sin⁼ 0
0
Sin⁼ 1
1.5707963267948966
Cos⁼ 1
0
Cos⁼ 0
1.5707963267948966
Tan⁼ 0
0
Tan⁼ ∞
1.5707963267948966</lang>
 
 
=={{header|C}}==
236

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.