代码拉取完成,页面将自动刷新
/*
class Quaternion {
constructor(c,i,j,k){
this.c = c;
this.i = i;
this.j = j;
this.k = k;
}
mutiply(q){
return new Quaternion(
this.c * q.c - this.i * q.i - this.j * q.j - this.k * q.k,
this.c * q.i + this.i * q.c + this.j * q.k - this.k * q.j,
this.c * q.j - this.i * q.k + this.j * q.c + this.k * q.i,
this.c * q.k + this.i * q.j - this.j * q.i + this.k * q.c
)
}
}
*/
class Quaternion_str {
constructor(c, i, j, k) {
this.c = c;
this.i = i;
this.j = j;
this.k = k;
}
/**
*
* @param {Quaternion_str} q
* @returns Array<Array<String>(4)>(4)
*/
mutiply_array(q) {
return [
[['+', this.c, q.c], ['-', this.i, q.i], ['-', this.j, q.j], ['-', this.k, q.k]],
[['+', this.c, q.i], ['+', this.i, q.c], ['+', this.j, q.k], ['-', this.k, q.j]],
[['+', this.c, q.j], ['-', this.i, q.k], ['+', this.j, q.c], ['+', this.k, q.i]],
[['+', this.c, q.k], ['+', this.i, q.j], ['-', this.j, q.i], ['+', this.k, q.c]]
]
}
}
/*
0 3 1 4 2 5 n
0 0 0 3 3 1 1
1 0 0 3 3 1 1
2 0 0 3 3 1 1
3 4 4 2 2 5 5
4 4 4 2 2 5 5
5 4 4 2 2 5 5
p
*/
const Cors = [
[0, 0, 3, 3, 1, 1],
[0, 0, 3, 3, 1, 1],
[0, 0, 3, 3, 1, 1],
[4, 4, 2, 2, 5, 5],
[4, 4, 2, 2, 5, 5],
[4, 4, 2, 2, 5, 5],
];
const Hexs = [], Muts = [], Eqls = [];
for (let m = 0; m <= 5; m++) {
Hexs.push(new Quaternion_str(`c${m}`, `i${m}`, `j${m}`, `k${m}`));
}
for (let m = 0; m <= 5; m++) {
for (let n = 0; n <= 5; n++) {
// Muts.push(Hexs[m].mutiply_array(Hexs[n]));
Muts.push(
new Quaternion_str(...
Hexs[m].mutiply_array(Hexs[n]).map(
e => e.map(
d => d.sort().join('')
).join('')
)
)
);
Eqls.push(Hexs[Cors[m][n]]);
}
}
const cijk = ['c','i','j','k']
const Equations = [];
for (let x = 0; x < 36; x++) {
for(let l of cijk){
Equations.push(`${Muts[x][l]} == ${Eqls[x][l]}`);
}
}
for (const e of Equations) {
console.log(e)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。