Skip to content

Commit 6390607

Browse files
committed
OP#9528: document W=H=0 invariant inline in relative-position formulas
1 parent c8e39b1 commit 6390607

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

OTAnalytics/plugin_datastore/track_geometry_store/polars_geometry_store.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1430,6 +1430,12 @@ def _compute_intersection_points(
14301430
(pl.col(START_Y) + pl.col(START_H) * offset.y).alias(PREVIOUS_Y),
14311431
]
14321432
)
1433+
# Segment-length math in the same coordinate space as
1434+
# INTERSECTION_X/Y. The offset is applied uniformly via
1435+
# START_W/END_W (and H counterparts); when geo column names are
1436+
# passed, the corresponding W/H values are 0 (point-based geo
1437+
# detections have no bounding box), so the offset terms vanish
1438+
# and the formula reduces to end_geo - start_geo.
14331439
.with_columns(
14341440
[
14351441
(
@@ -1449,6 +1455,9 @@ def _compute_intersection_points(
14491455
.alias(SEGMENT_LENGTH)
14501456
]
14511457
)
1458+
# Same W/H=0 invariant applies: when geo column names are passed
1459+
# the offset terms vanish, reducing the formula to
1460+
# INTERSECTION_X - start_geo.
14521461
.with_columns(
14531462
[
14541463
(

0 commit comments

Comments
 (0)