Giter Site home page Giter Site logo

gamul's Introduction

This is a terse (but not efficient) definiton of the Geometric Algebra, in the smallest possible code
It makes no reference whatsoever to dot or wedge product, or the zoo of blades.

This is a multiplication system where the input types and values determine the input types.
It is an extension of complex numbers into arbitrary dimensions.
This implementation supports 30 dimensions (though in practice, it runs in O( 2^(2d) ) time(!)

A practical use is definitely for 3D space.
More work will need to be done to support unusual geometries like 5D conformal geometry, which is used for doing
simplified work in 3D space.

Note:

 - Indexing is done by bits.  Bit-count determines which blade a value is a member of.
 - e000 is the scalar basis.  e0, e00, e000, etc are all equivalent.  e01 == e001, etc.
 - The indexing for these vectors is in *binary*, not in decimal.
 - The blade numbers are in decimal.  ie:  a = (a_0 + a_1 + a_2 + a_3)
 - a_1 for 3D expands to:  a001 e001 + a010 e010 + a100 e100
 - The basis vectors e do NOT commute in general.
 - The same index for an e results in just 1.  ie:
   * a e001 e010 e100 e010 
   * -a e001 e010 e010 e100 (1 swap) 
   * -a e001 e100
   * -a e101 
 - Bit ordering is not a common explanation for GA, but using it is the key breakthrough here
 - For a vector space, all vectors are the e strings with 1 bit set, like:
   * e00001, e0010, e0100, e100
 - For a scalar, it's just the space with 0 bits set, of which there can be only one:
   * e0000
 - For a bivector, it is all combinations with 2 bits set:
   * e0011, e0101, e0110, e1001, e1010, e1100

The two key things are 
  * just to have multivectors be arrays of length 2^(1<<d) for whatever dimension is supported.
  * use bit addressing to find the elements
  * use a function that counts bitswaps (currently horribly inefficient) to find sign
  * xor is the key thing to making it conceptually simple
  * the popCount function (counting the number of bits in an integer efficiently) lets the blades be classified efficiently, and sorted to find the sign efficiently
  * there is quite a bit of waste however in not making special cases for the multiplies, which will make this definition very hard to understand like normal definitions are

For cases where the dimensions are not orthogonal, the function that determines i and multiplier will differ.
But the distribution of multiplication over addition, and commuting of scalars with basis vectors fixes everything except for that function returning (i, multiplier)

gamul's People

Contributors

rfielding avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

wtanksleyjr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.