Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,11 @@
NB. utilities
ip=: +/ .* NB. inner product
T=. (_1^#:0 10 9 12)*0 7 16 23 A.=i.4
toQ=: 4&{."1 :[: NB. real scalars -> quaternion
NB. task
norm=: %:@ip~@toQ NB. | y
neg=: -&toQ NB. - y and x - y
conj=: 1 _1 _1 _1 * toQ NB. + y
add=: +&toQ NB. x + y
mul=: (ip T ip ])&toQ NB. x * y

View file

@ -0,0 +1,20 @@
T
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
0 _1 0 0
1 0 0 0
0 0 0 _1
0 0 1 0
0 0 _1 0
0 0 0 1
1 0 0 0
0 _1 0 0
0 0 0 _1
0 0 _1 0
0 1 0 0
1 0 0 0

View file

@ -0,0 +1,21 @@
q=: 1 2 3 4
q1=: 2 3 4 5
q2=: 3 4 5 6
r=: 7
norm q
5.47723
neg q
_1 _2 _3 _4
conj q
1 _2 _3 _4
r add q
8 2 3 4
q1 add q2
5 7 9 11
r mul q
7 14 21 28
q1 mul q2
_56 16 24 26
q2 mul q1
_56 18 20 28