MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / dist_sq_center

Function dist_sq_center

nodedb-spatial/src/rtree/insert.rs:170–174  ·  view source on GitHub ↗
(lng: f64, lat: f64, bbox: &BoundingBox)

Source from the content-addressed store, hash-verified

168}
169
170fn dist_sq_center(lng: f64, lat: f64, bbox: &BoundingBox) -> f64 {
171 let cx = (bbox.min_lng + bbox.max_lng) / 2.0;
172 let cy = (bbox.min_lat + bbox.max_lat) / 2.0;
173 (lng - cx).powi(2) + (lat - cy).powi(2)
174}

Callers 1

forced_reinsertFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected