Commit graph

8 commits

Author SHA1 Message Date
Bill Currie
a40fee2513 [gatest] Calculate correct sign for duals
I was aware in the beginning that the signs were probably incorrect, but
I had left them as I wasn't sure how they worked.  Thanks to enki
(bivector community), I was pointed in the right direction for getting
the calculations right: the product of a basis blade with its dual
(x !x) must product the positive pseudo-scalar.
2023-06-08 13:02:13 +09:00
Bill Currie
2858870153 [gatest] Fix use of uninitialized multivector components
I guess I had forgotten that new_mv() does *NOT* initialize the
components. Things just happened to work (usually) because memory was
not getting recycled.
2023-06-08 13:00:32 +09:00
Bill Currie
681629a5d1 [gatest] Parse division and dual operations 2023-05-29 09:52:10 +09:00
Bill Currie
4e441d359a [gatest] Write a simple parser for playing with GA
Currently only PGA(3) is supported, but that's because the parser is
rather simple (recursive descent with a lame lexer), but it works well
enough for playing with geometric algebra without having to recompile
every time.
2023-05-27 12:47:33 +09:00
Bill Currie
b9cff7aae0 [gatest] Implement and use multi-vector reverse
This gives the resultant point the correct sign.  Though the projective
divide would take care of the sign, this makes reading the point a
little less confusing (still need to sort out automatic blade reversals
for the likes of e31).
2023-05-24 18:25:47 +09:00
Bill Currie
7c9b6aa0cc [gatest] Use the metric when computing the dot product
As the dot product is a metric product, using the metric is vital to
getting the correct results. This fixes the calculation of the closest
point on a line to a point other than the origin (and a whole pile of
other issues, I imagine).
2023-05-22 13:03:35 +09:00
Bill Currie
008a64ee9b [gatest] Add multivector constructors to Algebra
This makes it much easier to create vectors of a specific grade or
grouping. It even found some mistakes in the multivector product
implementations.
2023-05-19 11:15:29 +09:00
Bill Currie
c1c77bd64a [gatest] Add basic geometric algebra test
This is for developing methods of implementing geometric algebra and
eventually playing with it visually.
2023-05-19 00:34:05 +09:00