○ — Cis / Circular
Function. Keys: Alt-o. Ranks: 0 monadic, 0 0 dyadic
○Y: eiY = cos Y + i sin Y. Real Y is an angle in radians. Pervasive.
○0 ⍝ 1
○0j1 ⍝ *¯1K○Y applies the circular function with code K, from 0 to 8. K○⁻¹Y applies its inverse. Pervasive; angles in radians.
1○0 ⍝ 0
2○0 ⍝ 1
1○⁻¹1 ⍝ 1.5707963267948966k |
k○y |
k○⁻¹y |
|---|---|---|
| 0 | √(1−y²) |
√(1−y²) |
| 1 | sin | arcsin |
| 2 | cos | arccos |
| 3 | tan | arctan |
| 4 | √(1+y²) |
APL branch of √(y²−1) |
| 5 | sinh | arcsinh |
| 6 | cosh | arccosh |
| 7 | tanh | arctanh |
| 8 | √(-1−y²) |
-√(-1−y²) |
Uses complex continuation where needed. The cuts of 3○⁻¹ and 5○⁻¹ lie on the imaginary axis. As in C99 and NumPy, the sign of a zero real part chooses the side of these cuts: 3○⁻¹ 0j2 and 3○⁻¹ ¯0j2 give results on opposite sides. On a cut along the real axis, results always come from the side above the cut, because BPL turns a number whose imaginary part is zero, ¯0 included, into a real. For example, 2j¯0 is 2. A real argument computes with an imaginary part of +0:
1○⁻¹2 ⍝ 1.5707963267948966j1.3169578969248166APL difference: there are no negative codes or codes 9 to 12. Write ¯k○Y as k○⁻¹Y. ∨Y gives the real and imaginary parts, |Y the magnitude, and ∧Y the magnitude and phase. On a branch cut, APL takes the side below the cut for a positive real argument.
Inverse
○⁻¹Y gives the angle of the unit complex number Y. The table above gives the inverse of each K○.
○⁻¹0j1 ⍝ π0.5