Updated: August 2026 • Verified v1.2

Hexagonal Line Drawing & Line of Sight (LOS) Raycaster

Creative & DesignDesign

Local Browser Execution: Your input is processed locally in your browser and is not sent to UTL servers.
dist = max(|dx|, |dy|, |dz|); cube_lerp(a, b, t) = a + (b - a) * t; enforce rx + ry + rz = 0
Was this calculation helpful?

Understanding Your Results

Calculates the hex distance between origin `(q1, r1)` and target `(q2, r2)`, executes cube linear interpolation with deterministic tie-breaking nudges, generates the complete step-by-step tile list, and provides copy-ready TypeScript functions.

Practical Guidance & Next Steps

Using cube coordinates $(x, y, z)$ with linear interpolation ($ ext{lerp}$) and cube rounding is the mathematically purest way to draw straight lines on hex grids.

What is this?

A game development geometry utility that calculates the exact ordered sequence of hexagonal tiles traversed by a straight line or projectile.

How does it work?

1. Enter origin hex coordinates (q1, r1) and destination coordinates (q2, r2). 2. View total hex distance and the complete ordered step-by-step tile trajectory. 3. Copy the production-ready TypeScript hex line drawing function.

Why use it?

Eliminates jagged line artifacts and ambiguous edge selection in hex-based game engines.

Technical Scope & Calculation Limitations

Calculates regular planar hexagonal coordinate interpolation.

Frequently Asked Questions

The start and end points are converted to 3D cube coordinates. The algorithm samples $N$ points along the line segment (where $N$ is the hex distance) and rounds each floating point to the nearest discrete hex tile using cube rounding.
Windows Desktop & Widget Options

Want this capability on your Windows desktop?

All Windows widgets
Desktop Widget
9.4/10

Rainmeter Desktop Customization Engine

Powerful open-source desktop customization framework for hardware monitors, clocks, and audio visualizers.

FreeMedium InstallLow RAM
By Rainmeter Team (Open Source)View Widget
Complementary Utilities

Related Tools for Your Workflow

All Creative & Design tools
HTML5 / React / TypeScriptStatic Utility
HTML5 / React / TypeScriptStatic Utility
HTML5 / React / TypeScriptStatic Utility
HTML5 / React / TypeScriptStatic Utility