Core Idea

From game mechanics to mathematical models

Coordinate Transformations

When a player enters one portal and exits another, their position and direction are transformed by rotation, translation, and coordinate-frame changes.

Momentum Conservation

A moving object keeps its speed through a portal, but its direction changes according to the exit portal’s orientation.

Graph Search

A puzzle can be modeled as a graph of states and actions. Algorithms such as BFS or A* can search for a valid solution path.

Topology

Portals connect distant locations as if space were folded, suggesting ideas from topology and non-Euclidean geometry.

Interactive Demo

Portal Coordinate Transformation Sandbox

Change the entry position, entry velocity, and exit portal angle. The simulation shows how a vector is transformed when it exits the portal.

Model:
p' = Rθ · p + t
v' = Rθ · v

Mathematical Structure

What the model demonstrates

1. Rotation Matrix

A portal can rotate a vector from the entry frame into the exit frame. In two dimensions, this can be modeled using a rotation matrix:

[ x' ]   [ cosθ  -sinθ ] [ x ]
[ y' ] = [ sinθ   cosθ ] [ y ]

2. Translation

After rotation, the object is placed near the exit portal. This is modeled by adding a translation vector t.

p' = Rθp + t

3. Momentum Direction

Speed is preserved in the simplified model, but direction changes according to the portal rotation:

v' = Rθv

4. Puzzle State Graph

A puzzle can be modeled as states connected by actions. A shortest solution can be searched using BFS:

start → place portal → move cube → press button → exit

Research Notes

Possible written explanation for university applications

This project began with a simple question: why do portal-based puzzles feel so mathematically strange? The answer is that the game mechanic combines several deep ideas: transformations from linear algebra, conservation principles from physics, state-space search from computer science, and spatial identification from topology.

Instead of treating a game as only entertainment, this project uses it as a modeling environment. The goal is to make invisible mathematical structures visible through interactive simulations.

Future versions could add 3D transformations, real puzzle maps, a graph-based puzzle solver, and a more formal explanation of how portals resemble topological gluing operations.