Geometric Algebra in Raku
MultiVector module in this repository is an attempt to implement basic
Geometric Algebra in Raku.
With this module you can create vectors of arbitrary, albeit countable
dimension. You can then add and substract them, as well as multiplying them by
real scalars as you would do with any vectors, but you can also multiply and
divide them as made possible by the geometric algebra.
The module exports three array constants
which serve as normed bases for three orthogonal spaces respectively
Euclidean, anti-Euclidean and null.
In addition to the usual overloading of arithmetic operators, the module also
defines the infix operators
· (vim digraphs "AN" and ".M") as the
outer and scalar products. The scalar product is defined only on vectors (i.e.
multivectors of grade one).
say @e; # e₀
say @e*@e; # -e₀∧e₁
say 1 + @e; # 1+e₄
say @i∧@e; # -e₂∧i₃
say @o∧@i; # -i₂∧o₂
say @e²; # 1
say @i²; # -1
say @o²; # 0
say @o(@e + 2*@o); # 2