The CoffeeShop

Free ganja.js samples!

× Close

Roll your own ganja :

  • Browse the samples below.
  • Edit them, save and share.
  • Or hit the new button.

Ganja.js is for:

  • Learning and discovering Geometric Algebra
  • Testing GA Algorithms
  • Visualizing GA in any Algebra
  • Realtime GA in your own projects

The CoffeeShop

+ New
Save
Run
free samples
my stash
inspect stash
?

Stash Info

Stash URL click to copy

My stash

Complex \(\mathbb R_{0,1} \cong \mathbb C\)
Dual \(\mathbb R_{0,0,1} \cong \mathbb D\)
Quaternion\(\mathbb R_{0,2} \cong \mathbb H\)
Timespace \(\mathbb R_{1,3} \cong \mathbb M\)
2D PGA \(\mathbb R_{2,0,1}\)
3D PGA \(\mathbb R_{3,0,1}\)
2D CGA \(\mathbb R_{3,1}\)
3D CGA \(\mathbb R_{4,1}\)
3D Mother Algebra\(\mathbb R_{4,4}\)
3D CCGA \(\mathbb R_{6,3}\)
3D QCGA \(\mathbb R_{9,6}\)
Game
#GradeNameValue

Basis and Metric

Ganja.js supports operator overloading and algebraic literals.

OperatorJavascriptName
\(a*b\)a*bGeometric Product
\(a\wedge b\)a^bOuter Product
\(a\vee b\)a&bRegressive Product
\(a\cdot b\)a<<bLeft Contraction
\(a*b*\tilde a\)a>>>bSandwich Product
\(\tilde a\)~aConjugate
\(\bar a\)!aDual
\(\bar{\bar a}\)a.ReverseReverse
\(a^{-1}\)a**-1Inverse
\(e^a\)Math.E**aExponentiation
\(a_{\langle b \rangle}\)a.Grade(b)Grade Extraction
\(a+b\) or \(a-b\)a+b or a-bMultivector Addition/Subtraction
\(4.2e_{12}\)4.2e12Blade Literals

Ganja.js supports vectors and matrices with multivector elements.

OperatorJavascriptName
\(\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*wVector-Vector dot product.
\(A \bold v\)A*vMatrix-Vector product.
\(AB\)A*BMatrix-Matrix product.
\(A^{HT}\)~AConjugate-Transpose Matrix

Ganja.js can graph 2D and 3D PGA and CGA elements.

ElementDescription
multivectorpoint, pair, line, circle, sphere, plane
numberSets color. (e.g. #80FF0000 - transparent red)
stringLabel for the last drawn item
[point,point]Line segment between two points
[point,point,...,point](convex) polygon