Bounding-radius of a layout result: max distance from origin across all * nodes. Used to size galaxy spacing so satellites don't overlap the primary * cluster. Layouts with a 1000-node cluster have radius ~1500; the previous * fixed 600 spacing buried satellites inside the primary mass. */
| 1291 | * cluster. Layouts with a 1000-node cluster have radius ~1500; the previous |
| 1292 | * fixed 600 spacing buried satellites inside the primary mass. */ |
| 1293 | static double layout_radius(const cbm_layout_result_t *r) { |
| 1294 | if (!r || r->node_count == 0) |
| 1295 | return 0.0; |
| 1296 | double max_r2 = 0.0; |
| 1297 | for (int i = 0; i < r->node_count; i++) { |
| 1298 | double x = (double)r->nodes[i].x; |
| 1299 | double y = (double)r->nodes[i].y; |
| 1300 | double z = (double)r->nodes[i].z; |
| 1301 | if (!isfinite(x) || !isfinite(y) || !isfinite(z)) |
| 1302 | continue; |
| 1303 | double r2 = x * x + y * y + z * z; |
| 1304 | if (r2 > max_r2) |
| 1305 | max_r2 = r2; |
| 1306 | } |
| 1307 | return sqrt(max_r2); |
| 1308 | } |
| 1309 | |
| 1310 | /* Attach the missed-graph skeleton (#963) to the primary layout doc as |
| 1311 | * "missed_graph": {"nodes":[...], "edges":[...], "offset":{x,y,z}} |
no outgoing calls
no test coverage detected