Grassmann.jl icon indicating copy to clipboard operation
Grassmann.jl copied to clipboard

Question: What is the best approach to visualize the ganja.js examples?

Open maxfreu opened this issue 5 years ago • 1 comments

Hi! I'm trying to implement the 2D projective geometric algebra examples from ganja. Implementing the cheat sheet and translating the code seems not to hard, but I do not yet understand I should create an interface between Grassmann and the julia plotting ecosystem. So maybe the question is a bit broad, but how can I translate e.g. a point or line (Chain or Multivector) into an "ordinary" 2D point or line which I can plot with Plots/Makie etc.? I saw your nice plots of vectorfields, so it is obviously possible - but maybe you can give or point me to some more examples. :)

Edit: I'm using @basis "0,1,1" as basis for 2D PGA, which is hopefully correct. (?)

maxfreu avatar Aug 27 '20 10:08 maxfreu

For traditional plotting I prefer to use Makie.jl package, which has interoperability with Grassmann.

There is also a proof of concept available allowing the usage of ganja.js together with Grassmann in Ganja.jl

Last but not least, there is an experimental Ajna.jl which allows simple 2D geometric algebra visualization.

julia> using Grassmann, Ajna

julia> basis"0,1,1" # first coordinate is used as origin
(⟨0,1,1⟩, v, v₁, v₂, v₃, v₁₂, v₁₃, v₂₃, v₁₂₃)

julia> Ajna.raster([(v1+v2)∧(v1+v3)])
100×100 Array{GrayA{Float64},2} with eltype ColorTypes.GrayA{Float64}:
...

There are many visualization options possible, so I would appreciate any examples or feedback you come up with yourself.

chakravala avatar Aug 27 '20 11:08 chakravala