haqlLabs

haql-coords · Free library

The well-bore formula is right. Is it the formula you meant?

Copy-pasted trigonometry sits in a hundred spreadsheets, and every one is a potential off-by-one in a well record. haql-coords gives you coordinate distance, offsets and well-bore geometry as checked, round-trippable functions — the same geometry the haql suite relies on. Free, MIT-licensed, no account, no cloud.

Try it now: pip install haql-coords — seconds to first distance.

Read the public guide: what it does, what it checks and what it does not do →

geometry with a round-trip
# install
pip install haql-coords

# distance between two well-bore coordinates
from haql_coords import distance  # import shape shown as an example

distance((0, 0), (3, 4))
5.0 m

# round-tripping an offset proves the result before it feeds QC
offset((5.0, 0), bearing=90, length=5)
(0.0, 5.0) ✓ reversible

Same geometry library used to sanity-check well records inside the production suite — and to audit the whole survey and certify the as-drilled path deterministically.

Why you need it

The formula you copied is probably fine. Being sure is the point.

The inherited formula

The cell came from the workbook left by someone who left years ago. Nobody can say what datum or convention it assumes.

The off-by-one record

One well's coordinates shifted by a digit and the nearest-well calculation quietly changes. Geometry checks are how that surfaces.

The unverifiable answer

A distance is a number; being able to invert it is a proof. Copied formulas rarely round-trip cleanly, which is exactly the slip you want caught before it matters.

The bug in QC's blind spot

QC rules that compare wells need trustworthy geometry upstream. haql-coords is that upstream, shared across the suite.

How it works

Small functions, checked both ways.

Deliberately small API: minimum-curvature well paths, UTM conversion, dog-leg severity, and a survey certificate that recomputes the as-drilled path. No dependencies pulling a whole analysis stack behind them.

1

Compute

Minimum-curvature points from survey stations — TVD, NS/EW displacement, DLS per segment.

2

Audit

check_survey() flags depth-order, inclination/azimuth range, and dog-legs above the 2.0°/100 ft limit — each with a stable rule id.

3

Certify

survey_certificate() emits a deterministic as-drilled certificate — final TVD, horizontal closure, max DLS, and a sha256 over the canonical station list. Same stations in, byte-identical certificate out.

Free, MIT

Replace the copied formula today.

No license manager, no seat count, no telemetry. It is the geometry foundation of the suite, and it is free on purpose.

github.com/haql-lab