Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Answer

added 1 character in body
Source Link
dharr
  • 1.1k
  • 2
  • 8

Maple, (削除) 187 (削除ここまで) 176 bytes

(s,t)->eval(s^+.Matrix([[],[-e3],[e2,-e1],[-e5,-e6,-e7],[e4,-e7,e6,-e1],[e7,e4,-e5,-e2,e3],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc forwith the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Maple, (削除) 187 (削除ここまで) 176 bytes

(s,t)->eval(s^+.Matrix([[],[-e3],[e2,-e1],[-e5,-e6,-e7],[e4,-e7,e6,-e1],[e7,e4,-e5,-e2,e3],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Maple, (削除) 187 (削除ここまで) 176 bytes

(s,t)->eval(s^+.Matrix([[],[-e3],[e2,-e1],[-e5,-e6,-e7],[e4,-e7,e6,-e1],[e7,e4,-e5,-e2,e3],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc with the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

save 11 bytes; matrix diagonal entries automatically zero for antisymmetric indexing
Source Link
dharr
  • 1.1k
  • 2
  • 8

Maple, 187(削除) 187 (削除ここまで) 176 bytes

(s,t)->eval(s^+.Matrix([[0][[],[-e3,0]e3],[e2,-e1,0]e1],[-e5,-e6,-e7,0]e7],[e4,-e7,e6,-e1,0]e1],[e7,e4,-e5,-e2,e3,0]e3],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Maple, 187 bytes

(s,t)->eval(s^+.Matrix([[0],[-e3,0],[e2,-e1,0],[-e5,-e6,-e7,0],[e4,-e7,e6,-e1,0],[e7,e4,-e5,-e2,e3,0],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Maple, (削除) 187 (削除ここまで) 176 bytes

(s,t)->eval(s^+.Matrix([[],[-e3],[e2,-e1],[-e5,-e6,-e7],[e4,-e7,e6,-e1],[e7,e4,-e5,-e2,e3],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

correct typos
Source Link
dharr
  • 1.1k
  • 2
  • 8

Maple, 187 bytes

(s,t)->eval(s^+.Matrix([[0],[-e3,0],[e2,-e1,0],[-e5,-e6,-e7,0],[e4,-e7,e6,-e1,0],[e7,e4,-e5,-e2,e3,0],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is usT.Q.vt. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Maple, 187 bytes

(s,t)->eval(s^+.Matrix([[0],[-e3,0],[e2,-e1,0],[-e5,-e6,-e7,0],[e4,-e7,e6,-e1,0],[e7,e4,-e5,-e2,e3,0],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is uT.Q.v. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Maple, 187 bytes

(s,t)->eval(s^+.Matrix([[0],[-e3,0],[e2,-e1,0],[-e5,-e6,-e7,0],[e4,-e7,e6,-e1,0],[e7,e4,-e5,-e2,e3,0],[-e6,e5,e4,-e3,-e2,e1,0]],shape=antisymmetric).t,{seq(e||i=Vector(7,{i=1}),i=1..7)});

If the two vectors are s and t, and Q is the multiplication table as a matrix, then the result in the form a*e1+b*e2+... is sT.Q.t. Then substitute e1, e2 etc for the unit vectors [1,0,0,0,0,0,0]T, [0,1,0,0,0,0,0]T etc. to get the final result.

Source Link
dharr
  • 1.1k
  • 2
  • 8
Loading

AltStyle によって変換されたページ (->オリジナル) /