Skip to content

Commit 55b4254

Browse files
authored
add trig and hyperbolic trig (#12)
1 parent 718f3d0 commit 55b4254

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ Functions list (see in-code documentation for more detail)
2424
| `Median` | Median |
2525
| `Var` | Variance |
2626
| `Stdev` | Standard deviation |
27+
| `Sin` | Sine |
28+
| `Cos` | Cosine |
29+
| `Tan` | Tangent |
30+
| `Csc` | Cosecant |
31+
| `Sec` | Secant |
32+
| `Cot` | Cotangent |
33+
| `Sinh` | Hyperbolic sine |
34+
| `Cosh` | Hyperbolic cosine |
35+
| `Tanh` | Hyperbolic tangent |
36+
| `Csch` | Hyperbolic cosecant |
37+
| `Sech` | Hyperbolic secant |
38+
| `Coth` | Hyperbolic cotangent |
2739
| `MDet` | Matrix determinant |
2840
| `Mgje` | Matrix Gauss-Jordan Elimination |
2941
| `MCof` | Matrix cofactors |

lib.ua

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,52 @@ Var ← -˙×∩÷∩⊃⧻/+⟜˙×
2626
# Standard deviation
2727
Stdev ← √Var
2828

29+
# -- Trigonometry --
30+
31+
# Sine
32+
Sin ← ∿
33+
# Cosine
34+
Cos ← ∿˜-η
35+
# Tangent
36+
Tan ← ⌅(÷°∠|∠⊙1)
37+
38+
# Cosecant
39+
Csc ← ⨪Sin
40+
# Secant
41+
Sec ← ⨪Cos
42+
# Cotangent
43+
Cot ← Tan˜-η
44+
45+
# Hyperbolic Sine
46+
Sinh ← ⌅(÷₂-∩ₑ⊸¯|°ₑ+⟜⍜˙×+₁)
47+
# Hyperbolic Cosine
48+
Cosh ← ⌅(÷₂+∩ₑ⊸¯|°ₑ+⟜⍜˙×-₁)
49+
# Hyperbolic Tangent
50+
Tanh ← ⌅(÷⊃+-1ₑ×₂|÷₂°ₑ÷˜⊃-+1)
51+
52+
# Hyperbolic Cosecant
53+
Csch ← ⨪Sinh
54+
# Hyperbolic Secant
55+
Sech ← ⨪Cosh
56+
# Hyperbolic Cotangent
57+
Coth ← ⨪Tanh
58+
59+
┌─╴test
60+
# Inverse functions have standard ranges
61+
⍤⤙≍ ¯η_0_η °Sin ¯1_0_1
62+
⍤⤙≍ 0_¯η_η_0 °Csc ¯∞_¯1_1_∞
63+
⍤⤙≍ π_η_0 °Cos ¯1_0_1
64+
⍤⤙≍ η_π_0_η °Sec ¯∞_¯1_1_∞
65+
⍤⤙≍ ¯η_¯η/2_0_η/2_η °Tan ¯∞_¯1_0_1_∞
66+
⍤⤙≍ π_3η/2_η_η/2_0 °Cot ¯∞_¯1_0_1_∞
67+
68+
˙⍤ /×=1 ⁅₅ -∩˙×⊃Sinh Cosh ×2-⊸¬÷⟜⇡10 # Pythagorean Identity
69+
70+
⍤⤙≍ ¯0.88137_0.88137 ⁅₅ °Csch ¯1_1
71+
⍤⤙≍ ∞_1.31696_0 ⁅₅ °Sech 0_1/2_1
72+
⍤⤙≍ ¯0.54931_¯∞_∞_0.54931 ⁅₅ °Coth ¯2_¯1_1_2
73+
└─╴
74+
2975
# -- Matrices/Vectors --
3076

3177
# ? SwappedRows Pivot

0 commit comments

Comments
 (0)