Free ganja.js samples!
Stash Info
Image Options
Stash URLclick to copy
My stash
| # | Grade | Name | Value |
|---|
Basis and Metric
Ganja.js supports operator overloading and algebraic literals.
| Operator | Javascript | Name |
|---|---|---|
| \(a*b\) | a*b | Geometric Product |
| \(a\cdot b\) | a|b | Inner Product |
| \(a\wedge b\) | a^b | Outer Product |
| \(a\vee b\) | a&b | Regressive Product |
| \(a\rfloor b\) | a<<b | Left Contraction |
| \(a*b*\tilde a\) | a>>>b | Sandwich Product |
| \(\tilde a\) | ~a | Conjugate |
| \(\bar a\) | !a | Dual |
| \(\bar{\bar a}\) | a.Reverse | Reverse |
| \(a^{-1}\) | a**-1 | Inverse |
| \(e^a\) | Math.E**a | Exponentiation |
| \(a_{\langle b \rangle}\) | a.Grade(b) | Grade Extraction |
| \(a+b\) or \(a-b\) | a+b or a-b | Multivector Addition/Subtraction |
| \(4.2e_{12}\) | 4.2e12 | Blade Literals |
Ganja.js supports vectors and matrices with multivector elements.
| Operator | Javascript | Name |
|---|---|---|
| \(\bold v = \begin{bmatrix} e_1 & 0 \end{bmatrix} \) | v = [1e1,0]; | Vector |
| \(\bold A = \begin{bmatrix} 1 & 0 \\ 0 & e_{12} \end{bmatrix} \) | A = [[1,0],[0,1e12]]; | Matrix |
| \(\bold v \cdot \bold w\) | v*w | Vector-Vector dot product. |
| \(A \bold v\) | A*v | Matrix-Vector product. |
| \(AB\) | A*B | Matrix-Matrix product. |
| \(A^{HT}\) | ~A | Conjugate-Transpose Matrix |
Ganja.js can graph 2D and 3D PGA and CGA elements.
| Element | Description |
|---|---|
| multivector | point, pair, line, circle, sphere, plane |
| number | Sets color. (e.g. #80FF0000 - transparent red) |
| string | Label for the last drawn item |
| [point,point] | Line segment between two points |
| [point,point,...,point] | (convex) polygon |