MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / sensing_status

Function sensing_status

webapp_modern.py:1645–1656  ·  view source on GitHub ↗

Report whether the bundled sensing backend is installed and running.

()

Source from the content-addressed store, hash-verified

1643 xi, yi = poly[i]['x'], poly[i]['y']
1644 xj, yj = poly[j]['x'], poly[j]['y']
1645 if ((yi > pt['y']) != (yj > pt['y'])) and \
1646 (pt['x'] < (xj - xi) * (pt['y'] - yi) / ((yj - yi) or 1e-9) + xi):
1647 inside = not inside
1648 j = i
1649 return inside
1650
1651
1652def _gf_inset(poly, frac):
1653 if not poly or len(poly) < 3 or not frac:
1654 return poly
1655 n = len(poly)
1656 cx = sum(p['x'] for p in poly) / n
1657 cy = sum(p['y'] for p in poly) / n
1658 return [{'x': p['x'] + (cx - p['x']) * frac, 'y': p['y'] + (cy - p['y']) * frac}
1659 for p in poly]

Callers

nothing calls this directly

Calls 1

_sensing_unit_stateFunction · 0.85

Tested by

no test coverage detected