15 ms·
Ganja.js: Geometric Algebra Generator for JavaScript, C++, C#, Rust, Python
- adamnemecek 6y agoYou should check out the bivector community dedicated to geometric algebra https://bivector.net/ https://bivector.net/. Check out a demo https://observablehq.com/@enkimute/animated-orbits https://observablehq.com/@enkimute/animated-orbits Join the discord https://discord.gg/vGY6pPk https://discord.gg/vGY6pPk. Enki (the guy behind bivector) also gave a talk on GA at SIGGRAPH 2019 https://www.youtube.com/watch?v=tX4H_ctggYo https://www.youtube.com/watch?v=tX4H_ctggYo
- iamwil 6y agoI thought this was called projective geometric algebra. Is the projective part optional? Or it refers to a specific thing. Why would there be a bivector community? Is it something relatively new, so there's a sense of "we're convinced, but other people aren't yet?"
- adamnemecek 6y agoIt’s a community dedicated to discussion and promotion of geometric algebra.
- fanf2 6y agoGeometric algebra is very general: it can model straight Euclidean space, non-Euclidean geometry, projective geometry (the familiar homogeneous coordinate system) and also conformal geometry. Some of the earlier applications of geometric algebra to computer graphics were based on conformal geometry (eg https://rjw57.github.io/phd-thesis/rjw-thesis.pdf https://rjw57.github.io/phd-thesis/rjw-thesis.pdf) because it can model more interesting things than projective geometry, but it is more computationally expensive than projective geometry. WRT community, the https://bivector.net https://bivector.net web site has a discussion forum for people interested in geometric algebra. I’m still a newbie so I don’t know the territory very well, but it is still fairly hard to get to grips with geometric algebra: there isn’t a lot of tutorial material and there’s still a lot of variation in details of notation and choice of basic operators, which is confusing for a beginner. I have been collecting links recently: see https://dotat.at/:/?q=geometric+algebra https://dotat.at/:/?q=geometric+algebra
- tsuru 6y agoAs a beginner, these are questions that lead to a big rabbit hole for me. 1. Yes, it seems Projective Geometric Algebra is new enough that the terminology and symbols are still being debated. 2. Yes, people who "get" it seem pretty convinced. I think the newish PGA is attractive for convincing real-time graphics software engineers and hardware engineers. For example, it has 16 floats in R(3,0,1) too. 3. The community is there to help spread the knowledge and to help as you start finding out about all the other Geometric Algebras. And overcoming the Euclidean mindset is tough. This is the first bit of higher-than-Calc math I've worked at in a long while and it feels like it's bending my mind in a good way, like Lisp did.
- ogogmad 6y agoMandelbar over the complex numbers: https://en.wikipedia.org/wiki/Tricorn_(mathematics) https://en.wikipedia.org/wiki/Tricorn_(mathematics) Mandelbar over the split-complex numbers: https://imgur.com/PkzY7B6 https://imgur.com/PkzY7B6 (admittedly, a bit underwhelming)
- danwills 6y agoMaybe there's interesting things to see if you change the parameter settings a bit? One thing that can be particularly interesting is using an exponent other than 2.0, regular Mandelbrot is quite interesting (dense and full of 'cuts') on a power of -1.55 for example (I call it 'negandel'.)
- vmurthy 6y agoAs an aside : In India, we refer to cannabis as ganja [0]. In case you are concerned about naming... [0] https://www.google.com/search?q=ganja+meaning&oq=ganja+meaning&aqs=chrome..69i64j0l6.6770j0j1&sourceid=chrome&ie=UTF-8 https://www.google.com/search?q=ganja+meaning&oq=ganja+meani...
- adamnemecek 6y agoThat’s the joke, yes. GA is sometimes called Grassmann algebra hence the “grass” reference.
- ogogmad 6y agoI thought Grassmann algebra consisted of only scalars, vectors, bivectors, etc. but not their linear combinations. So a mixed scalar plus vector is not an element of a Grassmann algebra. An alternative name is exterior algebra. You get Clifford algebra / Geometric Algebra (two names for the same thing) by taking closure under sums and considering a more general product. [edit: It appears I'm right: https://en.wikipedia.org/wiki/Exterior_algebra https://en.wikipedia.org/wiki/Exterior_algebra]
- jfarmer 6y agoGrassmann algebra and exterior algebra are synonyms.
- ogogmad 6y agoI said so in the comment if you read it.
- adamnemecek 6y agoThat is in fact the case however enki employed some artistic license.
- pjmlp 6y agoWhich got absorved into Portuguese as ganza.
- DreamScatter 6y agoIf you are interested in geometric algebra for the Julia language, you may want to check out Grassmann.jl also: https://github.com/chakravala/Grassmann.jl https://github.com/chakravala/Grassmann.jl
- ratww 6y ago> Grassman I'm starting to see a pattern in those names
- s1k3s 6y agoYou had to name it Ganja, didn't you? Edit: on second thought, good for you! Screw all the politically correctness BS that invades our software development stuff. There's no place for that in science.
- iso8859-1 6y agoThere is lots of place for politics in science, universities have internal politics also. Ganja is the second largest city in Azerbaijan, why is it such a political statement?
- deleted 6y ago[deleted]
- throwaway2245 6y agoIt effectively makes the license "don't use this in an educational setting", unfortunately.
- lou1306 6y agoThen again, the substance it refers to is perfectly legal in several of countries (and a number of states in the US). By that metric, Wine should be avoided too.
- throwaway2245 6y ago
- yudlejoza 6y ago> Mathematically, an algebra generated by ganja.js is ... You're generating code that relates to a certain algebra, likely for providing API for doing calculations based on that algebra (so an algebra library). Why would you call that 'algebra generated by ganja.js'? Generators [0], generating sets/functions [1][2], have precise definitions within mathematics, and they have zero relation to code generation. So they have zero relation to what ganja.js is doing (i.e., generating code). No offense, but you should know better. [0] https://en.wikipedia.org/wiki/Generator_(category_theory) https://en.wikipedia.org/wiki/Generator_(category_theory) [1] https://en.wikipedia.org/wiki/Generator_(mathematics) https://en.wikipedia.org/wiki/Generator_(mathematics) [2] https://en.wikipedia.org/wiki/Generating_function https://en.wikipedia.org/wiki/Generating_function
- enkimute 6y ago> You're generating code that relates to a certain algebra, likely for providing API for doing calculations based on that algebra (so an algebra library). Why would you call that 'algebra generated by ganja.js'? The 'generated by' in that sentence is referring to the code generation - not the mathematical generators. I'll change 'algebra' to 'algebra implementation' to make that more clear. (I figured the very sentence 'an algebra generated by ganja.js' disambiguates the interpretation, but I'm happy to stand corrected.) Ganja can create numerical implementations for a wide range of algebras (not just 'a certain algebra'), including any associative algebra (you can give it a Cayley table), although the focus is on Clifford Algebras, and providing the ability to stay close to the mathematical syntax. In order to do that it provides operator overloading, algebraic literals, etc .. (all features that do not natively exist in javascript). Because it is not 'a certain algebra', but a wide range, for which the code is only generated at runtime - it seemed a reasonable way of describing what is going on. Thanks for letting me know it confused you - will fix it right away!
- dan-robertson 6y agoFwiw I don’t really see a problem with the language the GP was complaining about. It’s pretty common for words to be heavily overloaded and ambiguous in mathematics and while this is often annoying and you may try to avoid this sort of issue, I don’t think you should be obliged to do that.
- tmcw 6y agoAbout time this project gets some love. One of the most mind-blowing bits of code I've ever encountered.
- HugoDaniel 6y agoIs there any easy tutorial for Geometric Algebra? Is it possible to learn it in like an afternoon? How can I learn it?
- layoutIfNeeded 6y agoYes. https://www.youtube.com/watch?v=0fF2xToQmgs https://www.youtube.com/watch?v=0fF2xToQmgs
- jcora 6y agoNo lol it's not possible to learn any math subject in depth in an afternoon, unless you mean "get a surface overview that you'll forget most things about in a couple of weeks". Proper foundations for non-Euclidean geometry are at least a one-semestre undergrad class level of work, which will take you at least several weeks if you do _only that_
- nosmokewhereiam 6y agoI love the name! Don't let anyone tell you different!
- kortex 6y agoA libary for generating code for not just quaternions, not just dual quats, but arbitrary Clifford algebras? Be still, my beating heart! I love geometric numbers. I wish they were introduced earlier in school, I would've actually enjoyed linear algebra class.
- deleted 6y ago[deleted]
- JackFr 6y agoI found the “wedge game” completely inscrutable. Read it closely a few times and was completely unable to figure out what I was supposed to do or how to do it.
- jessaustin 6y agoIt's like geometric construction games, except you can't use a compass. You can draw lines between points, project lines through points, and "average" both lines and points. The dragging motions aren't completely intuitive...
- enkimute 6y agoThey were designed with touchscreens in mind - I agree tho that it didn't work out exactly as I wanted. Someone did make a playthrough video of it : https://www.youtube.com/watch?v=UzEytSmwEpk&ab_channel=probiner https://www.youtube.com/watch?v=UzEytSmwEpk&ab_channel=probi...
- jessaustin 6y agoAccommodating touchscreens is great. If anything it seemed that the manipulations for points and those for lines are reversed? I kept getting an average when I was expecting a connecting line or an intersection? This may represent something deeper in GA that I haven't internalized yet. Nevertheless, it is possible to complete the game if one keeps trying.
- ankurcha 6y agoLet's name the library ganja so that no one takes it seriously....good move. I am all for being edgy and stuff but this sounds like a twenty something trying too hard :-D
- starmonger999 6y agoYeah, it's pretty strange that HN thinks that just because California legalized weed (supposedly to cut off cash flow to gangs, but maybe because of corporate pressure), now it's a perfectly wholesome, family-friendly drug, completely tone deaf to the wider world. It's all pretty tiring to be honest.
- eurasiantiger 6y agoHonestly, your tired tirade against cannabis is much more tiring. You obviously have no idea what you’re going on and on about, but you don’t let ignorance stop you from trying to limit the freedoms of others.
- gfxgirl 6y agoCan I make a scene graph using PGA?
- deleted 6y ago[deleted]
- newtonfractal 6y agoCan someone speak to what the applications of geometric algebra are? I see this topic show up often on HN, but no mathematicians I know in real life care about it, or even know about it. From googling geometric algebra and related terms, it just seems like more linear algebra to me - why the different name?
- yantrams 6y agoThis[1] can probably give you some insight into the applications side of things. 1 => https://blog.ycombinator.com/joan-lasenby-on-applications-of-geometric-algebra-in-engineering/ https://blog.ycombinator.com/joan-lasenby-on-applications-of...
- Lichtso 6y agoThe way I see it mainly for these reasons: - You get one unified simple framework which replaces or incorporates vector, matrix, complex, quaternion, tensor and spin algebra (all of which would otherwise need their own incompatible notations). [1] - Objects and transformations of objects can be expressed by the same multivectors. In the computer graphics of today you would have let's say: Vectors for points and translations, quaternions for interpolatable rotations, matrices for chaining up transformations and you would have separate objects for rays, planes, etc. But in geometric algebra all of that can be expressed by one class: The multivector. [2] [3] - It generalizes the same way in all dimensions (which is not true for e.g. vector algebra and the cross product). - One can easily derive geometric calculus from geometric algebra, thus have derivatives and integrals (which is a lot harder to do when you have 6 different frameworks and notation systems) - Bonus: Because it is unified, it has less edge cases and you need less workarounds, possibly making it also more stable / robust. It would be interesting if anyone could contribute if there are serious downsides except for not being widely used (mostly for historic reasons I guess). [1]: https://en.wikipedia.org/wiki/Geometric_calculus#/media/File:Geometric_Calculus_Family_Tree.png https://en.wikipedia.org/wiki/Geometric_calculus#/media/File... [2]: http://projectivegeometricalgebra.org/projgeomalg.pdf http://projectivegeometricalgebra.org/projgeomalg.pdf [3]: https://bivector.net/3DPGA.pdf https://bivector.net/3DPGA.pdf
- 6y ago
- magnio 6y agoThat intro in the README is wonderful. The three succinct paragraphs answer different questions, which is easily identified by the adverb in bold, and contain the appropriate information for each of them. It reminds me of axios.com articles, which are to the point and easy to find the relevant details.