[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).
This commit is contained in:
Bill Currie 2023-05-22 13:03:35 +09:00
parent d01fc27dd5
commit 7c9b6aa0cc

View file

@ -160,7 +160,7 @@ static MultiVector *new_mv (Algebra *algebra, BasisLayout *layout)
double rc = rhs.components[j];
BasisBlade *rb = [rhs.layout bladeAt:j];
int rg = [rb grade];
BasisBlade *b = [lb geometricProduct:rb];
BasisBlade *b = [lb geometricProduct:rb metric:[algebra metric]];
int g = [b grade];
if ((lg <= rg) && (g != rg - lg)) {
continue;