hyperpoint now uses det3 not det (faster and also avoids some bugs for unknown reason)

This commit is contained in:
Zeno Rogue 2022-08-05 19:20:58 +02:00
parent 3184aea2be
commit ed4c715a5e
1 changed files with 2 additions and 2 deletions

View File

@ -1589,10 +1589,10 @@ EX hyperpoint project_on_triangle(hyperpoint h1, hyperpoint h2, hyperpoint h3) {
transmatrix T;
T[0] = h1; T[1] = h2; T[2] = h3;
T[3] = C0;
ld det_orig = det(T);
ld det_orig = det3(T);
hyperpoint orthogonal = (h2 - h1) ^ (h3 - h1);
T[0] = orthogonal; T[1] = h2-h1; T[2] = h3-h1;
ld det_orth = det(T);
ld det_orth = det3(T);
hyperpoint result = orthogonal * (det_orig / det_orth);
result[3] = 1;
return normalize(result);