Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
23
Task/Vector-products/SETL/vector-products.setl
Normal file
23
Task/Vector-products/SETL/vector-products.setl
Normal 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;
|
||||
Loading…
Add table
Add a link
Reference in a new issue