(v)
| 87 | const dot02 = vectors[0].reduce((s, x, i) => s + x * vectors[2][i], 0); |
| 88 | const dot12 = vectors[1].reduce((s, x, i) => s + x * vectors[2][i], 0); |
| 89 | const norm = (v) => Math.sqrt(v.reduce((s, x) => s + x * x, 0)); |
| 90 | const cosine = (a, b) => |
| 91 | a.reduce((s, x, i) => s + x * b[i], 0) / (norm(a) * norm(b)); |
| 92 |