On the Subject of Rule of Three

"Third time's the charm." -Someone who somehow miraculously survived two previous bomb explosions.

Three spheres, colored red, yellow, and blue, are floating within a 3D space, along the x, y, and z axes. Each sphere is cycling through three different positions (known as "movements"). The movements will repeat until any sphere has been clicked. The end of the third movement from one cycle and the beginning of the first movement from the next cycle is separated by a long pause to indicate that the cycle has reset.

  • They can be east or west from the center of the module (positive and negative x axis/right and left),
  • They can be at the top or bottom of the module (positive and negative y axis/top and bottom),
  • They can be north or south from the center of the module (positive and negative z axis/back and front),
  • Or they can be in the middle of any of these axes (neutral or zero).

Take each axis and each position in the cycle, and interpret them as balanced ternary, where 30 (the "least significant" trit) corresponds to the first cycle and 32 (the "most significant" trit) corresponds to the third cycle. Convert these numbers back into decimal and assign them to the sphere's values. The three spheres should have three numbers each, one from x, one from y, and one from z.

With the three coordinates from each sphere, treat them as vertices of a triangle, and find the area of that triangle. The following explanation uses vectors and the cross product formula, although any method will work.

Denoting the points' coordinates as (x1, y1, z1), (x2, y2, z2) and (x3, y3, z3), pick any of these points and form vectors accordingly:

  • Let's say we choose a point number i, then the vectors' coordinates would be (xj - xi, yj - yi, zj - zi) and (xk - xi, yk - yi, zk - zi), where i, j, k are non-equal values 1, 2, 3.
  • Then calculate the size (or norm) of the vector product of those two vectors. The vector product of vectors u = (u1, u2, u3), v = (v1, v2, v3) is a vector u × v = (u2v3 - v2u3, v1u3 - u1v3, u1v2 - v1u2).
  • The size of vector w = (w1, w2, w3) is a non-negative real number:
    • w = √(w12 + w22 + w32).
  • Finally, halve the size to get the area of the triangle.

Once you have your area, remove any decimals, and convert it back into balanced ternary. Select any sphere to move to input phase.

Starting from the least significant digit, input your number one trit at a time, where red is -1, yellow is 0, and blue is 1. Input your answer before the spheres shrink completely to disarm the module.