Data update

This commit is contained in:
Ingy döt Net 2024-10-16 18:07:41 -07:00
parent 81fd053722
commit 52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions

View file

@ -1 +1,4 @@
cross=: (1&|.@[ * 2&|.@]) - 2&|.@[ * 1&|.@]
cross=: 1 _1 1*1-/ .*\. ,.
dot=: +/ .*
stp=: dot`cross/ NB. scalar triple product
vtp=: cross/ NB. vector triple product

View file

@ -0,0 +1 @@
cross=: {{ >-L:0/ .(*L:0) (<"1=i.3), x,:&:(<"0) y}}

View file

@ -1 +1,11 @@
cross=: {{ ((1|.x)*2|.y) - (2|.x)*1|.y }}
a=: 3 4 5
b=: 4 3 5
c=: -5 12 13
a dot b
49
a cross b
5 5 _7
stp a,b,:c
6
vtp a,b,:c
_267 204 _3

View file

@ -1,3 +1 @@
CT=: C.!.2 @ (#:i.) @ $~
ip=: +/ .* NB. inner product
cross=: ] ip CT@#@[ ip [
A=:'a',"0'123' [B=:'b',"0'123'

View file

@ -1 +1,9 @@
cross=: [: > [: -&.>/ .(*&.>) (<"1=i.3) , ,:&:(<"0)
1]\.A(,.' '&,"1)B
a2 b2
a3 b3
a1 b1
a3 b3
a1 b1
a2 b2

View file

@ -1 +1 @@
cross=: {{ >-L:0/ .(*L:0) (<"1=i.3), x,:&:(<"0) y}}
cross=: (*1&|.){{1|.u-u~}}

View file

@ -1,12 +1 @@
a=: 3 4 5
b=: 4 3 5
c=: -5 12 13
A=: 0 {:: ] NB. contents of the first box on the right
B=: 1 {:: ] NB. contents of the second box on the right
C=: 2 {:: ] NB. contents of the third box on the right
dotP=: A ip B
crossP=: A cross B
scTriP=: A ip B cross C
veTriP=: A cross B cross C
cross=: 1|.(*1&|.)-(*1&|.)~

View file

@ -1,8 +1 @@
dotP a;b
49
crossP a;b
5 5 _7
scTriP a;b;c
6
veTriP a;b;c
_267 204 _3
cross=: {{ ((1|.x)*2|.y) - (2|.x)*1|.y }}

View file

@ -0,0 +1,3 @@
CT=: C.!.2 @ (#:i.) @ $~
ip=: +/ .* NB. inner product
cross=: ] ip CT@#@[ ip [

View file

@ -0,0 +1 @@
cross=: [: > [: -&.>/ .(*&.>) (<"1=i.3), ,:&:(<"0)

View file

@ -0,0 +1,23 @@
program vector_products;
a := [3, 4, 5];
b := [4, 3, 5];
c := [-5, -12, -13];
print(" a:", a);
print(" b:", b);
print(" c:", c);
print(" a . b:", a dot b);
print(" a x b:", a cross b);
print("a . (b x c):", a dot (b cross c));
print("a x (b x c):", a cross (b cross c));
op dot(a, b);
return a(1)*b(1) + a(2)*b(2) + a(3)*b(3);
end op;
op cross(a, b);
return [a(2)*b(3) - a(3)*b(2),
a(3)*b(1) - a(1)*b(3),
a(1)*b(2) - a(2)*b(1)];
end op;
end program;