commit cad4b4d6b071123a701aff0ed28b6f6ece112bbc
Author: Leszek Koltunski <leszek@koltunski.pl>
Date:   Thu Mar 12 01:06:30 2020 +0000

    Progress with object Movement. Looks like detecting which face got touched and where (in 2D in-face surface coordinates) does work now.

diff --git a/src/main/java/org/distorted/object/RubikObjectMovement.java b/src/main/java/org/distorted/object/RubikObjectMovement.java
index 11cc3cf8..1af4f4d8 100644
--- a/src/main/java/org/distorted/object/RubikObjectMovement.java
+++ b/src/main/java/org/distorted/object/RubikObjectMovement.java
@@ -114,7 +114,7 @@ public abstract class RubikObjectMovement
 
   private void convertTo2Dcoords(float[] point3D, Static3D axis, int lr, float[] output)
     {
-    float y0,y1,y2, x0,x1,x2;  // base X and Y vectors of the 2D coord system
+    float y0,y1,y2; // base Y vector of the 2D coord system
     float a0 = axis.get0();
     float a1 = axis.get1();
     float a2 = axis.get2();
@@ -138,9 +138,9 @@ public abstract class RubikObjectMovement
       y0 = norm*a0; y1= norm*(a1-1/a1); y2=norm*a2;
       }
 
-    x0 = y1*a2 - y2*a1;  //
-    x1 = y2*a0 - y0*a2;  // (2D coord baseY) x (axis) = 2D coord baseX
-    x2 = y0*a1 - y1*a0;  //
+    float x0 = y1*a2 - y2*a1;  //
+    float x1 = y2*a0 - y0*a2;  // (2D coord baseY) x (axis) = 2D coord baseX
+    float x2 = y0*a1 - y1*a0;  //
 
     float originAlpha = point3D[0]*a0 + point3D[1]*a1 + point3D[2]*a2;
 
diff --git a/src/main/java/org/distorted/object/RubikPyraminxMovement.java b/src/main/java/org/distorted/object/RubikPyraminxMovement.java
index 84db0b2c..b10cc0d3 100644
--- a/src/main/java/org/distorted/object/RubikPyraminxMovement.java
+++ b/src/main/java/org/distorted/object/RubikPyraminxMovement.java
@@ -55,8 +55,8 @@ class RubikPyraminxMovement extends RubikObjectMovement
   boolean isInsideFace(float[] p)
     {
     boolean a1 = p[1] >= -SQ3/6;
-    boolean a2 = p[1]*SQ3 <= 1 + 2*p[0];
-    boolean a3 = p[1]*SQ3 <= 1 - 2*p[0];
+    boolean a2 = p[1] <=  SQ3*(1.0f/3 + p[0]);
+    boolean a3 = p[1] <=  SQ3*(1.0f/3 - p[0]);
 
     return a1 && a2 && a3;
     }
