Straight lines across circles: the geometry inside Apsis

How Apsis decides exactly what a flying arrow hits, why paths along an orbit catch their neighbours, and how the game works out which arrow your finger meant.

5 min readBy Shravan Goswami and Claude Opus 5.5

A crowded Apsis system with one arrow held and its dotted path running out across the orbits
On this page

Apsis looks round, but everything that happens in it is straight. Arrows rest on circular orbits and fly in straight lines, and the puzzle lives in the gap between the two. This post covers how the game knows exactly what an arrow will hit, and which arrow you meant to touch.

An arrow is a capsule

To the game, an arrow is a capsule: a straight segment from its tail to its head, plus everything within 11 units of it. Every arrow is 22 units wide; a short one has a 44-unit segment and a long one 80. The pastel pill you see is exactly the capsule, so what you see is what collides.

Two capsules touch when the distance between their segments is at most 11 plus 11, which is 22. That turns every question about arrows into a question about line segments.

The path is a band

When an arrow flies, it slides along its own direction. Its segment already lies along that direction, so as it slides, it sweeps out a ray that starts at its tail. Thicken that ray by 11 on each side and you have the whole region the flying arrow passes through: a band as wide as the arrow.

A resting arrow is in the way exactly when its own segment comes within 22 units of that ray. That is why holding an arrow shows a dotted line over a faint band: the band is not decoration, it is the precise shape of the question.

A held Apsis arrow with its dotted path over a faint band crossing several orbits
Level 70: the band is the arrow's width swept along its path, and any arrow touching it is in the way

Solved exactly, not stepped

Many games move an object a little at a time and test for overlap, which is approximate. Apsis solves each flight exactly. In two dimensions, unless two segments cross, their closest points always include an endpoint of one of them. So the first moment of contact is always one of four cases: an end of the flying arrow meeting the other capsule, or an end of the other arrow meeting the flying capsule, seen from the arrow’s point of view. Each case is a ray hitting a capsule, which is a small equation with an exact answer.

We checked it against the slow way: over 2,000 random layouts, a brute-force march in 0.01-unit steps found 271 contacts, and the exact answer never differed by more than the step. All 1,566 misses agreed too. A flight check on a crowded board takes about 35 microseconds, so the game, the solver and the generator all share one exact rule.

Why paths along an orbit catch their neighbours

Here is where the circles come in. Many arrows point along their orbit, and a straight line that starts along a circle leaves it only slowly.

Take an orbit of radius r and a straight path that starts touching it. After travelling t units, the path is at distance √(r² + t²) from the sun. For small t that is barely more than r. On an orbit of radius 190, after 60 units the path is only about 9 units outside the orbit, well within an arrow’s reach.

So an arrow lying along its orbit usually runs into the next arrow ahead on the same orbit, and the level generator uses exactly that when it places blockers.

An Apsis arrow frozen mid-flight, leaving the system along a straight line with a streak behind it
Level 66: a launch is a straight line, whatever orbit it starts on

Diagonals that point inward make the opposite near miss. An inward diagonal on the innermost orbit of radius 90 passes the sun’s centre at 90 × sin 45°, about 63.6 units, while the sun plus half an arrow reaches 57. The closest of all the inward diagonals in the game clears the sun by 6.6 units.

Which arrow did your finger mean?

The other geometry problem is the finger. A touch picks the arrow whose surface is nearest, as long as it is within 26 units. Nearest surface, not nearest centre, matters for long arrows: a touch near the end of an 80-unit arrow is closer to its surface than to a short neighbour’s centre.

How often does a quick tap pick the wrong arrow? We measured it by aiming at every arrow’s centre with a randomly spread error, 40 touches per arrow. The table gives the average distance to an arrow’s nearest neighbour, and how often a touch picked the wrong arrow at two sizes of spread:

LevelsNearest arrow12-unit spread20-unit spread
1 to 3050 units0.5%3.6%
31 to 6025 units1.0%5.9%
61 to 9022 units1.4%6.7%
91 and up18 units1.5%8.0%

The board is about 690 pixels across on a 720-pixel-wide screen, so 20 units is roughly 2 mm on a phone: a careful finger. The mistakes follow how close neighbours are on average, which is set by how many arrows a level has, not by the minimum gap between arrows. Widening that gap would move few arrows and change little.

A chart of how many arrows Apsis puts on the board at each level, rising steadily
Arrows per level: as boards fill up, neighbours sit closer and a quick tap is more likely to catch the wrong one

So the fix is in the gesture. A press only lifts an arrow and shows its path; nothing counts until you let go. While the finger slides, a nearer arrow takes over the hold, but only once it is 4 units nearer than the one already held. Without that margin, a finger resting halfway between two neighbours would flicker the hold between them on every tiny movement. And a touch that starts in open space never picks anything up, so a drag across the board cannot end in a launch.

For what these rules mean in play, read the beginner tips and how the levels are made.

Comments

Sign in with GitHub to leave a comment or a question.