// Analyze all rotation matrices for a rigid cube. // Rotations around the Y axis to orient the sensor 4 different ways angles = [0 deg, 90 deg, 180 deg, 270 deg] // Rotations to point along all 6 directions rots = [[0,0,0], [0,0,90 deg], [0,0,180 deg], [0,0,270 deg], [90 deg,0,0], [-90 deg, 0,0]] for angle = angles { rot1 = callJava["frink.graphics.CoordinateTransformer3DFloat","makeRotateY", [0,0,0,angle]] for [xv, yv, zv] = rots { rot2 = callJava["frink.graphics.CoordinateTransformer3DFloat","makeRotateXYZ",[0,0,0, xv, yv, zv]] ct = rot2.multiply[rot1].round[] println[formatMatrix[formatFix[ct.toExpression[],1,0]]] } }